\frac{\left(x \cdot 2\right) \cdot y}{x - y}\begin{array}{l}
\mathbf{if}\;y \le -5.57636306111153486 \cdot 10^{137} \lor \neg \left(y \le 2.19553327371823438 \cdot 10^{93}\right):\\
\;\;\;\;\frac{x \cdot 2}{\sqrt[3]{{\left(\frac{x}{y} - 1\right)}^{3}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 2}{x - y} \cdot y\\
\end{array}double f(double x, double y) {
double r589881 = x;
double r589882 = 2.0;
double r589883 = r589881 * r589882;
double r589884 = y;
double r589885 = r589883 * r589884;
double r589886 = r589881 - r589884;
double r589887 = r589885 / r589886;
return r589887;
}
double f(double x, double y) {
double r589888 = y;
double r589889 = -5.576363061111535e+137;
bool r589890 = r589888 <= r589889;
double r589891 = 2.1955332737182344e+93;
bool r589892 = r589888 <= r589891;
double r589893 = !r589892;
bool r589894 = r589890 || r589893;
double r589895 = x;
double r589896 = 2.0;
double r589897 = r589895 * r589896;
double r589898 = r589895 / r589888;
double r589899 = 1.0;
double r589900 = r589898 - r589899;
double r589901 = 3.0;
double r589902 = pow(r589900, r589901);
double r589903 = cbrt(r589902);
double r589904 = r589897 / r589903;
double r589905 = r589895 - r589888;
double r589906 = r589897 / r589905;
double r589907 = r589906 * r589888;
double r589908 = r589894 ? r589904 : r589907;
return r589908;
}




Bits error versus x




Bits error versus y
Results
| Original | 14.7 |
|---|---|
| Target | 0.3 |
| Herbie | 1.5 |
if y < -5.576363061111535e+137 or 2.1955332737182344e+93 < y Initial program 20.8
rmApplied associate-/l*0.0
rmApplied add-cbrt-cube62.5
Applied add-cbrt-cube63.1
Applied cbrt-undiv63.1
Simplified2.1
if -5.576363061111535e+137 < y < 2.1955332737182344e+93Initial program 12.0
rmApplied associate-/l*11.0
rmApplied associate-/r/1.3
Final simplification1.5
herbie shell --seed 2020062
(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)))