\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 r27971707 = x;
double r27971708 = 2.0;
double r27971709 = r27971707 * r27971708;
double r27971710 = y;
double r27971711 = r27971709 * r27971710;
double r27971712 = r27971707 - r27971710;
double r27971713 = r27971711 / r27971712;
return r27971713;
}
double f(double x, double y) {
double r27971714 = 1.0;
double r27971715 = 0.5;
double r27971716 = y;
double r27971717 = r27971715 / r27971716;
double r27971718 = x;
double r27971719 = r27971715 / r27971718;
double r27971720 = r27971717 - r27971719;
double r27971721 = r27971714 / r27971720;
return r27971721;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.6 |
|---|---|
| Target | 0.4 |
| Herbie | 0.2 |
Initial program 14.6
rmApplied clear-num14.8
Taylor expanded around 0 0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019200
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
: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)))