\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 -2.57167076228841309 \cdot 10^{-222}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(\sqrt[3]{c \cdot z - t \cdot i} \cdot \sqrt[3]{c \cdot z - t \cdot i}\right)\right) \cdot \sqrt[3]{c \cdot z - t \cdot i}\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;j \le 1.3678801228584537 \cdot 10^{-271}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(\sqrt[3]{b \cdot \left(c \cdot z - t \cdot i\right)} \cdot \sqrt[3]{b \cdot \left(c \cdot z - t \cdot i\right)}\right) \cdot \sqrt[3]{b \cdot \left(c \cdot z - t \cdot i\right)}\right) + 0\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(\sqrt[3]{j} \cdot \sqrt[3]{j}\right) \cdot \left(\sqrt[3]{j} \cdot \left(c \cdot a - y \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 (((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))));
}
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double temp;
if ((j <= -2.571670762288413e-222)) {
temp = (((x * ((y * z) - (t * a))) - ((b * (cbrt(((c * z) - (t * i))) * cbrt(((c * z) - (t * i))))) * cbrt(((c * z) - (t * i))))) + (j * ((c * a) - (y * i))));
} else {
double temp_1;
if ((j <= 1.3678801228584537e-271)) {
temp_1 = (((x * ((y * z) - (t * a))) - ((cbrt((b * ((c * z) - (t * i)))) * cbrt((b * ((c * z) - (t * i))))) * cbrt((b * ((c * z) - (t * i)))))) + 0.0);
} else {
temp_1 = (((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + ((cbrt(j) * cbrt(j)) * (cbrt(j) * ((c * a) - (y * i)))));
}
temp = temp_1;
}
return temp;
}




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 | 11.8 |
|---|---|
| Target | 19.6 |
| Herbie | 11.8 |
if j < -2.571670762288413e-222Initial program 10.8
rmApplied add-cube-cbrt11.0
Applied associate-*r*11.0
if -2.571670762288413e-222 < j < 1.3678801228584537e-271Initial program 17.6
rmApplied add-cube-cbrt18.0
Taylor expanded around 0 15.1
if 1.3678801228584537e-271 < j Initial program 11.2
rmApplied add-cube-cbrt11.5
Applied associate-*l*11.5
Final simplification11.8
herbie shell --seed 2020058
(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)))))