\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.32007220132404135 \cdot 10^{146}:\\
\;\;\;\;\left(\left(\sqrt[3]{x \cdot \left(y \cdot z - t \cdot a\right)} \cdot \sqrt[3]{x \cdot \left(y \cdot z - t \cdot a\right)}\right) \cdot \sqrt[3]{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)\\
\mathbf{elif}\;b \le 2.8239322977184579 \cdot 10^{48}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - \left(z \cdot \left(b \cdot c\right) + \left(-b\right) \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) - \sqrt{b} \cdot \left(\sqrt{b} \cdot \left(c \cdot z - t \cdot i\right)\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.3200722013240413e+146)) {
VAR = ((((cbrt((x * ((y * z) - (t * a)))) * cbrt((x * ((y * z) - (t * a))))) * cbrt((x * ((y * z) - (t * a))))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))));
} else {
double VAR_1;
if ((b <= 2.823932297718458e+48)) {
VAR_1 = (((x * ((y * z) - (t * a))) - ((z * (b * c)) + (-b * (t * i)))) + (j * ((c * a) - (y * i))));
} else {
VAR_1 = (((x * ((y * z) - (t * a))) - (sqrt(b) * (sqrt(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 | 11.8 |
|---|---|
| Target | 19.5 |
| Herbie | 10.6 |
if b < -1.3200722013240413e+146Initial program 6.6
rmApplied add-cube-cbrt6.7
if -1.3200722013240413e+146 < b < 2.823932297718458e+48Initial program 13.3
rmApplied add-cube-cbrt13.5
Applied associate-*l*13.5
rmApplied sub-neg13.5
Applied distribute-lft-in13.5
Applied distribute-lft-in13.5
Simplified11.9
Simplified11.8
if 2.823932297718458e+48 < b Initial program 6.9
rmApplied add-sqr-sqrt7.0
Applied associate-*l*7.0
Final simplification10.6
herbie shell --seed 2020103
(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)))))