1 /* Automatically generated code, do not edit */
2 /* Generated from source file: side3h.pck */
3 
side3h_3d_filter(const double * p0,const double * p1,const double * p2,const double * p3,double h0,double h1,double h2,double h3,const double * q0,const double * q1,const double * q2)4 inline int side3h_3d_filter( const double* p0, const double* p1, const double* p2, const double* p3, double h0, double h1, double h2, double h3, const double* q0, const double* q1, const double* q2) {
5     double l1;
6     l1 = (h1 - h0);
7     double l2;
8     l2 = (h2 - h0);
9     double l3;
10     l3 = (h3 - h0);
11     double p1_0_p0_0 = (p1[0] - p0[0]);
12     double q0_0_p0_0 = (q0[0] - p0[0]);
13     double p1_1_p0_1 = (p1[1] - p0[1]);
14     double q0_1_p0_1 = (q0[1] - p0[1]);
15     double p1_2_p0_2 = (p1[2] - p0[2]);
16     double q0_2_p0_2 = (q0[2] - p0[2]);
17     double a10;
18     a10 = (2 * (((p1_0_p0_0 * q0_0_p0_0) + (p1_1_p0_1 * q0_1_p0_1)) + (p1_2_p0_2 * q0_2_p0_2)));
19     double q1_0_p0_0 = (q1[0] - p0[0]);
20     double q1_1_p0_1 = (q1[1] - p0[1]);
21     double q1_2_p0_2 = (q1[2] - p0[2]);
22     double a11;
23     a11 = (2 * (((p1_0_p0_0 * q1_0_p0_0) + (p1_1_p0_1 * q1_1_p0_1)) + (p1_2_p0_2 * q1_2_p0_2)));
24     double q2_0_p0_0 = (q2[0] - p0[0]);
25     double q2_1_p0_1 = (q2[1] - p0[1]);
26     double q2_2_p0_2 = (q2[2] - p0[2]);
27     double a12;
28     a12 = (2 * (((p1_0_p0_0 * q2_0_p0_0) + (p1_1_p0_1 * q2_1_p0_1)) + (p1_2_p0_2 * q2_2_p0_2)));
29     double p2_0_p0_0 = (p2[0] - p0[0]);
30     double p2_1_p0_1 = (p2[1] - p0[1]);
31     double p2_2_p0_2 = (p2[2] - p0[2]);
32     double a20;
33     a20 = (2 * (((p2_0_p0_0 * q0_0_p0_0) + (p2_1_p0_1 * q0_1_p0_1)) + (p2_2_p0_2 * q0_2_p0_2)));
34     double a21;
35     a21 = (2 * (((p2_0_p0_0 * q1_0_p0_0) + (p2_1_p0_1 * q1_1_p0_1)) + (p2_2_p0_2 * q1_2_p0_2)));
36     double a22;
37     a22 = (2 * (((p2_0_p0_0 * q2_0_p0_0) + (p2_1_p0_1 * q2_1_p0_1)) + (p2_2_p0_2 * q2_2_p0_2)));
38     double p3_0_p0_0 = (p3[0] - p0[0]);
39     double p3_1_p0_1 = (p3[1] - p0[1]);
40     double p3_2_p0_2 = (p3[2] - p0[2]);
41     double a30;
42     a30 = (2 * (((p3_0_p0_0 * q0_0_p0_0) + (p3_1_p0_1 * q0_1_p0_1)) + (p3_2_p0_2 * q0_2_p0_2)));
43     double a31;
44     a31 = (2 * (((p3_0_p0_0 * q1_0_p0_0) + (p3_1_p0_1 * q1_1_p0_1)) + (p3_2_p0_2 * q1_2_p0_2)));
45     double a32;
46     a32 = (2 * (((p3_0_p0_0 * q2_0_p0_0) + (p3_1_p0_1 * q2_1_p0_1)) + (p3_2_p0_2 * q2_2_p0_2)));
47     double b00;
48     b00 = ((a11 * a22) - (a12 * a21));
49     double b01;
50     b01 = (a21 - a22);
51     double b02;
52     b02 = (a12 - a11);
53     double b10;
54     b10 = ((a12 * a20) - (a10 * a22));
55     double b11;
56     b11 = (a22 - a20);
57     double b12;
58     b12 = (a10 - a12);
59     double b20;
60     b20 = ((a10 * a21) - (a11 * a20));
61     double b21;
62     b21 = (a20 - a21);
63     double b22;
64     b22 = (a11 - a10);
65     double Delta;
66     Delta = ((b00 + b10) + b20);
67     double DeltaLambda0;
68     DeltaLambda0 = (((b01 * l1) + (b02 * l2)) + b00);
69     double DeltaLambda1;
70     DeltaLambda1 = (((b11 * l1) + (b12 * l2)) + b10);
71     double DeltaLambda2;
72     DeltaLambda2 = (((b21 * l1) + (b22 * l2)) + b20);
73     double r;
74     r = ((Delta * l3) - (((a30 * DeltaLambda0) + (a31 * DeltaLambda1)) + (a32 * DeltaLambda2)));
75     double eps;
76     double max1 = fabs(q2_2_p0_2);
77     if( (max1 < fabs(q0_0_p0_0)) )
78     {
79         max1 = fabs(q0_0_p0_0);
80     }
81     if( (max1 < fabs(q0_1_p0_1)) )
82     {
83         max1 = fabs(q0_1_p0_1);
84     }
85     if( (max1 < fabs(q0_2_p0_2)) )
86     {
87         max1 = fabs(q0_2_p0_2);
88     }
89     if( (max1 < fabs(q1_0_p0_0)) )
90     {
91         max1 = fabs(q1_0_p0_0);
92     }
93     if( (max1 < fabs(q1_1_p0_1)) )
94     {
95         max1 = fabs(q1_1_p0_1);
96     }
97     if( (max1 < fabs(q1_2_p0_2)) )
98     {
99         max1 = fabs(q1_2_p0_2);
100     }
101     if( (max1 < fabs(q2_0_p0_0)) )
102     {
103         max1 = fabs(q2_0_p0_0);
104     }
105     if( (max1 < fabs(q2_1_p0_1)) )
106     {
107         max1 = fabs(q2_1_p0_1);
108     }
109     double max2 = fabs(p2_0_p0_0);
110     if( (max2 < fabs(p2_1_p0_1)) )
111     {
112         max2 = fabs(p2_1_p0_1);
113     }
114     if( (max2 < fabs(p2_2_p0_2)) )
115     {
116         max2 = fabs(p2_2_p0_2);
117     }
118     double max3 = fabs(p1_0_p0_0);
119     if( (max3 < fabs(p1_1_p0_1)) )
120     {
121         max3 = fabs(p1_1_p0_1);
122     }
123     if( (max3 < fabs(p1_2_p0_2)) )
124     {
125         max3 = fabs(p1_2_p0_2);
126     }
127     double lower_bound_1;
128     double upper_bound_1;
129     int Delta_sign;
130     int int_tmp_result;
131     lower_bound_1 = max1;
132     upper_bound_1 = max1;
133     if( (max2 < lower_bound_1) )
134     {
135         lower_bound_1 = max2;
136     }
137     else
138     {
139         if( (max2 > upper_bound_1) )
140         {
141             upper_bound_1 = max2;
142         }
143     }
144     if( (max3 < lower_bound_1) )
145     {
146         lower_bound_1 = max3;
147     }
148     else
149     {
150         if( (max3 > upper_bound_1) )
151         {
152             upper_bound_1 = max3;
153         }
154     }
155     if( (lower_bound_1 < 2.22985945097100191780e-74) )
156     {
157         return FPG_UNCERTAIN_VALUE;
158     }
159     else
160     {
161         if( (upper_bound_1 > 2.59614842926741294957e+33) )
162         {
163             return FPG_UNCERTAIN_VALUE;
164         }
165         eps = (8.99983341597279045654e-14 * (((max3 * max1) * max2) * max1));
166         if( (Delta > eps) )
167         {
168             int_tmp_result = 1;
169         }
170         else
171         {
172             if( (Delta < -eps) )
173             {
174                 int_tmp_result = -1;
175             }
176             else
177             {
178                 return FPG_UNCERTAIN_VALUE;
179             }
180         }
181     }
182     Delta_sign = int_tmp_result;
183     double max4 = max2;
184     if( (max4 < fabs(l1)) )
185     {
186         max4 = fabs(l1);
187     }
188     if( (max4 < fabs(l2)) )
189     {
190         max4 = fabs(l2);
191     }
192     double max5 = max2;
193     if( (max5 < max3) )
194     {
195         max5 = max3;
196     }
197     if( (max5 < fabs(l3)) )
198     {
199         max5 = fabs(l3);
200     }
201     double max6 = max2;
202     if( (max6 < fabs(q2_2_p0_2)) )
203     {
204         max6 = fabs(q2_2_p0_2);
205     }
206     if( (max6 < fabs(q0_0_p0_0)) )
207     {
208         max6 = fabs(q0_0_p0_0);
209     }
210     if( (max6 < fabs(q0_1_p0_1)) )
211     {
212         max6 = fabs(q0_1_p0_1);
213     }
214     if( (max6 < fabs(q0_2_p0_2)) )
215     {
216         max6 = fabs(q0_2_p0_2);
217     }
218     if( (max6 < fabs(q2_0_p0_0)) )
219     {
220         max6 = fabs(q2_0_p0_0);
221     }
222     if( (max6 < fabs(q2_1_p0_1)) )
223     {
224         max6 = fabs(q2_1_p0_1);
225     }
226     double max7 = max3;
227     if( (max7 < fabs(p3_0_p0_0)) )
228     {
229         max7 = fabs(p3_0_p0_0);
230     }
231     if( (max7 < fabs(p3_1_p0_1)) )
232     {
233         max7 = fabs(p3_1_p0_1);
234     }
235     if( (max7 < fabs(p3_2_p0_2)) )
236     {
237         max7 = fabs(p3_2_p0_2);
238     }
239     int r_sign;
240     int int_tmp_result_FFWKCAA;
241     lower_bound_1 = max6;
242     upper_bound_1 = max6;
243     if( (max5 < lower_bound_1) )
244     {
245         lower_bound_1 = max5;
246     }
247     else
248     {
249         if( (max5 > upper_bound_1) )
250         {
251             upper_bound_1 = max5;
252         }
253     }
254     if( (max1 < lower_bound_1) )
255     {
256         lower_bound_1 = max1;
257     }
258     else
259     {
260         if( (max1 > upper_bound_1) )
261         {
262             upper_bound_1 = max1;
263         }
264     }
265     if( (max4 < lower_bound_1) )
266     {
267         lower_bound_1 = max4;
268     }
269     else
270     {
271         if( (max4 > upper_bound_1) )
272         {
273             upper_bound_1 = max4;
274         }
275     }
276     if( (max7 < lower_bound_1) )
277     {
278         lower_bound_1 = max7;
279     }
280     else
281     {
282         if( (max7 > upper_bound_1) )
283         {
284             upper_bound_1 = max7;
285         }
286     }
287     if( (lower_bound_1 < 5.53478725478149652989e-50) )
288     {
289         return FPG_UNCERTAIN_VALUE;
290     }
291     else
292     {
293         if( (upper_bound_1 > 2.59614842926741294957e+33) )
294         {
295             return FPG_UNCERTAIN_VALUE;
296         }
297         eps = (7.73996217364502738018e-13 * (((((max7 * max1) * max6) * max1) * max5) * max4));
298         if( (r > eps) )
299         {
300             int_tmp_result_FFWKCAA = 1;
301         }
302         else
303         {
304             if( (r < -eps) )
305             {
306                 int_tmp_result_FFWKCAA = -1;
307             }
308             else
309             {
310                 return FPG_UNCERTAIN_VALUE;
311             }
312         }
313     }
314     r_sign = int_tmp_result_FFWKCAA;
315     return (Delta_sign * r_sign);
316 }
317 
318