\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 r387986 = x;
double r387987 = y;
double r387988 = r387986 + r387987;
double r387989 = 2.0;
double r387990 = r387986 * r387989;
double r387991 = r387990 * r387987;
double r387992 = r387988 / r387991;
return r387992;
}
double f(double x, double y) {
double r387993 = y;
double r387994 = -1.4757608743442474e-22;
bool r387995 = r387993 <= r387994;
double r387996 = 8.032379764470729e-73;
bool r387997 = r387993 <= r387996;
double r387998 = !r387997;
bool r387999 = r387995 || r387998;
double r388000 = 1.0;
double r388001 = x;
double r388002 = 2.0;
double r388003 = r388001 * r388002;
double r388004 = r388000 / r388003;
double r388005 = r388001 + r387993;
double r388006 = r388005 / r387993;
double r388007 = r388004 * r388006;
double r388008 = r388005 / r388003;
double r388009 = r388008 / r387993;
double r388010 = r387999 ? r388007 : r388009;
return r388010;
}




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