\frac{x + y}{1 - \frac{y}{z}}\frac{1}{\frac{1}{x + y} - \frac{1}{z} \cdot \frac{y}{x + y}}(FPCore (x y z) :precision binary64 (/ (+ x y) (- 1.0 (/ y z))))
(FPCore (x y z) :precision binary64 (/ 1.0 (- (/ 1.0 (+ x y)) (* (/ 1.0 z) (/ y (+ x y))))))
double code(double x, double y, double z) {
return (x + y) / (1.0 - (y / z));
}
double code(double x, double y, double z) {
return 1.0 / ((1.0 / (x + y)) - ((1.0 / z) * (y / (x + y))));
}




Bits error versus x




Bits error versus y




Bits error versus z
Results
| Original | 7.5 |
|---|---|
| Target | 4.1 |
| Herbie | 1.5 |
Initial program 7.5
rmApplied clear-num_binary64_150817.6
Simplified7.6
rmApplied div-sub_binary64_150877.6
Simplified7.6
Simplified6.7
rmApplied *-un-lft-identity_binary64_150826.7
Applied times-frac_binary64_150881.5
Final simplification1.5
herbie shell --seed 2021076
(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.0 (/ y z))) (* (/ (+ y x) (- y)) z)))
(/ (+ x y) (- 1.0 (/ y z))))