\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 -2.0888365422142503 \cdot 10^{-114}:\\
\;\;\;\;\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) + \left(a \cdot \left(j \cdot c\right) + {\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\right)}^{1}\right)\\
\mathbf{elif}\;x \le 2.6424334011412275 \cdot 10^{-227}:\\
\;\;\;\;\left(0 - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\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(\left(a \cdot j\right) \cdot c + \left(-j\right) \cdot \left(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 ((x <= -2.0888365422142503e-114)) {
temp = (((x * ((y * z) - (t * a))) - ((cbrt((b * ((c * z) - (t * i)))) * cbrt((b * ((c * z) - (t * i))))) * cbrt((b * ((c * z) - (t * i)))))) + ((a * (j * c)) + pow((-1.0 * (i * (j * y))), 1.0)));
} else {
double temp_1;
if ((x <= 2.6424334011412275e-227)) {
temp_1 = ((0.0 - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))));
} else {
temp_1 = (((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (((a * j) * c) + (-j * (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 | 12.3 |
|---|---|
| Target | 19.9 |
| Herbie | 12.5 |
if x < -2.0888365422142503e-114Initial program 9.1
rmApplied add-cube-cbrt9.3
Applied associate-*l*9.3
rmApplied sub-neg9.3
Applied distribute-lft-in9.3
Applied distribute-lft-in9.4
Simplified9.8
Simplified9.7
rmApplied pow19.7
Applied pow19.7
Applied pow-prod-down9.7
Applied pow19.7
Applied pow-prod-down9.7
Simplified9.3
rmApplied add-cube-cbrt9.6
if -2.0888365422142503e-114 < x < 2.6424334011412275e-227Initial program 16.3
Taylor expanded around 0 17.0
if 2.6424334011412275e-227 < x Initial program 11.7
rmApplied add-cube-cbrt12.0
Applied associate-*l*12.0
rmApplied sub-neg12.0
Applied distribute-lft-in12.0
Applied distribute-lft-in12.0
Simplified11.8
Simplified11.7
rmApplied associate-*r*11.5
Final simplification12.5
herbie shell --seed 2020060
(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)))))