\frac{x - y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le -2.360330195182189619341025150081655268265 \cdot 10^{50} \lor \neg \left(x \le 2.245371265275845673758884064817345150736 \cdot 10^{45}\right):\\
\;\;\;\;\frac{\frac{x - y}{x \cdot 2}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x} \cdot \frac{\frac{x - y}{2}}{y}\\
\end{array}double f(double x, double y) {
double r562410 = x;
double r562411 = y;
double r562412 = r562410 - r562411;
double r562413 = 2.0;
double r562414 = r562410 * r562413;
double r562415 = r562414 * r562411;
double r562416 = r562412 / r562415;
return r562416;
}
double f(double x, double y) {
double r562417 = x;
double r562418 = -2.3603301951821896e+50;
bool r562419 = r562417 <= r562418;
double r562420 = 2.2453712652758457e+45;
bool r562421 = r562417 <= r562420;
double r562422 = !r562421;
bool r562423 = r562419 || r562422;
double r562424 = y;
double r562425 = r562417 - r562424;
double r562426 = 2.0;
double r562427 = r562417 * r562426;
double r562428 = r562425 / r562427;
double r562429 = r562428 / r562424;
double r562430 = 1.0;
double r562431 = r562430 / r562417;
double r562432 = r562425 / r562426;
double r562433 = r562432 / r562424;
double r562434 = r562431 * r562433;
double r562435 = r562423 ? r562429 : r562434;
return r562435;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.4 |
|---|---|
| Target | 0.0 |
| Herbie | 0.3 |
if x < -2.3603301951821896e+50 or 2.2453712652758457e+45 < x Initial program 18.3
rmApplied associate-/r*0.2
if -2.3603301951821896e+50 < x < 2.2453712652758457e+45Initial program 13.2
rmApplied associate-/r*14.8
rmApplied *-un-lft-identity14.8
Applied *-un-lft-identity14.8
Applied times-frac14.7
Applied times-frac0.4
Simplified0.4
Final simplification0.3
herbie shell --seed 2019353
(FPCore (x y)
:name "Linear.Projection:inversePerspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(- (/ 0.5 y) (/ 0.5 x))
(/ (- x y) (* (* x 2) y)))