double code(double x, double y, double z, double t) {
return ((double) (x + ((double) (((double) (y * ((double) (z - x)))) / t))));
}
double code(double x, double y, double z, double t) {
double VAR;
if (((((double) (x + ((double) (((double) (y * ((double) (z - x)))) / t)))) <= -2.455780809786678e+294) || !(((double) (x + ((double) (((double) (y * ((double) (z - x)))) / t)))) <= 3.1073838563848064e+301))) {
VAR = ((double) (x + ((double) (y * ((double) (((double) (z - x)) / t))))));
} else {
VAR = ((double) (x + ((double) (((double) (y * ((double) (z - x)))) / 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 | 0.9 |
if (+ x (/ (* y (- z x)) t)) < -2.455780809786678e294 or 3.1073838563848064e301 < (+ x (/ (* y (- z x)) t)) Initial program 54.2
Simplified2.8
if -2.455780809786678e294 < (+ x (/ (* y (- z x)) t)) < 3.1073838563848064e301Initial program 0.7
Final simplification0.9
herbie shell --seed 2020192
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (neg z) (/ y t))))
(+ x (/ (* y (- z x)) t)))