\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 -1.09640248119837765 \cdot 10^{-231}:\\
\;\;\;\;\left(\left(\left(x \cdot y\right) \cdot z + x \cdot \left(-t \cdot a\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 1.9462628680957005 \cdot 10^{-206}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - 0\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x \cdot \left(y \cdot z\right) + \left(x \cdot \left(-t\right)\right) \cdot a\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 VAR;
if ((b <= -1.0964024811983777e-231)) {
VAR = (((((x * y) * z) + (x * -(t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))));
} else {
double VAR_1;
if ((b <= 1.9462628680957005e-206)) {
VAR_1 = (((x * ((y * z) - (t * a))) - 0.0) + (j * ((c * a) - (y * i))));
} else {
VAR_1 = ((((x * (y * z)) + ((x * -t) * a)) - (b * ((c * z) - (t * i)))) + (j * ((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 | 12.3 |
|---|---|
| Target | 20.1 |
| Herbie | 12.2 |
if b < -1.0964024811983777e-231Initial program 10.7
rmApplied sub-neg10.7
Applied distribute-lft-in10.8
rmApplied associate-*r*11.2
if -1.0964024811983777e-231 < b < 1.9462628680957005e-206Initial program 18.4
Taylor expanded around 0 17.1
if 1.9462628680957005e-206 < b Initial program 11.1
rmApplied sub-neg11.1
Applied distribute-lft-in11.1
rmApplied distribute-lft-neg-in11.1
Applied associate-*r*11.0
Final simplification12.2
herbie shell --seed 2020078 +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)))))