\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}\;j \le -1.38624531694325238 \cdot 10^{-235}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot a - y \cdot i, j, \left(x \cdot \left(\left(\sqrt[3]{\sqrt[3]{y \cdot z - t \cdot a} \cdot \sqrt[3]{y \cdot z - t \cdot a}} \cdot \sqrt[3]{\sqrt[3]{y \cdot z - t \cdot a}}\right) \cdot \sqrt[3]{y \cdot z - t \cdot a}\right)\right) \cdot \sqrt[3]{y \cdot z - t \cdot a} - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\right)\right)\\
\mathbf{elif}\;j \le -7.6804468221105565 \cdot 10^{-296}:\\
\;\;\;\;\mathsf{fma}\left(t, i \cdot b, -\mathsf{fma}\left(z, b \cdot c, t \cdot \left(x \cdot a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(\sqrt[3]{c \cdot a - y \cdot i} \cdot \left(\sqrt[3]{\sqrt[3]{c \cdot a - y \cdot i} \cdot \sqrt[3]{c \cdot a - y \cdot i}} \cdot \sqrt[3]{\sqrt[3]{c \cdot a - y \cdot i}}\right)\right) \cdot \sqrt[3]{c \cdot a - y \cdot i}, j, x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \mathsf{fma}\left(c \cdot 1, z, -i \cdot t\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 ((j <= -1.3862453169432524e-235)) {
VAR = ((double) fma(((double) (((double) (c * a)) - ((double) (y * i)))), j, ((double) (((double) (((double) (x * ((double) (((double) (((double) cbrt(((double) (((double) cbrt(((double) (((double) (y * z)) - ((double) (t * a)))))) * ((double) cbrt(((double) (((double) (y * z)) - ((double) (t * a)))))))))) * ((double) cbrt(((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) fma(((double) (c * 1.0)), z, ((double) -(((double) (i * t))))))))))));
} else {
double VAR_1;
if ((j <= -7.680446822110556e-296)) {
VAR_1 = ((double) fma(t, ((double) (i * b)), ((double) -(((double) fma(z, ((double) (b * c)), ((double) (t * ((double) (x * a))))))))));
} else {
VAR_1 = ((double) fma(((double) (((double) (((double) cbrt(((double) (((double) (c * a)) - ((double) (y * i)))))) * ((double) (((double) cbrt(((double) (((double) cbrt(((double) (((double) (c * a)) - ((double) (y * i)))))) * ((double) cbrt(((double) (((double) (c * a)) - ((double) (y * i)))))))))) * ((double) cbrt(((double) cbrt(((double) (((double) (c * a)) - ((double) (y * i)))))))))))) * ((double) cbrt(((double) (((double) (c * a)) - ((double) (y * i)))))))), j, ((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) - ((double) (b * ((double) fma(((double) (c * 1.0)), z, ((double) -(((double) (i * t))))))))))));
}
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.0 |
|---|---|
| Target | 20.2 |
| Herbie | 12.8 |
if j < -1.3862453169432524e-235Initial program 11.1
Simplified11.1
rmApplied *-un-lft-identity11.1
Applied associate-*r*11.1
Applied fma-neg11.1
Simplified11.1
rmApplied add-cube-cbrt11.4
Applied associate-*r*11.4
rmApplied add-cube-cbrt11.4
Applied cbrt-prod11.4
if -1.3862453169432524e-235 < j < -7.680446822110556e-296Initial program 17.7
Simplified17.7
Taylor expanded around inf 25.9
Simplified25.9
if -7.680446822110556e-296 < j Initial program 12.0
Simplified12.0
rmApplied *-un-lft-identity12.0
Applied associate-*r*12.0
Applied fma-neg12.0
Simplified12.0
rmApplied add-cube-cbrt12.3
rmApplied add-cube-cbrt12.3
Applied cbrt-prod12.3
Final simplification12.8
herbie shell --seed 2020113 +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)))))