\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 r550522 = x;
double r550523 = y;
double r550524 = r550522 - r550523;
double r550525 = 2.0;
double r550526 = r550522 * r550525;
double r550527 = r550526 * r550523;
double r550528 = r550524 / r550527;
return r550528;
}
double f(double x, double y) {
double r550529 = x;
double r550530 = -2.3603301951821896e+50;
bool r550531 = r550529 <= r550530;
double r550532 = 2.2453712652758457e+45;
bool r550533 = r550529 <= r550532;
double r550534 = !r550533;
bool r550535 = r550531 || r550534;
double r550536 = y;
double r550537 = r550529 - r550536;
double r550538 = 2.0;
double r550539 = r550529 * r550538;
double r550540 = r550537 / r550539;
double r550541 = r550540 / r550536;
double r550542 = 1.0;
double r550543 = r550542 / r550529;
double r550544 = r550537 / r550538;
double r550545 = r550544 / r550536;
double r550546 = r550543 * r550545;
double r550547 = r550535 ? r550541 : r550546;
return r550547;
}




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 +o rules:numerics
(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)))