\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}\;b \le -2.91646132921825652 \cdot 10^{-174}:\\
\;\;\;\;\left(\left(\left(x \cdot \left(\sqrt[3]{\mathsf{fma}\left(y \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right), \sqrt[3]{z}, -a \cdot t\right)} \cdot \sqrt[3]{\mathsf{fma}\left(y \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right), \sqrt[3]{z}, -a \cdot t\right)}\right)\right) \cdot \sqrt[3]{\mathsf{fma}\left(y \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right), \sqrt[3]{z}, -a \cdot t\right)} + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;b \le -8.34209232855240492 \cdot 10^{-247}:\\
\;\;\;\;\left(\left(x \cdot \mathsf{fma}\left(y \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right), \sqrt[3]{z}, -a \cdot t\right) + x \cdot \mathsf{fma}\left(-a, t, a \cdot t\right)\right) - 0\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;b \le 0.022366585488525683:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left({\left(\left(b \cdot z\right) \cdot {\left(\sqrt[3]{c}\right)}^{3} - t \cdot \left(i \cdot b\right)\right)}^{1} + b \cdot \mathsf{fma}\left(-i, t, i \cdot t\right)\right)\right) + \left(j \cdot \mathsf{fma}\left(c \cdot \left(\sqrt[3]{a} \cdot \sqrt[3]{a}\right), \sqrt[3]{a}, -i \cdot y\right) + j \cdot \mathsf{fma}\left(-i, y, i \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot \left(z \cdot y\right) - a \cdot \left(x \cdot t\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\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 ((b <= -2.9164613292182565e-174)) {
temp = (((((x * (cbrt(fma((y * (cbrt(z) * cbrt(z))), cbrt(z), -(a * t))) * cbrt(fma((y * (cbrt(z) * cbrt(z))), cbrt(z), -(a * t))))) * cbrt(fma((y * (cbrt(z) * cbrt(z))), cbrt(z), -(a * t)))) + (x * fma(-a, t, (a * t)))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))));
} else {
double temp_1;
if ((b <= -8.342092328552405e-247)) {
temp_1 = ((((x * fma((y * (cbrt(z) * cbrt(z))), cbrt(z), -(a * t))) + (x * fma(-a, t, (a * t)))) - 0.0) + (j * ((c * a) - (y * i))));
} else {
double temp_2;
if ((b <= 0.022366585488525683)) {
temp_2 = (((x * ((y * z) - (t * a))) - (pow((((b * z) * pow(cbrt(c), 3.0)) - (t * (i * b))), 1.0) + (b * fma(-i, t, (i * t))))) + ((j * fma((c * (cbrt(a) * cbrt(a))), cbrt(a), -(i * y))) + (j * fma(-i, y, (i * y)))));
} else {
temp_2 = ((((x * (z * y)) - (a * (x * t))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))));
}
temp_1 = temp_2;
}
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 | 12.0 |
|---|---|
| Target | 20.3 |
| Herbie | 11.3 |
if b < -2.9164613292182565e-174Initial program 10.4
rmApplied add-cube-cbrt10.6
Applied associate-*r*10.6
Applied prod-diff10.6
Applied distribute-lft-in10.6
rmApplied add-cube-cbrt10.7
Applied associate-*r*10.7
if -2.9164613292182565e-174 < b < -8.342092328552405e-247Initial program 16.9
rmApplied add-cube-cbrt17.0
Applied associate-*r*17.1
Applied prod-diff17.1
Applied distribute-lft-in17.0
Taylor expanded around 0 18.8
if -8.342092328552405e-247 < b < 0.022366585488525683Initial program 15.3
rmApplied add-cube-cbrt15.3
Applied associate-*l*15.3
Applied prod-diff15.3
Applied distribute-lft-in15.3
rmApplied add-cube-cbrt15.5
Applied associate-*r*15.5
Applied prod-diff15.5
Applied distribute-lft-in15.5
rmApplied pow115.5
Applied pow115.5
Applied pow-prod-down15.5
Simplified12.5
if 0.022366585488525683 < b Initial program 6.6
Taylor expanded around inf 7.2
Final simplification11.3
herbie shell --seed 2020066 +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)))))