double code(double x, double y, double z, double t, double a) {
return ((double) (((double) (((double) (x * y)) - ((double) (z * t)))) / a));
}
double code(double x, double y, double z, double t, double a) {
double VAR;
if (((((double) (((double) (x * y)) - ((double) (z * t)))) <= -7.052992131420737e+82) || !(((double) (((double) (x * y)) - ((double) (z * t)))) <= 1.7328573753956352e+179))) {
VAR = ((double) (((double) (x * ((double) (y / a)))) - ((double) (z * ((double) (t / a))))));
} else {
VAR = ((double) (((double) (((double) (x * y)) - ((double) (z * t)))) * ((double) (1.0 / a))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t




Bits error versus a
Results
| Original | 7.5 |
|---|---|
| Target | 5.8 |
| Herbie | 1.9 |
if (- (* x y) (* z t)) < -7.05299213142073739e82 or 1.73285737539563518e179 < (- (* x y) (* z t)) Initial program 18.5
rmApplied div-sub18.5
Simplified12.0
Simplified3.4
if -7.05299213142073739e82 < (- (* x y) (* z t)) < 1.73285737539563518e179Initial program 0.9
rmApplied div-inv1.0
Final simplification1.9
herbie shell --seed 2020191
(FPCore (x y z t a)
:name "Data.Colour.Matrix:inverse from colour-2.3.3, B"
:precision binary64
:herbie-target
(if (< z -2.468684968699548e+170) (- (* (/ y a) x) (* (/ t a) z)) (if (< z 6.309831121978371e-71) (/ (- (* x y) (* z t)) a) (- (* (/ y a) x) (* (/ t a) z))))
(/ (- (* x y) (* z t)) a))