\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 r279746 = x;
double r279747 = y;
double r279748 = r279746 + r279747;
double r279749 = 2.0;
double r279750 = r279746 * r279749;
double r279751 = r279750 * r279747;
double r279752 = r279748 / r279751;
return r279752;
}
double f(double x, double y) {
double r279753 = x;
double r279754 = -2.221408588678627e-08;
bool r279755 = r279753 <= r279754;
double r279756 = 6.512387421164835e+90;
bool r279757 = r279753 <= r279756;
double r279758 = !r279757;
bool r279759 = r279755 || r279758;
double r279760 = y;
double r279761 = r279753 + r279760;
double r279762 = 2.0;
double r279763 = r279753 * r279762;
double r279764 = r279761 / r279763;
double r279765 = r279764 / r279760;
double r279766 = 1.0;
double r279767 = r279766 / r279763;
double r279768 = r279761 / r279760;
double r279769 = r279767 * r279768;
double r279770 = r279759 ? r279765 : r279769;
return r279770;
}




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