\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 r513562 = x;
double r513563 = y;
double r513564 = r513562 + r513563;
double r513565 = 2.0;
double r513566 = r513562 * r513565;
double r513567 = r513566 * r513563;
double r513568 = r513564 / r513567;
return r513568;
}
double f(double x, double y) {
double r513569 = 0.5;
double r513570 = 1.0;
double r513571 = y;
double r513572 = r513570 / r513571;
double r513573 = x;
double r513574 = r513570 / r513573;
double r513575 = r513569 * r513574;
double r513576 = fma(r513569, r513572, r513575);
return r513576;
}




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 2020065 +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)))