\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\begin{array}{l}
\mathbf{if}\;x \le -8.24968911064900517 \cdot 10^{-210}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \left(\sqrt[3]{x} \cdot \left(y \cdot z - t \cdot a\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right)\\
\mathbf{elif}\;x \le 3.9714055078718788 \cdot 10^{-161}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot a - y \cdot i, j, 0 - \left(b \cdot \left(c \cdot z - t \cdot i\right) + b \cdot \mathsf{fma}\left(-i, t, i \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(x \cdot \left(\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a} - b \cdot \left(c \cdot z - t \cdot i\right)\right)\\
\end{array}double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) - ((double) (b * ((double) (((double) (c * z)) - ((double) (t * i)))))))) + ((double) (j * ((double) (((double) (c * a)) - ((double) (y * i))))))));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double VAR;
if ((x <= -8.249689110649005e-210)) {
VAR = ((double) fma(((double) (((double) (c * a)) - ((double) (y * i)))), j, ((double) (((double) (((double) (((double) cbrt(x)) * ((double) cbrt(x)))) * ((double) (((double) cbrt(x)) * ((double) (((double) (y * z)) - ((double) (t * a)))))))) - ((double) (b * ((double) (((double) (c * z)) - ((double) (t * i))))))))));
} else {
double VAR_1;
if ((x <= 3.971405507871879e-161)) {
VAR_1 = ((double) fma(((double) (((double) (c * a)) - ((double) (y * i)))), j, ((double) (0.0 - ((double) (((double) (b * ((double) (((double) (c * z)) - ((double) (t * i)))))) + ((double) (b * ((double) fma(((double) -(i)), t, ((double) (i * t))))))))))));
} else {
VAR_1 = ((double) fma(((double) (((double) (c * a)) - ((double) (y * i)))), j, ((double) (((double) (((double) (x * ((double) (((double) cbrt(((double) (((double) (y * z)) - ((double) (t * a)))))) * ((double) cbrt(((double) (((double) (y * z)) - ((double) (t * a)))))))))) * ((double) cbrt(((double) (((double) (y * z)) - ((double) (t * a)))))))) - ((double) (b * ((double) (((double) (c * z)) - ((double) (t * i))))))))));
}
VAR = VAR_1;
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a




Bits error versus b




Bits error versus c




Bits error versus i




Bits error versus j
Results
| Original | 12.7 |
|---|---|
| Target | 20.3 |
| Herbie | 12.8 |
if x < -8.249689110649005e-210Initial program 10.6
Simplified10.6
rmApplied add-cube-cbrt10.9
Applied associate-*l*10.9
if -8.249689110649005e-210 < x < 3.971405507871879e-161Initial program 18.5
Simplified18.5
rmApplied prod-diff18.5
Applied distribute-lft-in18.5
Simplified18.5
Taylor expanded around 0 17.8
if 3.971405507871879e-161 < x Initial program 10.8
Simplified10.8
rmApplied add-cube-cbrt11.2
Applied associate-*r*11.2
Final simplification12.8
herbie shell --seed 2020120 +o rules:numerics
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
:herbie-target
(if (< x -1.469694296777705e-64) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 3.2113527362226803e-147) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))