double code(double x, double y, double z, double t) {
return ((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t)))) <= 2.0354920697853006e+55) || !(((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t)))) <= 2.5399375317724533e+294))) {
VAR = ((double) (x + ((double) (((double) (y - x)) / ((double) (t / z))))));
} else {
VAR = ((double) (x + ((double) (((double) (((double) (y - x)) * z)) / t))));
}
return VAR;
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.7 |
|---|---|
| Target | 2.1 |
| Herbie | 1.6 |
if (+ x (/ (* (- y x) z) t)) < 2.0354920697853006e55 or 2.5399375317724533e294 < (+ x (/ (* (- y x) z) t)) Initial program 8.7
rmApplied associate-/l*2.1
if 2.0354920697853006e55 < (+ x (/ (* (- y x) z) t)) < 2.5399375317724533e294Initial program 0.1
Final simplification1.6
herbie shell --seed 2020192
(FPCore (x y z t)
:name "Numeric.Histogram:binBounds from Chart-1.5.3"
:precision binary64
:herbie-target
(if (< x -9.025511195533005e-135) (- x (* (/ z t) (- x y))) (if (< x 4.275032163700715e-250) (+ x (* (/ (- y x) t) z)) (+ x (/ (- y x) (/ t z)))))
(+ x (/ (* (- y x) z) t)))