\frac{\left(x \cdot 2\right) \cdot y}{x - y}\frac{1}{\frac{0.5}{y} - \frac{0.5}{x}}(FPCore (x y) :precision binary64 (/ (* (* x 2.0) y) (- x y)))
(FPCore (x y) :precision binary64 (/ 1.0 (- (/ 0.5 y) (/ 0.5 x))))
double code(double x, double y) {
return ((x * 2.0) * y) / (x - y);
}
double code(double x, double y) {
return 1.0 / ((0.5 / y) - (0.5 / x));
}




Bits error versus x




Bits error versus y
Results
| Original | 15.5 |
|---|---|
| Target | 0.4 |
| Herbie | 0.2 |
Initial program 15.5
rmApplied clear-num_binary6415.6
Simplified0.2
Final simplification0.2
herbie shell --seed 2020224
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2.0 x) (- x y)) y) (if (< x 8.364504563556443e+16) (/ (* x 2.0) (/ (- x y) y)) (* (/ (* 2.0 x) (- x y)) y)))
(/ (* (* x 2.0) y) (- x y)))