\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -6.28812736973600292546513463779144784486 \cdot 10^{77} \lor \neg \left(y \le 1.368390397641661343136755314604820394056 \cdot 10^{-94}\right):\\
\;\;\;\;\frac{-x \cdot 2}{-\left(\frac{x}{y} - 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x - y} \cdot \left(2 \cdot y\right)\\
\end{array}double f(double x, double y) {
double r364879 = x;
double r364880 = 2.0;
double r364881 = r364879 * r364880;
double r364882 = y;
double r364883 = r364881 * r364882;
double r364884 = r364879 - r364882;
double r364885 = r364883 / r364884;
return r364885;
}
double f(double x, double y) {
double r364886 = y;
double r364887 = -6.288127369736003e+77;
bool r364888 = r364886 <= r364887;
double r364889 = 1.3683903976416613e-94;
bool r364890 = r364886 <= r364889;
double r364891 = !r364890;
bool r364892 = r364888 || r364891;
double r364893 = x;
double r364894 = 2.0;
double r364895 = r364893 * r364894;
double r364896 = -r364895;
double r364897 = r364893 / r364886;
double r364898 = 1.0;
double r364899 = r364897 - r364898;
double r364900 = -r364899;
double r364901 = r364896 / r364900;
double r364902 = r364893 - r364886;
double r364903 = r364893 / r364902;
double r364904 = r364894 * r364886;
double r364905 = r364903 * r364904;
double r364906 = r364892 ? r364901 : r364905;
return r364906;
}




Bits error versus x




Bits error versus y
Results
| Original | 15.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.6 |
if y < -6.288127369736003e+77 or 1.3683903976416613e-94 < y Initial program 15.5
rmApplied associate-/l*0.8
rmApplied frac-2neg0.8
Simplified0.8
if -6.288127369736003e+77 < y < 1.3683903976416613e-94Initial program 14.5
rmApplied associate-/l*14.4
rmApplied div-inv14.6
Applied times-frac0.5
Simplified0.3
Final simplification0.6
herbie shell --seed 2019326 +o rules:numerics
(FPCore (x y)
:name "Linear.Projection:perspective from linear-1.19.1.3, B"
:precision binary64
:herbie-target
(if (< x -1.7210442634149447e+81) (* (/ (* 2 x) (- x y)) y) (if (< x 83645045635564432) (/ (* x 2) (/ (- x y) y)) (* (/ (* 2 x) (- x y)) y)))
(/ (* (* x 2) y) (- x y)))