Graphite Version 3
An experimental 3D geometry processing program
Loading...
Searching...
No Matches
det_compare_4d.h
1/* Automatically generated code, do not edit */
2/* Generated from source file: det_compare_4d.pck */
3
4inline int det_compare_4d_filter( const double* p0, const double* p1, const double* p2, const double* p3, const double* p4) {
5 double a3_0;
6 a3_0 = (p4[0] - p3[0]);
7 double a3_1;
8 a3_1 = (p4[1] - p3[1]);
9 double a3_2;
10 a3_2 = (p4[2] - p3[2]);
11 double a3_3;
12 a3_3 = (p4[3] - p3[3]);
13 double m12;
14 m12 = ((p1[0] * p0[1]) - (p0[0] * p1[1]));
15 double m13;
16 m13 = ((p2[0] * p0[1]) - (p0[0] * p2[1]));
17 double m14;
18 m14 = ((a3_0 * p0[1]) - (p0[0] * a3_1));
19 double m23;
20 m23 = ((p2[0] * p1[1]) - (p1[0] * p2[1]));
21 double m24;
22 m24 = ((a3_0 * p1[1]) - (p1[0] * a3_1));
23 double m34;
24 m34 = ((a3_0 * p2[1]) - (p2[0] * a3_1));
25 double m123;
26 m123 = (((m23 * p0[2]) - (m13 * p1[2])) + (m12 * p2[2]));
27 double m124;
28 m124 = (((m24 * p0[2]) - (m14 * p1[2])) + (m12 * a3_2));
29 double m134;
30 m134 = (((m34 * p0[2]) - (m14 * p2[2])) + (m13 * a3_2));
31 double m234;
32 m234 = (((m34 * p1[2]) - (m24 * p2[2])) + (m23 * a3_2));
33 double Delta;
34 Delta = ((((m234 * p0[3]) - (m134 * p1[3])) + (m124 * p2[3])) - (m123 * a3_3));
35 int int_tmp_result;
36 double eps;
37 double max1 = fabs(p0[0]);
38 if( (max1 < fabs(p1[0])) )
39 {
40 max1 = fabs(p1[0]);
41 }
42 if( (max1 < fabs(p2[0])) )
43 {
44 max1 = fabs(p2[0]);
45 }
46 if( (max1 < fabs(a3_0)) )
47 {
48 max1 = fabs(a3_0);
49 }
50 double max2 = fabs(p0[1]);
51 if( (max2 < fabs(p1[1])) )
52 {
53 max2 = fabs(p1[1]);
54 }
55 if( (max2 < fabs(p2[1])) )
56 {
57 max2 = fabs(p2[1]);
58 }
59 if( (max2 < fabs(a3_1)) )
60 {
61 max2 = fabs(a3_1);
62 }
63 double max3 = fabs(p0[2]);
64 if( (max3 < fabs(p1[2])) )
65 {
66 max3 = fabs(p1[2]);
67 }
68 if( (max3 < fabs(p2[2])) )
69 {
70 max3 = fabs(p2[2]);
71 }
72 if( (max3 < fabs(a3_2)) )
73 {
74 max3 = fabs(a3_2);
75 }
76 double max4 = fabs(p0[3]);
77 if( (max4 < fabs(p1[3])) )
78 {
79 max4 = fabs(p1[3]);
80 }
81 if( (max4 < fabs(p2[3])) )
82 {
83 max4 = fabs(p2[3]);
84 }
85 if( (max4 < fabs(a3_3)) )
86 {
87 max4 = fabs(a3_3);
88 }
89 double lower_bound_1;
90 double upper_bound_1;
91 lower_bound_1 = max1;
92 upper_bound_1 = max1;
93 if( (max2 < lower_bound_1) )
94 {
95 lower_bound_1 = max2;
96 }
97 else
98 {
99 if( (max2 > upper_bound_1) )
100 {
101 upper_bound_1 = max2;
102 }
103 }
104 if( (max3 < lower_bound_1) )
105 {
106 lower_bound_1 = max3;
107 }
108 else
109 {
110 if( (max3 > upper_bound_1) )
111 {
112 upper_bound_1 = max3;
113 }
114 }
115 if( (max4 < lower_bound_1) )
116 {
117 lower_bound_1 = max4;
118 }
119 else
120 {
121 if( (max4 > upper_bound_1) )
122 {
123 upper_bound_1 = max4;
124 }
125 }
126 if( (lower_bound_1 < 3.11018333467425326847e-74) )
127 {
128 return FPG_UNCERTAIN_VALUE;
129 }
130 else
131 {
132 if( (upper_bound_1 > 1.44740111546645196071e+76) )
133 {
134 return FPG_UNCERTAIN_VALUE;
135 }
136 eps = (2.37793769622390420735e-14 * (((max1 * max2) * max3) * max4));
137 if( (Delta > eps) )
138 {
139 int_tmp_result = 1;
140 }
141 else
142 {
143 if( (Delta < -eps) )
144 {
145 int_tmp_result = -1;
146 }
147 else
148 {
149 return FPG_UNCERTAIN_VALUE;
150 }
151 }
152 }
153 return int_tmp_result;
154}