\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 \leq -1.071313390531877 \cdot 10^{+93}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(i \cdot \left(t \cdot b\right) - c \cdot \left(z \cdot b\right)\right)\right) + j \cdot \left(a \cdot c - y \cdot i\right)\\
\mathbf{elif}\;x \leq -6.2850583882932655 \cdot 10^{-273}:\\
\;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\left(y \cdot \left(x \cdot z\right) - a \cdot \left(x \cdot t\right)\right) + \left(t \cdot \left(b \cdot i\right) - c \cdot \left(z \cdot b\right)\right)\right)\\
\mathbf{elif}\;x \leq 6.906034019089981 \cdot 10^{-187}:\\
\;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\left(y \cdot \left(x \cdot z\right) - t \cdot \left(x \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\right)\right)\\
\mathbf{elif}\;x \leq 3.3836051240335285 \cdot 10^{-65}:\\
\;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\left(y \cdot \left(x \cdot z\right) - a \cdot \left(x \cdot t\right)\right) + \left(t \cdot \left(b \cdot i\right) - c \cdot \left(z \cdot b\right)\right)\right)\\
\mathbf{elif}\;x \leq 2.129092345516236 \cdot 10^{+60}:\\
\;\;\;\;\left(\left(y \cdot \left(x \cdot z\right) - a \cdot \left(x \cdot t\right)\right) + \left(i \cdot \left(t \cdot b\right) - c \cdot \left(z \cdot b\right)\right)\right) + \left(j \cdot \left(a \cdot c\right) - i \cdot \left(y \cdot j\right)\right)\\
\mathbf{elif}\;x \leq 2.6174748258182596 \cdot 10^{+284}:\\
\;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(x \cdot \left(y \cdot z - t \cdot a\right) + \left(\sqrt[3]{b} \cdot \sqrt[3]{b}\right) \cdot \left(\sqrt[3]{b} \cdot \left(t \cdot i - z \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(a \cdot c - y \cdot i\right) + \left(\left(y \cdot \left(x \cdot z\right) - t \cdot \left(x \cdot a\right)\right) + b \cdot \left(t \cdot i - z \cdot c\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 ((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 ((x <= -1.071313390531877e+93)) {
VAR = ((double) (((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) + ((double) (((double) (i * ((double) (t * b)))) - ((double) (c * ((double) (z * b)))))))) + ((double) (j * ((double) (((double) (a * c)) - ((double) (y * i))))))));
} else {
double VAR_1;
if ((x <= -6.2850583882932655e-273)) {
VAR_1 = ((double) (((double) (j * ((double) (((double) (a * c)) - ((double) (y * i)))))) + ((double) (((double) (((double) (y * ((double) (x * z)))) - ((double) (a * ((double) (x * t)))))) + ((double) (((double) (t * ((double) (b * i)))) - ((double) (c * ((double) (z * b))))))))));
} else {
double VAR_2;
if ((x <= 6.906034019089981e-187)) {
VAR_2 = ((double) (((double) (j * ((double) (((double) (a * c)) - ((double) (y * i)))))) + ((double) (((double) (((double) (y * ((double) (x * z)))) - ((double) (t * ((double) (x * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c))))))))));
} else {
double VAR_3;
if ((x <= 3.3836051240335285e-65)) {
VAR_3 = ((double) (((double) (j * ((double) (((double) (a * c)) - ((double) (y * i)))))) + ((double) (((double) (((double) (y * ((double) (x * z)))) - ((double) (a * ((double) (x * t)))))) + ((double) (((double) (t * ((double) (b * i)))) - ((double) (c * ((double) (z * b))))))))));
} else {
double VAR_4;
if ((x <= 2.129092345516236e+60)) {
VAR_4 = ((double) (((double) (((double) (((double) (y * ((double) (x * z)))) - ((double) (a * ((double) (x * t)))))) + ((double) (((double) (i * ((double) (t * b)))) - ((double) (c * ((double) (z * b)))))))) + ((double) (((double) (j * ((double) (a * c)))) - ((double) (i * ((double) (y * j))))))));
} else {
double VAR_5;
if ((x <= 2.6174748258182596e+284)) {
VAR_5 = ((double) (((double) (j * ((double) (((double) (a * c)) - ((double) (y * i)))))) + ((double) (((double) (x * ((double) (((double) (y * z)) - ((double) (t * a)))))) + ((double) (((double) (((double) cbrt(b)) * ((double) cbrt(b)))) * ((double) (((double) cbrt(b)) * ((double) (((double) (t * i)) - ((double) (z * c))))))))))));
} else {
VAR_5 = ((double) (((double) (j * ((double) (((double) (a * c)) - ((double) (y * i)))))) + ((double) (((double) (((double) (y * ((double) (x * z)))) - ((double) (t * ((double) (x * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c))))))))));
}
VAR_4 = VAR_5;
}
VAR_3 = VAR_4;
}
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.6 |
|---|---|
| Target | 19.6 |
| Herbie | 9.5 |
if x < -1.07131339053187692e93Initial program 8.6
rmApplied sub-neg8.6
Applied distribute-lft-in8.6
Simplified7.3
Simplified7.2
if -1.07131339053187692e93 < x < -6.2850583882932655e-273 or 6.9060340190899813e-187 < x < 3.3836051240335285e-65Initial program 13.9
rmApplied sub-neg13.9
Applied distribute-lft-in13.9
Simplified12.4
Simplified10.8
rmApplied sub-neg10.8
Applied distribute-lft-in10.8
Simplified10.8
Simplified10.8
rmApplied associate-*r*9.8
if -6.2850583882932655e-273 < x < 6.9060340190899813e-187 or 2.6174748258182596e284 < x Initial program 17.9
rmApplied sub-neg17.9
Applied distribute-lft-in17.9
Simplified15.2
Simplified11.9
rmApplied associate-*r*11.8
if 3.3836051240335285e-65 < x < 2.12909234551623612e60Initial program 10.8
rmApplied sub-neg10.8
Applied distribute-lft-in10.8
Simplified10.6
Simplified10.4
rmApplied sub-neg10.4
Applied distribute-lft-in10.4
Simplified10.0
Simplified9.8
rmApplied sub-neg9.8
Applied distribute-lft-in9.8
Simplified10.3
if 2.12909234551623612e60 < x < 2.6174748258182596e284Initial program 6.8
rmApplied add-cube-cbrt7.0
Applied associate-*l*7.0
Simplified7.0
Final simplification9.5
herbie shell --seed 2020196
(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)))))