\frac{x - y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;x \le -34049285222232588342224461470667636736 \lor \neg \left(x \le 5.984537492343478795202216441324558590653 \cdot 10^{-19}\right):\\
\;\;\;\;\frac{\frac{\frac{x - y}{2}}{x}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x \cdot 2} \cdot \frac{x - y}{y}\\
\end{array}double f(double x, double y) {
double r411822 = x;
double r411823 = y;
double r411824 = r411822 - r411823;
double r411825 = 2.0;
double r411826 = r411822 * r411825;
double r411827 = r411826 * r411823;
double r411828 = r411824 / r411827;
return r411828;
}
double f(double x, double y) {
double r411829 = x;
double r411830 = -3.404928522223259e+37;
bool r411831 = r411829 <= r411830;
double r411832 = 5.984537492343479e-19;
bool r411833 = r411829 <= r411832;
double r411834 = !r411833;
bool r411835 = r411831 || r411834;
double r411836 = y;
double r411837 = r411829 - r411836;
double r411838 = 2.0;
double r411839 = r411837 / r411838;
double r411840 = r411839 / r411829;
double r411841 = r411840 / r411836;
double r411842 = 1.0;
double r411843 = r411829 * r411838;
double r411844 = r411842 / r411843;
double r411845 = r411837 / r411836;
double r411846 = r411844 * r411845;
double r411847 = r411835 ? r411841 : r411846;
return r411847;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.4 |
|---|---|
| Target | 0.0 |
| Herbie | 0.1 |
if x < -3.404928522223259e+37 or 5.984537492343479e-19 < x Initial program 16.5
rmApplied *-un-lft-identity16.5
Applied times-frac16.3
rmApplied associate-*r/0.2
Simplified0.1
if -3.404928522223259e+37 < x < 5.984537492343479e-19Initial program 14.4
rmApplied *-un-lft-identity14.4
Applied times-frac0.2
Final simplification0.1
herbie shell --seed 2019209
(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)))