\frac{x - y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le -3.988741544918683514691243360830679767552 \cdot 10^{-57} \lor \neg \left(x \le 2.652081687524138675796576957148481763096 \cdot 10^{-25}\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 r307622 = x;
double r307623 = y;
double r307624 = r307622 - r307623;
double r307625 = 2.0;
double r307626 = r307622 * r307625;
double r307627 = r307626 * r307623;
double r307628 = r307624 / r307627;
return r307628;
}
double f(double x, double y) {
double r307629 = x;
double r307630 = -3.9887415449186835e-57;
bool r307631 = r307629 <= r307630;
double r307632 = 2.6520816875241387e-25;
bool r307633 = r307629 <= r307632;
double r307634 = !r307633;
bool r307635 = r307631 || r307634;
double r307636 = y;
double r307637 = r307629 - r307636;
double r307638 = 2.0;
double r307639 = r307629 * r307638;
double r307640 = r307637 / r307639;
double r307641 = r307640 / r307636;
double r307642 = 1.0;
double r307643 = r307642 / r307629;
double r307644 = r307637 / r307638;
double r307645 = r307644 / r307636;
double r307646 = r307643 * r307645;
double r307647 = r307635 ? r307641 : r307646;
return r307647;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.2 |
|---|---|
| Target | 0.0 |
| Herbie | 0.2 |
if x < -3.9887415449186835e-57 or 2.6520816875241387e-25 < x Initial program 13.8
rmApplied associate-/r*0.3
if -3.9887415449186835e-57 < x < 2.6520816875241387e-25Initial program 17.0
rmApplied associate-/r*18.1
rmApplied *-un-lft-identity18.1
Applied *-un-lft-identity18.1
Applied times-frac18.1
Applied times-frac0.1
Simplified0.1
Final simplification0.2
herbie shell --seed 2019325 +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)))