\frac{x + y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -581495020226601048837164420888002560 \lor \neg \left(y \le 828625256103.0855712890625\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 r338095 = x;
double r338096 = y;
double r338097 = r338095 + r338096;
double r338098 = 2.0;
double r338099 = r338095 * r338098;
double r338100 = r338099 * r338096;
double r338101 = r338097 / r338100;
return r338101;
}
double f(double x, double y) {
double r338102 = y;
double r338103 = -5.8149502022660105e+35;
bool r338104 = r338102 <= r338103;
double r338105 = 828625256103.0856;
bool r338106 = r338102 <= r338105;
double r338107 = !r338106;
bool r338108 = r338104 || r338107;
double r338109 = 1.0;
double r338110 = x;
double r338111 = 2.0;
double r338112 = r338110 * r338111;
double r338113 = r338109 / r338112;
double r338114 = r338110 + r338102;
double r338115 = r338114 / r338102;
double r338116 = r338113 * r338115;
double r338117 = r338114 / r338112;
double r338118 = r338117 / r338102;
double r338119 = r338108 ? r338116 : r338118;
return r338119;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.9 |
|---|---|
| Target | 0.0 |
| Herbie | 0.2 |
if y < -5.8149502022660105e+35 or 828625256103.0856 < y Initial program 16.6
rmApplied *-un-lft-identity16.6
Applied times-frac0.1
if -5.8149502022660105e+35 < y < 828625256103.0856Initial program 13.4
rmApplied associate-/r*0.2
Final simplification0.2
herbie shell --seed 2019347 +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)))