\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}\;y \leq -2.96095025944021 \cdot 10^{+29}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(a \cdot \left(c \cdot j\right) - y \cdot \left(i \cdot j\right)\right)\\
\mathbf{elif}\;y \leq -4.675544654658787 \cdot 10^{-199}:\\
\;\;\;\;\left(\left(z \cdot \left(y \cdot x\right) - x \cdot \left(t \cdot a\right)\right) + \left(t \cdot \left(b \cdot i\right) - c \cdot \left(z \cdot b\right)\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\
\mathbf{elif}\;y \leq 2.024234916810656 \cdot 10^{-195}:\\
\;\;\;\;\left(\left(z \cdot \left(y \cdot x\right) - x \cdot \left(t \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(a \cdot \left(c \cdot j\right) - j \cdot \left(y \cdot i\right)\right)\\
\mathbf{elif}\;y \leq 4.5158651535268426 \cdot 10^{+105}:\\
\;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\left(\sqrt[3]{z} \cdot \left(x \cdot \left(y \cdot \left(\sqrt[3]{z} \cdot \sqrt[3]{z}\right)\right)\right) - x \cdot \left(t \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right) + \left(a \cdot \left(c \cdot j\right) - y \cdot \left(i \cdot j\right)\right)\\
\end{array}(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= y -2.96095025944021e+29)
(+
(+ (* x (- (* y z) (* t a))) (* b (- (* t i) (* z c))))
(- (* a (* c j)) (* y (* i j))))
(if (<= y -4.675544654658787e-199)
(+
(+ (- (* z (* y x)) (* x (* t a))) (- (* t (* b i)) (* c (* z b))))
(* j (- (* a c) (* y i))))
(if (<= y 2.024234916810656e-195)
(+
(+ (- (* z (* y x)) (* x (* t a))) (* b (- (* t i) (* z c))))
(- (* a (* c j)) (* j (* y i))))
(if (<= y 4.5158651535268426e+105)
(+
(* j (- (* a c) (* y i)))
(+
(- (* (cbrt z) (* x (* y (* (cbrt z) (cbrt z))))) (* x (* t a)))
(* b (- (* t i) (* z c)))))
(+
(+ (* x (- (* y z) (* t a))) (* b (- (* t i) (* z c))))
(- (* a (* c j)) (* y (* i j)))))))))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 ((y <= -2.96095025944021e+29)) {
VAR = ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c)))))))) + ((double) (((double) (a * ((double) (c * j)))) - ((double) (y * ((double) (i * j))))))));
} else {
double VAR_1;
if ((y <= -4.675544654658787e-199)) {
VAR_1 = ((double) (((double) (((double) (((double) (z * ((double) (y * x)))) - ((double) (x * ((double) (t * a)))))) + ((double) (((double) (t * ((double) (b * i)))) - ((double) (c * ((double) (z * b)))))))) + ((double) (j * ((double) (((double) (a * c)) - ((double) (y * i))))))));
} else {
double VAR_2;
if ((y <= 2.024234916810656e-195)) {
VAR_2 = ((double) (((double) (((double) (((double) (z * ((double) (y * x)))) - ((double) (x * ((double) (t * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c)))))))) + ((double) (((double) (a * ((double) (c * j)))) - ((double) (j * ((double) (y * i))))))));
} else {
double VAR_3;
if ((y <= 4.5158651535268426e+105)) {
VAR_3 = ((double) (((double) (j * ((double) (((double) (a * c)) - ((double) (y * i)))))) + ((double) (((double) (((double) (((double) cbrt(z)) * ((double) (x * ((double) (y * ((double) (((double) cbrt(z)) * ((double) cbrt(z)))))))))) - ((double) (x * ((double) (t * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c))))))))));
} else {
VAR_3 = ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c)))))))) + ((double) (((double) (a * ((double) (c * j)))) - ((double) (y * ((double) (i * j))))))));
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
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.1 |
|---|---|
| Target | 20.0 |
| Herbie | 10.9 |
if y < -2.96095025944021004e29 or 4.51586515352684256e105 < y Initial program 19.7
rmApplied sub-neg19.7
Applied distribute-lft-in19.7
Simplified19.9
Simplified14.7
if -2.96095025944021004e29 < y < -4.67554465465878684e-199Initial program 8.7
rmApplied sub-neg8.7
Applied distribute-lft-in8.7
Simplified8.7
rmApplied associate-*r*8.6
rmApplied sub-neg8.6
Applied distribute-lft-in8.6
Simplified9.1
Simplified9.1
if -4.67554465465878684e-199 < y < 2.0242349168106558e-195Initial program 9.2
rmApplied sub-neg9.2
Applied distribute-lft-in9.2
Simplified9.2
rmApplied associate-*r*9.2
rmApplied sub-neg9.2
Applied distribute-lft-in9.2
Simplified10.1
Simplified10.1
if 2.0242349168106558e-195 < y < 4.51586515352684256e105Initial program 9.7
rmApplied sub-neg9.7
Applied distribute-lft-in9.7
Simplified9.7
rmApplied associate-*r*9.6
rmApplied add-cube-cbrt9.7
Applied associate-*r*9.8
Simplified9.1
Final simplification10.9
herbie shell --seed 2020198
(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.0) (pow (* t i) 2.0))) (+ (* 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.0) (pow (* t i) 2.0))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))