\frac{\left(x \cdot 2\right) \cdot y}{x - y}\frac{1}{\frac{0.5}{y} - \frac{0.5}{x}}double f(double x, double y) {
double r327572 = x;
double r327573 = 2.0;
double r327574 = r327572 * r327573;
double r327575 = y;
double r327576 = r327574 * r327575;
double r327577 = r327572 - r327575;
double r327578 = r327576 / r327577;
return r327578;
}
double f(double x, double y) {
double r327579 = 1.0;
double r327580 = 0.5;
double r327581 = y;
double r327582 = r327580 / r327581;
double r327583 = x;
double r327584 = r327580 / r327583;
double r327585 = r327582 - r327584;
double r327586 = r327579 / r327585;
return r327586;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
Initial program 15.3
rmApplied associate-/l*7.7
Simplified7.7
rmApplied clear-num7.8
Taylor expanded around 0 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019323
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))