\frac{x + y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.475760874344247412285955891776113381999 \cdot 10^{-22} \lor \neg \left(y \le 8.032379764470728586268388231044118745118 \cdot 10^{-73}\right):\\
\;\;\;\;\frac{1}{x \cdot 2} \cdot \frac{x + y}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x + y}{x \cdot 2}}{y}\\
\end{array}double f(double x, double y) {
double r314883 = x;
double r314884 = y;
double r314885 = r314883 + r314884;
double r314886 = 2.0;
double r314887 = r314883 * r314886;
double r314888 = r314887 * r314884;
double r314889 = r314885 / r314888;
return r314889;
}
double f(double x, double y) {
double r314890 = y;
double r314891 = -1.4757608743442474e-22;
bool r314892 = r314890 <= r314891;
double r314893 = 8.032379764470729e-73;
bool r314894 = r314890 <= r314893;
double r314895 = !r314894;
bool r314896 = r314892 || r314895;
double r314897 = 1.0;
double r314898 = x;
double r314899 = 2.0;
double r314900 = r314898 * r314899;
double r314901 = r314897 / r314900;
double r314902 = r314898 + r314890;
double r314903 = r314902 / r314890;
double r314904 = r314901 * r314903;
double r314905 = r314902 / r314900;
double r314906 = r314905 / r314890;
double r314907 = r314896 ? r314904 : r314906;
return r314907;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.0 |
| Herbie | 0.4 |
if y < -1.4757608743442474e-22 or 8.032379764470729e-73 < y Initial program 13.5
rmApplied *-un-lft-identity13.5
Applied times-frac0.6
if -1.4757608743442474e-22 < y < 8.032379764470729e-73Initial program 17.0
rmApplied associate-/r*0.1
Final simplification0.4
herbie shell --seed 2019212 +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)))