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) {
return ((double) (x + ((double) (((double) (y / t)) * ((double) (z - x))))));
}




Bits error versus x




Bits error versus y




Bits error versus z




Bits error versus t
Results
| Original | 6.5 |
|---|---|
| Target | 2.0 |
| Herbie | 2.0 |
Initial program 6.5
Simplified6.2
rmApplied clear-num6.3
rmApplied associate-/r/6.2
Applied associate-*r*2.0
Simplified2.0
Final simplification2.0
herbie shell --seed 2020191
(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)))