\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 r487635 = x;
double r487636 = y;
double r487637 = r487635 - r487636;
double r487638 = 2.0;
double r487639 = r487635 * r487638;
double r487640 = r487639 * r487636;
double r487641 = r487637 / r487640;
return r487641;
}
double f(double x, double y) {
double r487642 = x;
double r487643 = -2.3603301951821896e+50;
bool r487644 = r487642 <= r487643;
double r487645 = 2.2453712652758457e+45;
bool r487646 = r487642 <= r487645;
double r487647 = !r487646;
bool r487648 = r487644 || r487647;
double r487649 = y;
double r487650 = r487642 - r487649;
double r487651 = 2.0;
double r487652 = r487642 * r487651;
double r487653 = r487650 / r487652;
double r487654 = r487653 / r487649;
double r487655 = 1.0;
double r487656 = r487655 / r487642;
double r487657 = r487650 / r487651;
double r487658 = r487657 / r487649;
double r487659 = r487656 * r487658;
double r487660 = r487648 ? r487654 : r487659;
return r487660;
}




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)))