\frac{x + y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le -2.221408588678627164348157744990647222139 \cdot 10^{-8} \lor \neg \left(x \le 6.512387421164835240080292418646396765453 \cdot 10^{90}\right):\\
\;\;\;\;\frac{\frac{x + y}{x \cdot 2}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot 2} \cdot \frac{x + y}{y}\\
\end{array}double f(double x, double y) {
double r462682 = x;
double r462683 = y;
double r462684 = r462682 + r462683;
double r462685 = 2.0;
double r462686 = r462682 * r462685;
double r462687 = r462686 * r462683;
double r462688 = r462684 / r462687;
return r462688;
}
double f(double x, double y) {
double r462689 = x;
double r462690 = -2.221408588678627e-08;
bool r462691 = r462689 <= r462690;
double r462692 = 6.512387421164835e+90;
bool r462693 = r462689 <= r462692;
double r462694 = !r462693;
bool r462695 = r462691 || r462694;
double r462696 = y;
double r462697 = r462689 + r462696;
double r462698 = 2.0;
double r462699 = r462689 * r462698;
double r462700 = r462697 / r462699;
double r462701 = r462700 / r462696;
double r462702 = 1.0;
double r462703 = r462702 / r462699;
double r462704 = r462697 / r462696;
double r462705 = r462703 * r462704;
double r462706 = r462695 ? r462701 : r462705;
return r462706;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.0 |
| Herbie | 0.5 |
if x < -2.221408588678627e-08 or 6.512387421164835e+90 < x Initial program 17.2
rmApplied associate-/r*0.1
if -2.221408588678627e-08 < x < 6.512387421164835e+90Initial program 13.3
rmApplied *-un-lft-identity13.3
Applied times-frac0.9
Final simplification0.5
herbie shell --seed 2019208
(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)))