1 #ifndef L1Extrapolation_h
2 #define L1Extrapolation_h
10 #define cnst const fvec
13 #ifdef ANALYTICEXTRAPOLATION
28 cnst c1 = 1., c2 = 2., c3 = 3., c4 = 4., c6 = 6., c9 = 9., c15 = 15.,
29 c18 = 18., c45 = 45., c2i = 1. / 2., c3i = 1. / 3., c6i = 1. / 6.,
33 const fvec dz = (z_out - T.
z);
34 const fvec dz2 = dz * dz;
35 const fvec dz3 = dz2 * dz;
44 const fvec y2 =
y * c2;
45 const fvec x2 =
x * c2;
46 const fvec x4 =
x * c4;
47 const fvec xx31 = xx * c3 + c1;
48 const fvec xx159 = xx * c15 + c9;
50 const fvec Ay = -xx - c1;
51 const fvec Ayy =
x * (xx * c3 + c3);
52 const fvec Ayz = -c2 * xy;
53 const fvec Ayyy = -(c15 * xx * xx + c18 * xx + c3);
55 const fvec Ayy_x = c3 * xx31;
56 const fvec Ayyy_x = -x4 * xx159;
58 const fvec Bx = yy + c1;
59 const fvec Byy =
y * xx31;
60 const fvec Byz = c2 * xx + c1;
61 const fvec Byyy = -xy * xx159;
63 const fvec Byy_x = c6 * xy;
64 const fvec Byyy_x = -
y * (c45 * xx + c9);
65 const fvec Byyy_y = -
x * xx159;
69 const fvec t2 = c1 + xx + yy;
72 const fvec ht =
h * t;
77 const fvec Fx1 = (F.
cx1 + c2 * F.
cx2 * ddz) * dz;
80 const fvec Fy1 = (F.
cy1 + c2 * F.
cy2 * ddz) * dz;
83 const fvec Fz1 = (F.
cz1 + c2 * F.
cz2 * ddz) * dz;
88 const fvec sx = (Fx0 + Fx1 * c2i + Fx2 * c3i);
89 const fvec sy = (Fy0 + Fy1 * c2i + Fy2 * c3i);
90 const fvec sz = (Fz0 + Fz1 * c2i + Fz2 * c3i);
92 const fvec Sx = (Fx0 * c2i + Fx1 * c6i + Fx2 * c12i);
93 const fvec Sy = (Fy0 * c2i + Fy1 * c6i + Fy2 * c12i);
94 const fvec Sz = (Fz0 * c2i + Fz1 * c6i + Fz2 * c12i);
98 cnst d = 1. / 360., c00 = 30. * 6. *
d, c01 = 30. * 2. *
d, c02 = 30. *
d,
99 c10 = 3. * 40. *
d, c11 = 3. * 15. *
d, c12 = 3. * 8. *
d,
100 c20 = 2. * 45. *
d, c21 = 2. * 2. * 9. *
d, c22 = 2. * 2. * 5. *
d;
101 syz = Fy0 * (c00 * Fz0 + c01 * Fz1 + c02 * Fz2)
102 + Fy1 * (c10 * Fz0 + c11 * Fz1 + c12 * Fz2)
103 + Fy2 * (c20 * Fz0 + c21 * Fz1 + c22 * Fz2);
108 cnst d = 1. / 2520., c00 = 21. * 20. *
d, c01 = 21. * 5. *
d,
109 c02 = 21. * 2. *
d, c10 = 7. * 30. *
d, c11 = 7. * 9. *
d,
110 c12 = 7. * 4. *
d, c20 = 2. * 63. *
d, c21 = 2. * 21. *
d,
112 Syz = Fy0 * (c00 * Fz0 + c01 * Fz1 + c02 * Fz2)
113 + Fy1 * (c10 * Fz0 + c11 * Fz1 + c12 * Fz2)
114 + Fy2 * (c20 * Fz0 + c21 * Fz1 + c22 * Fz2);
117 const fvec syy = sy * sy * c2i;
118 const fvec syyy = syy * sy * c3i;
122 cnst d = 1. / 2520., c00 = 420. *
d, c01 = 21. * 15. *
d,
123 c02 = 21. * 8. *
d, c03 = 63. *
d, c04 = 70. *
d, c05 = 20. *
d;
124 Syy = Fy0 * (c00 * Fy0 + c01 * Fy1 + c02 * Fy2)
125 + Fy1 * (c03 * Fy1 + c04 * Fy2) + c05 * Fy2 * Fy2;
130 cnst d = 1. / 181440., c000 = 7560 *
d, c001 = 9 * 1008 *
d,
131 c002 = 5 * 1008 *
d, c011 = 21 * 180 *
d, c012 = 24 * 180 *
d,
132 c022 = 7 * 180 *
d, c111 = 540 *
d, c112 = 945 *
d, c122 = 560 *
d,
134 const fvec Fy22 = Fy2 * Fy2;
136 * (Fy0 * (c000 * Fy0 + c001 * Fy1 + c002 * Fy2)
137 + Fy1 * (c011 * Fy1 + c012 * Fy2) + c022 * Fy22)
138 + Fy1 * (Fy1 * (c111 * Fy1 + c112 * Fy2) + c122 * Fy22)
143 const fvec sA1 = sx * xy + sy * Ay + sz *
y;
144 const fvec sA1_x = sx *
y - sy * x2;
145 const fvec sA1_y = sx *
x + sz;
147 const fvec sB1 = sx * Bx - sy * xy - sz *
x;
148 const fvec sB1_x = -sy *
y - sz;
149 const fvec sB1_y = sx * y2 - sy *
x;
151 const fvec SA1 = Sx * xy + Sy * Ay + Sz *
y;
152 const fvec SA1_x = Sx *
y - Sy * x2;
153 const fvec SA1_y = Sx *
x + Sz;
155 const fvec SB1 = Sx * Bx - Sy * xy - Sz *
x;
156 const fvec SB1_x = -Sy *
y - Sz;
157 const fvec SB1_y = Sx * y2 - Sy *
x;
160 const fvec sA2 = syy * Ayy + syz * Ayz;
161 const fvec sA2_x = syy * Ayy_x - syz * y2;
162 const fvec sA2_y = -syz * x2;
163 const fvec sB2 = syy * Byy + syz * Byz;
164 const fvec sB2_x = syy * Byy_x + syz * x4;
165 const fvec sB2_y = syy * xx31;
167 const fvec SA2 = Syy * Ayy + Syz * Ayz;
168 const fvec SA2_x = Syy * Ayy_x - Syz * y2;
169 const fvec SA2_y = -Syz * x2;
170 const fvec SB2 = Syy * Byy + Syz * Byz;
171 const fvec SB2_x = Syy * Byy_x + Syz * x4;
172 const fvec SB2_y = Syy * xx31;
174 const fvec sA3 = syyy * Ayyy;
175 const fvec sA3_x = syyy * Ayyy_x;
176 const fvec sB3 = syyy * Byyy;
177 const fvec sB3_x = syyy * Byyy_x;
178 const fvec sB3_y = syyy * Byyy_y;
181 const fvec SA3 = Syyy * Ayyy;
182 const fvec SA3_x = Syyy * Ayyy_x;
183 const fvec SB3 = Syyy * Byyy;
184 const fvec SB3_x = Syyy * Byyy_x;
185 const fvec SB3_y = Syyy * Byyy_y;
187 const fvec ht1 = ht * dz;
188 const fvec ht2 = ht * ht * dz2;
189 const fvec ht3 = ht * ht * ht * dz3;
190 const fvec ht1sA1 = ht1 * sA1;
191 const fvec ht1sB1 = ht1 * sB1;
192 const fvec ht1SA1 = ht1 * SA1;
193 const fvec ht1SB1 = ht1 * SB1;
194 const fvec ht2sA2 = ht2 * sA2;
195 const fvec ht2SA2 = ht2 * SA2;
196 const fvec ht2sB2 = ht2 * sB2;
197 const fvec ht2SB2 = ht2 * SB2;
198 const fvec ht3sA3 = ht3 * sA3;
199 const fvec ht3sB3 = ht3 * sB3;
200 const fvec ht3SA3 = ht3 * SA3;
201 const fvec ht3SB3 = ht3 * SB3;
207 initialised =
fvec(zero < *w);
211 initialised =
fvec(zero < one);
214 T.
x += (((
x + ht1SA1 + ht2SA2 + ht3SA3) * dz) & initialised);
215 T.
y += (((
y + ht1SB1 + ht2SB2 + ht3SB3) * dz) & initialised);
216 T.
tx += ((ht1sA1 + ht2sA2 + ht3sA3) & initialised);
217 T.
ty += ((ht1sB1 + ht2sB2 + ht3sB3) & initialised);
218 T.
z += ((dz) &initialised);
223 const fvec dqp = qp - qp0;
225 const fvec xt2i =
x * t2i;
226 const fvec yt2i =
y * t2i;
227 const fvec tmp0 = ht1SA1 + c2 * ht2SA2 + c3 * ht3SA3;
228 const fvec tmp1 = ht1SB1 + c2 * ht2SB2 + c3 * ht3SB3;
229 const fvec tmp2 = ht1sA1 + c2 * ht2sA2 + c3 * ht3sA3;
230 const fvec tmp3 = ht1sB1 + c2 * ht2sB2 + c3 * ht3sB3;
233 dz * (c1 + xt2i * tmp0 + ht1 * SA1_x + ht2 * SA2_x + ht3 * SA3_x);
234 const fvec j12 = dz * (xt2i * tmp1 + ht1 * SB1_x + ht2 * SB2_x + ht3 * SB3_x);
235 const fvec j22 = c1 + xt2i * tmp2 + ht1 * sA1_x + ht2 * sA2_x + ht3 * sA3_x;
236 const fvec j32 = xt2i * tmp3 + ht1 * sB1_x + ht2 * sB2_x + ht3 * sB3_x;
238 const fvec j03 = dz * (yt2i * tmp0 + ht1 * SA1_y + ht2 * SA2_y);
240 dz * (c1 + yt2i * tmp1 + ht1 * SB1_y + ht2 * SB2_y + ht3 * SB3_y);
241 const fvec j23 = yt2i * tmp2 + ht1 * sA1_y + ht2 * sA2_y;
242 const fvec j33 = c1 + yt2i * tmp3 + ht1 * sB1_y + ht2 * sB2_y + ht3 * sB3_y;
244 const fvec j04 = ctdz2 * (SA1 + c2 * ht1 * SA2 + c3 * ht2 * SA3);
245 const fvec j14 = ctdz2 * (SB1 + c2 * ht1 * SB2 + c3 * ht2 * SB3);
246 const fvec j24 = ctdz * (sA1 + c2 * ht1 * sA2 + c3 * ht2 * sA3);
247 const fvec j34 = ctdz * (sB1 + c2 * ht1 * sB2 + c3 * ht2 * sB3);
252 T.
x += ((j04 * dqp) & initialised);
253 T.
y += ((j14 * dqp) & initialised);
254 T.
tx += ((j24 * dqp) & initialised);
255 T.
ty += ((j34 * dqp) & initialised);
263 const fvec cj20 = T.
C20 + T.
C22 * j02 + T.
C32 * j03 + c42 * j04;
264 const fvec cj30 = T.
C30 + T.
C32 * j02 + T.
C33 * j03 + c43 * j04;
268 const fvec cj21 = T.
C21 + T.
C22 * j12 + T.
C32 * j13 + c42 * j14;
269 const fvec cj31 = T.
C31 + T.
C32 * j12 + T.
C33 * j13 + c43 * j14;
273 const fvec cj22 = T.
C22 * j22 + T.
C32 * j23 + c42 * j24;
274 const fvec cj32 = T.
C32 * j22 + T.
C33 * j23 + c43 * j24;
278 const fvec cj23 = T.
C22 * j32 + T.
C32 * j33 + c42 * j34;
279 const fvec cj33 = T.
C32 * j32 + T.
C33 * j33 + c43 * j34;
281 T.
C40 += ((c42 * j02 + c43 * j03 + T.
C44 * j04) & initialised);
282 T.
C41 += ((c42 * j12 + c43 * j13 + T.
C44 * j14) & initialised);
283 T.
C42 = ((c42 * j22 + c43 * j23 + T.
C44 * j24) & initialised)
284 + (T.
C42 & (!initialised));
285 T.
C43 = ((c42 * j32 + c43 * j33 + T.
C44 * j34) & initialised)
286 + (T.
C43 & (!initialised));
288 T.
C00 = ((cj00 + j02 * cj20 + j03 * cj30 + j04 * T.
C40) & initialised)
289 + (T.
C00 & (!initialised));
290 T.
C10 = ((cj01 + j02 * cj21 + j03 * cj31 + j04 * T.
C41) & initialised)
291 + (T.
C10 & (!initialised));
292 T.
C11 = ((cj11 + j12 * cj21 + j13 * cj31 + j14 * T.
C41) & initialised)
293 + (T.
C11 & (!initialised));
295 T.
C20 = ((j22 * cj20 + j23 * cj30 + j24 * T.
C40) & initialised)
296 + (T.
C20 & (!initialised));
297 T.
C30 = ((j32 * cj20 + j33 * cj30 + j34 * T.
C40) & initialised)
298 + (T.
C30 & (!initialised));
299 T.
C21 = ((j22 * cj21 + j23 * cj31 + j24 * T.
C41) & initialised)
300 + (T.
C21 & (!initialised));
301 T.
C31 = ((j32 * cj21 + j33 * cj31 + j34 * T.
C41) & initialised)
302 + (T.
C31 & (!initialised));
303 T.
C22 = ((j22 * cj22 + j23 * cj32 + j24 * T.
C42) & initialised)
304 + (T.
C22 & (!initialised));
305 T.
C32 = ((j32 * cj22 + j33 * cj32 + j34 * T.
C42) & initialised)
306 + (T.
C32 & (!initialised));
307 T.
C33 = ((j32 * cj23 + j33 * cj33 + j34 * T.
C43) & initialised)
308 + (T.
C33 & (!initialised));
347 const fvec a[4] = {0.0f, 0.5f, 0.5f, 1.0f};
348 const fvec c[4] = {1.0f / 6.0f, 1.0f / 3.0f, 1.0f / 3.0f, 1.0f / 6.0f};
349 const fvec b[4] = {0.0f, 0.5f, 0.5f, 1.0f};
352 fvec k[16], x0[4],
x[4], k1[16];
353 fvec Ax[4], Ay[4], Ax_tx[4], Ay_tx[4], Ax_ty[4], Ay_ty[4];
358 const fvec z_in = T.z;
359 const fvec h = (z_out - T.z);
373 for (step = 0; step < 4; ++step) {
374 F.Get(z_in + a[step] *
h, B[step]);
377 for (step = 0; step < 4; ++step) {
378 for (
i = 0;
i < 4; ++
i) {
382 x[
i] = x0[
i] + b[step] * k[step * 4 - 4 +
i];
391 fvec tx2ty21 = 1.f + tx2 + ty2;
393 fvec I_tx2ty21 = 1.f / tx2ty21 * qp0;
397 fvec tx2ty2qp = tx2ty2 * qp0;
399 (txty * B[step][0] + ty * B[step][2] - (1.f + tx2) * B[step][1]) * tx2ty2;
400 Ay[step] = (-txty * B[step][1] - tx * B[step][2] + (1.f + ty2) * B[step][0])
403 Ax_tx[step] = Ax[step] * tx * I_tx2ty21
404 + (ty * B[step][0] - 2.f * tx * B[step][1]) * tx2ty2qp;
406 Ax[step] * ty * I_tx2ty21 + (tx * B[step][0] + B[step][2]) * tx2ty2qp;
408 Ay[step] * tx * I_tx2ty21 + (-ty * B[step][1] - B[step][2]) * tx2ty2qp;
409 Ay_ty[step] = Ay[step] * ty * I_tx2ty21
410 + (-tx * B[step][1] + 2.f * ty * B[step][0]) * tx2ty2qp;
414 k[step4 + 1] = ty *
h;
415 k[step4 + 2] = Ax[step] * qp0;
416 k[step4 + 3] = Ay[step] * qp0;
424 initialised =
fvec(zero < *w);
428 initialised =
fvec(zero < one);
432 T.x = ((x0[0] + c[0] * k[0] + c[1] * k[4 + 0] + c[2] * k[8 + 0]
435 + ((!initialised) & T.x);
436 T.y = ((x0[1] + c[0] * k[1] + c[1] * k[4 + 1] + c[2] * k[8 + 1]
439 + ((!initialised) & T.y);
440 T.tx = ((x0[2] + c[0] * k[2] + c[1] * k[4 + 2] + c[2] * k[8 + 2]
443 + ((!initialised) & T.tx);
444 T.ty = ((x0[3] + c[0] * k[3] + c[1] * k[4 + 3] + c[2] * k[8 + 3]
447 + ((!initialised) & T.ty);
448 T.z = (z_out & initialised) + ((!initialised) & T.z);
463 for (step = 0; step < 4; ++step) {
464 for (
i = 0;
i < 4; ++
i) {
468 x[
i] = x0[
i] + b[step] * k1[step * 4 - 4 +
i];
472 k1[step4] =
x[2] *
h;
473 k1[step4 + 1] =
x[3] *
h;
474 k1[step4 + 2] = Ax[step] + Ax_tx[step] *
x[2] + Ax_ty[step] *
x[3];
475 k1[step4 + 3] = Ay[step] + Ay_tx[step] *
x[2] + Ay_ty[step] *
x[3];
481 for (
i = 0;
i < 4; ++
i) {
482 J[20 +
i] = x0[
i] + c[0] * k1[
i] + c[1] * k1[4 +
i] + c[2] * k1[8 +
i]
502 for (step = 0; step < 4; ++step) {
503 for (
i = 0;
i < 4; ++
i) {
507 x[
i] = x0[
i] + b[step] * k1[step * 4 - 4 +
i];
511 k1[step4] =
x[2] *
h;
512 k1[step4 + 1] =
x[3] *
h;
514 k1[step4 + 3] = Ay_tx[step] *
x[2] + Ay_ty[step] *
x[3];
518 for (
i = 0;
i < 4; ++
i) {
520 J[10 +
i] = x0[
i] + c[0] * k1[
i] + c[1] * k1[4 +
i] + c[2] * k1[8 +
i]
540 for (step = 0; step < 4; ++step) {
541 for (
i = 0;
i < 4; ++
i) {
545 x[
i] = x0[
i] + b[step] * k1[step * 4 - 4 +
i];
549 k1[step4] =
x[2] *
h;
550 k1[step4 + 1] =
x[3] *
h;
551 k1[step4 + 2] = Ax_tx[step] *
x[2] + Ax_ty[step] *
x[3];
556 for (
i = 0;
i < 3; ++
i) {
557 J[15 +
i] = x0[
i] + c[0] * k1[
i] + c[1] * k1[4 +
i] + c[2] * k1[8 +
i]
567 for (
i = 0;
i < 10; ++
i) {
573 fvec dqp = qp_in - qp0;
576 T.x += ((J[5 * 4 + 0] * dqp) & initialised);
577 T.y += ((J[5 * 4 + 1] * dqp) & initialised);
578 T.tx += ((J[5 * 4 + 2] * dqp) & initialised);
579 T.ty += ((J[5 * 4 + 3] * dqp) & initialised);
600 const fvec c42 = T.C42, c43 = T.C43;
603 T.C00 + T.C20 * J[5 * 2 + 0] + T.C30 * J[5 * 3 + 0] + T.C40 * J[5 * 4 + 0];
606 T.C20 + T.C22 * J[5 * 2 + 0] + T.C32 * J[5 * 3 + 0] + c42 * J[5 * 4 + 0];
608 T.C30 + T.C32 * J[5 * 2 + 0] + T.C33 * J[5 * 3 + 0] + c43 * J[5 * 4 + 0];
611 T.C10 + T.C20 * J[5 * 2 + 1] + T.C30 * J[5 * 3 + 1] + T.C40 * J[5 * 4 + 1];
613 T.C11 + T.C21 * J[5 * 2 + 1] + T.C31 * J[5 * 3 + 1] + T.C41 * J[5 * 4 + 1];
615 T.C21 + T.C22 * J[5 * 2 + 1] + T.C32 * J[5 * 3 + 1] + c42 * J[5 * 4 + 1];
617 T.C31 + T.C32 * J[5 * 2 + 1] + T.C33 * J[5 * 3 + 1] + c43 * J[5 * 4 + 1];
622 T.C22 * J[5 * 2 + 2] + T.C32 * J[5 * 3 + 2] + c42 * J[5 * 4 + 2];
624 T.C32 * J[5 * 2 + 2] + T.C33 * J[5 * 3 + 2] + c43 * J[5 * 4 + 2];
629 T.C22 * J[5 * 2 + 3] + T.C32 * J[5 * 3 + 3] + c42 * J[5 * 4 + 3];
631 T.C32 * J[5 * 2 + 3] + T.C33 * J[5 * 3 + 3] + c43 * J[5 * 4 + 3];
633 T.C40 += ((c42 * J[5 * 2 + 0] + c43 * J[5 * 3 + 0] + T.C44 * J[5 * 4 + 0])
635 T.C41 += ((c42 * J[5 * 2 + 1] + c43 * J[5 * 3 + 1] + T.C44 * J[5 * 4 + 1])
637 T.C42 = ((c42 * J[5 * 2 + 2] + c43 * J[5 * 3 + 2] + T.C44 * J[5 * 4 + 2])
639 + ((!initialised) & T.C42);
640 T.C43 = ((c42 * J[5 * 2 + 3] + c43 * J[5 * 3 + 3] + T.C44 * J[5 * 4 + 3])
642 + ((!initialised) & T.C43);
645 ((cj00 + J[5 * 2 + 0] * cj20 + J[5 * 3 + 0] * cj30 + J[5 * 4 + 0] * T.C40)
647 + ((!initialised) & T.C00);
649 ((cj01 + J[5 * 2 + 0] * cj21 + J[5 * 3 + 0] * cj31 + J[5 * 4 + 0] * T.C41)
651 + ((!initialised) & T.C10);
653 ((cj11 + J[5 * 2 + 1] * cj21 + J[5 * 3 + 1] * cj31 + J[5 * 4 + 1] * T.C41)
655 + ((!initialised) & T.C11);
657 T.C20 = ((J[5 * 2 + 2] * cj20 + J[5 * 3 + 2] * cj30 + J[5 * 4 + 2] * T.C40)
659 + ((!initialised) & T.C20);
660 T.C30 = ((J[5 * 2 + 3] * cj20 + J[5 * 3 + 3] * cj30 + J[5 * 4 + 3] * T.C40)
662 + ((!initialised) & T.C30);
663 T.C21 = ((J[5 * 2 + 2] * cj21 + J[5 * 3 + 2] * cj31 + J[5 * 4 + 2] * T.C41)
665 + ((!initialised) & T.C21);
666 T.C31 = ((J[5 * 2 + 3] * cj21 + J[5 * 3 + 3] * cj31 + J[5 * 4 + 3] * T.C41)
668 + ((!initialised) & T.C31);
669 T.C22 = ((J[5 * 2 + 2] * cj22 + J[5 * 3 + 2] * cj32 + J[5 * 4 + 2] * T.C42)
671 + ((!initialised) & T.C22);
672 T.C32 = ((J[5 * 2 + 3] * cj22 + J[5 * 3 + 3] * cj32 + J[5 * 4 + 3] * T.C42)
674 + ((!initialised) & T.C32);
675 T.C33 = ((J[5 * 2 + 3] * cj23 + J[5 * 3 + 3] * cj33 + J[5 * 4 + 3] * T.C43)
677 + ((!initialised) & T.C33);
679 #endif //ANALYTICEXTRAPOLATION
691 cnst c1 = 1., c2i = 1. / 2., c3i = 1. / 3., c6i = 1. / 6., c12i = 1. / 12.;
696 const fvec dz = (z_out - T.
z);
697 const fvec dz2 = dz * dz;
707 const fvec Ay = -xx - c1;
708 const fvec Bx = yy + c1;
711 const fvec dzc2i = dz * c2i;
712 const fvec dz2c3i = dz2 * c3i;
713 const fvec dzc6i = dz * c6i;
714 const fvec dz2c12i = dz2 * c12i;
720 const fvec Sx = (F.
cx0 * c2i + F.
cx1 * dzc6i + F.
cx2 * dz2c12i);
721 const fvec Sy = (F.
cy0 * c2i + F.
cy1 * dzc6i + F.
cy2 * dz2c12i);
722 const fvec Sz = (F.
cz0 * c2i + F.
cz1 * dzc6i + F.
cz2 * dz2c12i);
725 const fvec ctdz = ct * dz;
726 const fvec ctdz2 = ct * dz2;
728 const fvec j04 = ctdz2 * (Sx * xy + Sy * Ay + Sz *
y);
729 const fvec j14 = ctdz2 * (Sx * Bx - Sy * xy - Sz *
x);
730 const fvec j24 = ctdz * (sx * xy + sy * Ay + sz *
y);
731 const fvec j34 = ctdz * (sx * Bx - sy * xy - sz *
x);
733 T.
x +=
x * dz + j04 * qp;
734 T.
y +=
y * dz + j14 * qp;
767 T.
C00 = cj00 + dz * cj20 + j04 * T.
C40;
768 T.
C10 = cj01 + dz * cj21 + j04 * T.
C41;
769 T.
C11 = cj11 + dz * cj31 + j14 * T.
C41;
771 T.
C20 = cj20 + j24 * T.
C40;
772 T.
C30 = cj30 + j34 * T.
C40;
773 T.
C21 = cj21 + j24 * T.
C41;
774 T.
C31 = cj31 + j34 * T.
C41;
775 T.
C22 = cj22 + j24 * T.
C42;
776 T.
C32 = cj32 + j34 * T.
C42;
777 T.
C33 = cj33 + j34 * T.
C43;
808 T.
C55 += k1 * (T.
C52 + c52) + k2 * (T.
C53 + c53);
815 fvec dz = (z_out - T.
z);
821 const fvec dzC32_in = dz * T.
C32;
829 T.
C00 += dz * (T.
C20 + C20_in);
834 T.
C11 += dz * (T.
C31 + C31_in);
843 const fvec dz = (z_out - T.
z);
845 C00 = T.
C00 + dz * (2 * T.
C20 + dz * T.
C22);
850 const fvec dz = (z_out - T.
z);
852 C11 = T.
C11 + dz * (2 * T.
C31 + dz * T.
C33);
856 const fvec dz = (z_out - T.
z);
876 cnst c1 = 1., c2 = 2., c3 = 3., c4 = 4., c6 = 6., c9 = 9., c15 = 15.,
877 c18 = 18., c45 = 45., c2i = 1. / 2., c6i = 1. / 6., c12i = 1. / 12.;
892 fvec xx31 = xx * c3 + c1;
893 fvec xx159 = xx * c15 + c9;
896 fvec Ayy =
x * (xx * c3 + c3);
898 fvec Ayyy = -(c15 * xx * xx + c18 * xx + c3);
900 fvec Ayy_x = c3 * xx31;
901 fvec Ayyy_x = -x4 * xx159;
905 fvec Byz = c2 * xx + c1;
906 fvec Byyy = -xy * xx159;
908 fvec Byy_x = c6 * xy;
909 fvec Byyy_x = -
y * (c45 * xx + c9);
910 fvec Byyy_y = -
x * xx159;
914 fvec t2 = c1 + xx + yy;
921 fvec Fx1 = F.cx1 * dz;
922 fvec Fx2 = F.cx2 * dz2;
924 fvec Fy1 = F.cy1 * dz;
925 fvec Fy2 = F.cy2 * dz2;
927 fvec Fz1 = F.cz1 * dz;
928 fvec Fz2 = F.cz2 * dz2;
932 fvec Sx = (Fx0 * c2i + Fx1 * c6i + Fx2 * c12i);
933 fvec Sy = (Fy0 * c2i + Fy1 * c6i + Fy2 * c12i);
934 fvec Sz = (Fz0 * c2i + Fz1 * c6i + Fz2 * c12i);
938 cnst d = 1. / 2520., c00 = 21. * 20. *
d, c01 = 21. * 5. *
d,
939 c02 = 21. * 2. *
d, c10 = 7. * 30. *
d, c11 = 7. * 9. *
d,
940 c12 = 7. * 4. *
d, c20 = 2. * 63. *
d, c21 = 2. * 21. *
d,
942 Syz = Fy0 * (c00 * Fz0 + c01 * Fz1 + c02 * Fz2)
943 + Fy1 * (c10 * Fz0 + c11 * Fz1 + c12 * Fz2)
944 + Fy2 * (c20 * Fz0 + c21 * Fz1 + c22 * Fz2);
949 cnst d = 1. / 2520., c00 = 420. *
d, c01 = 21. * 15. *
d,
950 c02 = 21. * 8. *
d, c03 = 63. *
d, c04 = 70. *
d, c05 = 20. *
d;
951 Syy = Fy0 * (c00 * Fy0 + c01 * Fy1 + c02 * Fy2)
952 + Fy1 * (c03 * Fy1 + c04 * Fy2) + c05 * Fy2 * Fy2;
957 cnst d = 1. / 181440., c000 = 7560 *
d, c001 = 9 * 1008 *
d,
958 c002 = 5 * 1008 *
d, c011 = 21 * 180 *
d, c012 = 24 * 180 *
d,
959 c022 = 7 * 180 *
d, c111 = 540 *
d, c112 = 945 *
d, c122 = 560 *
d,
961 fvec Fy22 = Fy2 * Fy2;
963 * (Fy0 * (c000 * Fy0 + c001 * Fy1 + c002 * Fy2)
964 + Fy1 * (c011 * Fy1 + c012 * Fy2) + c022 * Fy22)
965 + Fy1 * (Fy1 * (c111 * Fy1 + c112 * Fy2) + c122 * Fy22)
969 fvec SA1 = Sx * xy + Sy * Ay + Sz *
y;
970 fvec SA1_x = Sx *
y - Sy * x2;
971 fvec SA1_y = Sx *
x + Sz;
973 fvec SB1 = Sx * Bx - Sy * xy - Sz *
x;
974 fvec SB1_x = -Sy *
y - Sz;
975 fvec SB1_y = Sx * y2 - Sy *
x;
977 fvec SA2 = Syy * Ayy + Syz * Ayz;
978 fvec SA2_x = Syy * Ayy_x - Syz * y2;
979 fvec SA2_y = -Syz * x2;
980 fvec SB2 = Syy * Byy + Syz * Byz;
981 fvec SB2_x = Syy * Byy_x + Syz * x4;
982 fvec SB2_y = Syy * xx31;
984 fvec SA3 = Syyy * Ayyy;
985 fvec SA3_x = Syyy * Ayyy_x;
986 fvec SB3 = Syyy * Byyy;
987 fvec SB3_x = Syyy * Byyy_x;
988 fvec SB3_y = Syyy * Byyy_y;
991 fvec ht2 = ht * ht * dz2;
992 fvec ht3 = ht * ht * ht * dz3;
993 fvec ht1SA1 = ht1 * SA1;
994 fvec ht1SB1 = ht1 * SB1;
995 fvec ht2SA2 = ht2 * SA2;
996 fvec ht2SB2 = ht2 * SB2;
997 fvec ht3SA3 = ht3 * SA3;
998 fvec ht3SB3 = ht3 * SB3;
1000 extrDx = (
x + ht1SA1 + ht2SA2 + ht3SA3) * dz;
1001 extrDy = (
y + ht1SB1 + ht2SB2 + ht3SB3) * dz;
1006 fvec xt2i =
x * t2i;
1007 fvec yt2i =
y * t2i;
1008 fvec tmp0 = ht1SA1 + c2 * ht2SA2 + c3 * ht3SA3;
1009 fvec tmp1 = ht1SB1 + c2 * ht2SB2 + c3 * ht3SB3;
1012 dz * (c1 + xt2i * tmp0 + ht1 * SA1_x + ht2 * SA2_x + ht3 * SA3_x);
1013 extrJ[1] = dz * (yt2i * tmp0 + ht1 * SA1_y + ht2 * SA2_y);
1014 extrJ[2] = ctdz2 * (SA1 + c2 * ht1 * SA2 + c3 * ht2 * SA3);
1016 dz * (xt2i * tmp1 + ht1 * SB1_x + ht2 * SB2_x + ht3 * SB3_x);
1018 dz * (c1 + yt2i * tmp1 + ht1 * SB1_y + ht2 * SB2_y + ht3 * SB3_y);
1019 extrJ[5] = ctdz2 * (SB1 + c2 * ht1 * SB2 + c3 * ht2 * SB3);
1030 cnst c_light = 0.000299792458, c1 = 1., c2i = 0.5, c6i = 1. / 6.,
1034 fvec dzc6i = dz * c6i;
1035 fvec dz2c12i = dz2 * c12i;
1052 J04 = ctdz2 * (Sx * xy + Sy * Ay + Sz * ty);
1053 J14 = ctdz2 * (Sx * Bx - Sy * xy - Sz * tx);