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 (((j <= -1.823492765131761e+24) || !(j <= 1.0557116831530113e+19))) {
VAR = ((double) (((double) (((double) (((double) (z * ((double) (y * x)))) - ((double) (t * ((double) (x * a)))))) + ((double) (b * ((double) (((double) (t * i)) - ((double) (z * c)))))))) + ((double) (j * ((double) (((double) (a * c)) - ((double) (y * i))))))));
} else {
VAR = ((double) (((double) (((double) (x * ((double) (((double) (z * y)) - ((double) (t * a)))))) + ((double) (((double) (t * ((double) (b * i)))) - ((double) (c * ((double) (z * b)))))))) + ((double) (((double) (c * ((double) (j * a)))) - ((double) (i * ((double) (j * y))))))));
}
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.4 |
|---|---|
| Target | 20.4 |
| Herbie | 9.0 |
if j < -1.82349276513176103e24 or 10557116831530113000 < j Initial program 7.7
rmApplied sub-neg7.7
Applied distribute-lft-in7.7
Simplified7.7
Simplified7.6
if -1.82349276513176103e24 < j < 10557116831530113000Initial program 15.1
rmApplied sub-neg15.1
Applied distribute-lft-in15.1
Simplified12.6
Simplified9.8
rmApplied sub-neg9.8
Applied distribute-lft-in9.8
Simplified9.6
rmApplied associate-*r*10.5
Taylor expanded around inf 10.6
Simplified9.8
Final simplification9.0
herbie shell --seed 2020192
(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)))))