\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 r561928 = x;
double r561929 = y;
double r561930 = r561928 - r561929;
double r561931 = 2.0;
double r561932 = r561928 * r561931;
double r561933 = r561932 * r561929;
double r561934 = r561930 / r561933;
return r561934;
}
double f(double x, double y) {
double r561935 = y;
double r561936 = -4.037603117656268e-36;
bool r561937 = r561935 <= r561936;
double r561938 = 5.806446469040415e+46;
bool r561939 = r561935 <= r561938;
double r561940 = !r561939;
bool r561941 = r561937 || r561940;
double r561942 = 1.0;
double r561943 = sqrt(r561942);
double r561944 = x;
double r561945 = r561944 / r561942;
double r561946 = r561943 / r561945;
double r561947 = 2.0;
double r561948 = r561935 * r561947;
double r561949 = r561944 - r561935;
double r561950 = r561948 / r561949;
double r561951 = r561946 / r561950;
double r561952 = r561944 * r561947;
double r561953 = r561952 / r561949;
double r561954 = r561942 / r561953;
double r561955 = r561954 / r561935;
double r561956 = r561941 ? r561951 : r561955;
return r561956;
}




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