\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 -4.79019089907351 \cdot 10^{-58} \lor \neg \left(x \le 13.7871294337804233\right):\\
\;\;\;\;\left(\left(x \cdot \left(y \cdot z\right) + x \cdot \left(-t \cdot a\right)\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + \left(j \cdot \mathsf{fma}\left(a, c, -y \cdot i\right) + j \cdot \mathsf{fma}\left(-y, i, y \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(x \cdot z\right) \cdot y + \left(x \cdot \left(-a\right)\right) \cdot t\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 (((x <= -4.7901908990735094e-58) || !(x <= 13.787129433780423))) {
VAR = ((((x * (y * z)) + (x * -(t * a))) - (b * ((c * z) - (t * i)))) + ((j * fma(a, c, -(y * i))) + (j * fma(-y, i, (y * i)))));
} else {
VAR = (((((x * z) * y) + ((x * -a) * t)) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))));
}
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 | 9.3 |
if x < -4.7901908990735094e-58 or 13.787129433780423 < x Initial program 7.9
rmApplied sub-neg7.9
Applied distribute-lft-in7.9
rmApplied prod-diff7.9
Applied distribute-lft-in7.9
Simplified7.9
Simplified7.9
if -4.7901908990735094e-58 < x < 13.787129433780423Initial program 15.7
rmApplied sub-neg15.7
Applied distribute-lft-in15.7
rmApplied *-commutative15.7
Applied distribute-lft-neg-in15.7
Applied associate-*r*12.9
rmApplied *-commutative12.9
Applied associate-*r*10.3
Final simplification9.3
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)))))