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




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.6 |
|---|---|
| Target | 4.0 |
| Herbie | 7.6 |
Initial program 7.6
Final simplification7.6
herbie shell --seed 2020078
(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))))