\frac{x + y}{\left(x \cdot 2\right) \cdot y}\mathsf{fma}\left(0.5, \frac{1}{y}, 0.5 \cdot \frac{1}{x}\right)double f(double x, double y) {
double r493708 = x;
double r493709 = y;
double r493710 = r493708 + r493709;
double r493711 = 2.0;
double r493712 = r493708 * r493711;
double r493713 = r493712 * r493709;
double r493714 = r493710 / r493713;
return r493714;
}
double f(double x, double y) {
double r493715 = 0.5;
double r493716 = 1.0;
double r493717 = y;
double r493718 = r493716 / r493717;
double r493719 = x;
double r493720 = r493716 / r493719;
double r493721 = r493715 * r493720;
double r493722 = fma(r493715, r493718, r493721);
return r493722;
}




Bits error versus x




Bits error versus y
| Original | 15.4 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 15.4
Taylor expanded around 0 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020046 +o rules:numerics
(FPCore (x y)
:name "Linear.Projection:inversePerspective from linear-1.19.1.3, C"
:precision binary64
:herbie-target
(+ (/ 0.5 x) (/ 0.5 y))
(/ (+ x y) (* (* x 2) y)))