\frac{x - y}{\left(x \cdot 2\right) \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -4.0376031176562681 \cdot 10^{-36} \lor \neg \left(y \le 5.8064464690404152 \cdot 10^{46}\right):\\
\;\;\;\;\frac{\frac{\sqrt{1}}{\frac{x}{1}}}{\frac{y \cdot 2}{x - y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{\frac{x \cdot 2}{x - y}}}{y}\\
\end{array}double f(double x, double y) {
double r637731 = x;
double r637732 = y;
double r637733 = r637731 - r637732;
double r637734 = 2.0;
double r637735 = r637731 * r637734;
double r637736 = r637735 * r637732;
double r637737 = r637733 / r637736;
return r637737;
}
double f(double x, double y) {
double r637738 = y;
double r637739 = -4.037603117656268e-36;
bool r637740 = r637738 <= r637739;
double r637741 = 5.806446469040415e+46;
bool r637742 = r637738 <= r637741;
double r637743 = !r637742;
bool r637744 = r637740 || r637743;
double r637745 = 1.0;
double r637746 = sqrt(r637745);
double r637747 = x;
double r637748 = r637747 / r637745;
double r637749 = r637746 / r637748;
double r637750 = 2.0;
double r637751 = r637738 * r637750;
double r637752 = r637747 - r637738;
double r637753 = r637751 / r637752;
double r637754 = r637749 / r637753;
double r637755 = r637747 * r637750;
double r637756 = r637755 / r637752;
double r637757 = r637745 / r637756;
double r637758 = r637757 / r637738;
double r637759 = r637744 ? r637754 : r637758;
return r637759;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.6 |
|---|---|
| Target | 0.0 |
| Herbie | 0.3 |
if y < -4.037603117656268e-36 or 5.806446469040415e+46 < y Initial program 16.0
rmApplied associate-/r*16.7
rmApplied clear-num16.8
rmApplied *-un-lft-identity16.8
Applied times-frac16.8
Applied add-sqr-sqrt16.8
Applied times-frac16.7
Applied associate-/l*0.3
Simplified0.2
if -4.037603117656268e-36 < y < 5.806446469040415e+46Initial program 15.2
rmApplied associate-/r*0.4
rmApplied clear-num0.4
Final simplification0.3
herbie shell --seed 2020060
(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)))