130 return (1.0 / 6.0) * (d - a) * cross_product_3d(b - a, c - a);
143 const auto v01 = x1 - x0;
144 const auto v02 = x2 - x0;
145 const auto v03 = x3 - x0;
146 const auto v04 = x4 - x0;
147 const auto v21 = x2 - x1;
151 return -v04 * cross_product_3d(v21, v03) / 6.0 +
152 v03 * cross_product_3d(v01, v02) / 12.0;
228 const double x6 = (1.0 / 12.0) * z1;
229 const double x7 = -x6;
230 const double x8 = (1.0 / 12.0) * z3;
231 const double x9 = x7 + x8;
232 const double x10 = (1.0 / 12.0) * z2;
233 const double x11 = -x8;
234 const double x12 = x10 + x11;
235 const double x13 = (1.0 / 6.0) * z2;
236 const double x14 = (1.0 / 12.0) * z4;
237 const double x15 = (1.0 / 6.0) * z1;
238 const double x16 = (1.0 / 12.0) * z5;
239 const double x17 = -x16;
240 const double x18 = x16 + x7;
241 const double x19 = -x14;
242 const double x20 = x10 + x19;
243 const double x21 = (1.0 / 12.0) * z0;
244 const double x22 = x19 + x21;
245 const double x23 = -x10;
246 const double x24 = x14 + x23;
247 const double x25 = (1.0 / 6.0) * z0;
248 const double x26 = x17 + x21;
249 const double x27 = x23 + x8;
250 const double x28 = -x21;
251 const double x29 = x16 + x28;
252 const double x30 = x17 + x6;
253 const double x31 = x14 + x28;
254 const double x32 = x11 + x6;
255 const double x33 = (1.0 / 6.0) * z5;
256 const double x34 = (1.0 / 6.0) * z4;
257 const double x35 = (1.0 / 6.0) * z3;
258 const double result =
259 x0 * (x12 * y5 + x9 * y4 + y1 * (-x13 + x14 + x8) +
260 y2 * (x11 + x15 + x17) + y3 * (x18 + x20)) +
261 x1 * (x22 * y3 + x24 * y5 + y0 * (x11 + x13 + x19) +
262 y2 * (x14 + x16 - x25) + y4 * (x26 + x27)) +
263 x2 * (x29 * y3 + x30 * y4 + y0 * (-x15 + x16 + x8) +
264 y1 * (x17 + x19 + x25) + y5 * (x31 + x32)) +
265 x3 * (x26 * y2 + x31 * y1 + y0 * (x24 + x30) + y4 * (x28 + x33 + x7) +
266 y5 * (x10 + x21 - x34)) +
267 x4 * (x18 * y2 + x32 * y0 + y1 * (x12 + x29) + y3 * (x21 - x33 + x6) +
268 y5 * (x23 + x35 + x7)) +
269 x5 * (x20 * y1 + x27 * y0 + y2 * (x22 + x9) + y3 * (x23 + x28 + x34) +
270 y4 * (x10 - x35 + x6));
338 const double t3 = y[3] * x[2];
339 const double t5 = z[1] * x[5];
340 const double t9 = z[3] * x[2];
341 const double t11 = x[1] * y[0];
342 const double t14 = x[4] * y[0];
343 const double t18 = x[5] * y[7];
344 const double t20 = y[1] * x[3];
345 const double t22 = y[5] * x[4];
346 const double t26 = z[7] * x[6];
347 const double t28 = x[0] * y[4];
349 z[3] * x[1] * y[2] + t3 * z[1] - t5 * y[7] + y[7] * x[4] * z[6] +
350 t9 * y[6] - t11 * z[4] - t5 * y[3] - t14 * z[2] + z[1] * x[4] * y[0] -
351 t18 * z[3] + t20 * z[0] - t22 * z[0] - y[0] * x[5] * z[4] - t26 * y[3] +
352 t28 * z[2] - t9 * y[1] - y[1] * x[4] * z[0] - t11 * z[5];
353 const double t37 = y[1] * x[0];
354 const double t44 = x[1] * y[5];
355 const double t46 = z[1] * x[0];
356 const double t49 = x[0] * y[2];
357 const double t52 = y[5] * x[7];
358 const double t54 = x[3] * y[7];
359 const double t56 = x[2] * z[0];
360 const double t58 = x[3] * y[2];
361 const double t64 = -x[6] * y[4] * z[2] - t37 * z[2] + t18 * z[6] -
362 x[3] * y[6] * z[2] + t11 * z[2] + t5 * y[0] +
363 t44 * z[4] - t46 * y[4] - t20 * z[7] - t49 * z[6] -
364 t22 * z[1] + t52 * z[3] - t54 * z[2] - t56 * y[4] -
365 t58 * z[0] + y[1] * x[2] * z[0] + t9 * y[7] + t37 * z[4];
366 const double t66 = x[1] * y[7];
367 const double t68 = y[0] * x[6];
368 const double t70 = x[7] * y[6];
369 const double t73 = z[5] * x[4];
370 const double t76 = x[6] * y[7];
371 const double t90 = x[4] * z[0];
372 const double t92 = x[1] * y[3];
373 const double t95 = -t66 * z[3] - t68 * z[2] - t70 * z[2] + t26 * y[5] -
374 t73 * y[6] - t14 * z[6] + t76 * z[2] - t3 * z[6] +
375 x[6] * y[2] * z[4] - z[3] * x[6] * y[2] + t26 * y[4] -
376 t44 * z[3] - x[1] * y[2] * z[0] + x[5] * y[6] * z[4] +
377 t54 * z[5] + t90 * y[2] - t92 * z[2] + t46 * y[2];
378 const double t102 = x[2] * y[0];
379 const double t107 = y[3] * x[7];
380 const double t114 = x[0] * y[6];
382 y[0] * x[3] * z[2] - z[7] * x[5] * y[6] - x[2] * y[6] * z[4] +
383 t102 * z[6] - t52 * z[6] + x[2] * y[4] * z[6] - t107 * z[5] - t54 * z[6] +
384 t58 * z[6] - x[7] * y[4] * z[6] + t37 * z[5] - t114 * z[4] + t102 * z[4] -
385 z[1] * x[2] * y[0] + t28 * z[6] - y[5] * x[6] * z[4] -
386 z[5] * x[1] * y[4] - t73 * y[7];
387 const double t129 = z[0] * x[6];
388 const double t133 = y[1] * x[7];
389 const double t145 = y[1] * x[5];
390 const double t156 = t90 * y[6] - t129 * y[4] + z[7] * x[2] * y[6] -
391 t133 * z[5] + x[5] * y[3] * z[7] - t26 * y[2] -
392 t70 * z[3] + t46 * y[3] + z[5] * x[7] * y[4] +
393 z[7] * x[3] * y[6] - t49 * z[4] + t145 * z[7] -
394 x[2] * y[7] * z[6] + t70 * z[5] + t66 * z[5] -
395 z[7] * x[4] * y[6] + t18 * z[4] + x[1] * y[4] * z[0];
396 const double t160 = x[5] * y[4];
397 const double t165 = z[1] * x[7];
398 const double t178 = z[1] * x[3];
400 t107 * z[6] + t22 * z[7] + t76 * z[3] + t160 * z[1] - x[4] * y[2] * z[6] +
401 t70 * z[4] + t165 * y[5] + x[7] * y[2] * z[6] - t76 * z[5] - t76 * z[4] +
402 t133 * z[3] - t58 * z[1] + y[5] * x[0] * z[4] + t114 * z[2] - t3 * z[7] +
403 t20 * z[2] + t178 * y[7] + t129 * y[2];
404 const double t207 = t92 * z[7] + t22 * z[6] + z[3] * x[0] * y[2] -
405 x[0] * y[3] * z[2] - z[3] * x[7] * y[2] - t165 * y[3] -
406 t9 * y[0] + t58 * z[7] + y[3] * x[6] * z[2] +
407 t107 * z[2] + t73 * y[0] - x[3] * y[5] * z[7] +
408 t3 * z[0] - t56 * y[6] - z[5] * x[0] * y[4] +
409 t73 * y[1] - t160 * z[6] + t160 * z[0];
410 const double t228 = -t44 * z[7] + z[5] * x[6] * y[4] - t52 * z[4] -
411 t145 * z[4] + t68 * z[4] + t92 * z[5] - t92 * z[0] +
412 t11 * z[3] + t44 * z[0] + t178 * y[5] - t46 * y[5] -
413 t178 * y[0] - t145 * z[0] - t20 * z[5] - t37 * z[3] -
414 t160 * z[7] + t145 * z[3] + x[4] * y[6] * z[2];
416 return (t34 + t64 + t95 + t125 + t156 + t181 + t207 + t228) / 12.;