\frac{x + y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le -1.13970281624645849 \cdot 10^{-71} \lor \neg \left(x \le 5.70707891780906418 \cdot 10^{-21}\right):\\
\;\;\;\;\frac{\frac{x + y}{x \cdot 2}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{x}}{\frac{y}{\frac{x + y}{2}}}\\
\end{array}double f(double x, double y) {
double r465251 = x;
double r465252 = y;
double r465253 = r465251 + r465252;
double r465254 = 2.0;
double r465255 = r465251 * r465254;
double r465256 = r465255 * r465252;
double r465257 = r465253 / r465256;
return r465257;
}
double f(double x, double y) {
double r465258 = x;
double r465259 = -1.1397028162464585e-71;
bool r465260 = r465258 <= r465259;
double r465261 = 5.707078917809064e-21;
bool r465262 = r465258 <= r465261;
double r465263 = !r465262;
bool r465264 = r465260 || r465263;
double r465265 = y;
double r465266 = r465258 + r465265;
double r465267 = 2.0;
double r465268 = r465258 * r465267;
double r465269 = r465266 / r465268;
double r465270 = r465269 / r465265;
double r465271 = 1.0;
double r465272 = r465271 / r465258;
double r465273 = r465266 / r465267;
double r465274 = r465265 / r465273;
double r465275 = r465272 / r465274;
double r465276 = r465264 ? r465270 : r465275;
return r465276;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.3 |
|---|---|
| Target | 0.0 |
| Herbie | 0.3 |
if x < -1.1397028162464585e-71 or 5.707078917809064e-21 < x Initial program 14.2
rmApplied associate-/r*0.5
if -1.1397028162464585e-71 < x < 5.707078917809064e-21Initial program 16.8
rmApplied associate-/r*17.5
rmApplied *-un-lft-identity17.5
Applied times-frac17.5
Applied associate-/l*0.1
Final simplification0.3
herbie shell --seed 2020024
(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)))