\frac{x + y}{1 - \frac{y}{z}}\frac{x + y}{1 - \frac{y}{z}}double code(double x, double y, double z) {
return ((double) (((double) (x + y)) / ((double) (1.0 - ((double) (y / z))))));
}
double code(double x, double y, double z) {
return ((double) (((double) (x + y)) / ((double) (1.0 - ((double) (y / z))))));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.1 |
|---|---|
| Target | 4.0 |
| Herbie | 7.1 |
Initial program 7.1
Final simplification7.1
herbie shell --seed 2020120
(FPCore (x y z)
:name "Graphics.Rendering.Chart.Backend.Diagrams:calcFontMetrics from Chart-diagrams-1.5.1, A"
:precision binary64
:herbie-target
(if (< y -3.7429310762689856e+171) (* (/ (+ y x) (- y)) z) (if (< y 3.5534662456086734e+168) (/ (+ x y) (- 1 (/ y z))) (* (/ (+ y x) (- y)) z)))
(/ (+ x y) (- 1 (/ y z))))