\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 -7.49171286552268596 \cdot 10^{-190}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(b \cdot \left(c \cdot z\right) + {\left(-1 \cdot \left(t \cdot \left(i \cdot b\right)\right)\right)}^{1}\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;x \le 1.62450119526314728 \cdot 10^{-173}:\\
\;\;\;\;\left(0 - \left(\left(b \cdot c\right) \cdot z + b \cdot \left(-t \cdot i\right)\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(j \cdot \left(\sqrt[3]{c \cdot a - y \cdot i} \cdot \sqrt[3]{c \cdot a - y \cdot i}\right)\right) \cdot \sqrt[3]{c \cdot a - y \cdot i}\\
\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 VAR;
if ((x <= -7.491712865522686e-190)) {
VAR = (((x * ((y * z) - (t * a))) - ((b * (c * z)) + pow((-1.0 * (t * (i * b))), 1.0))) + (j * ((c * a) - (y * i))));
} else {
double VAR_1;
if ((x <= 1.6245011952631473e-173)) {
VAR_1 = ((0.0 - (((b * c) * z) + (b * -(t * i)))) + (j * ((c * a) - (y * i))));
} else {
VAR_1 = (((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + ((j * (cbrt(((c * a) - (y * i))) * cbrt(((c * a) - (y * i))))) * cbrt(((c * a) - (y * 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 | 11.9 |
|---|---|
| Target | 19.8 |
| Herbie | 11.9 |
if x < -7.491712865522686e-190Initial program 9.8
rmApplied sub-neg9.8
Applied distribute-lft-in9.8
rmApplied pow19.8
Applied pow19.8
Applied pow-prod-down9.8
Simplified10.2
if -7.491712865522686e-190 < x < 1.6245011952631473e-173Initial program 17.4
rmApplied sub-neg17.4
Applied distribute-lft-in17.4
rmApplied associate-*r*17.1
Taylor expanded around 0 16.5
if 1.6245011952631473e-173 < x Initial program 10.1
rmApplied add-cube-cbrt10.3
Applied associate-*r*10.3
Final simplification11.9
herbie shell --seed 2020106
(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)))))