\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 r406031 = x;
double r406032 = 2.0;
double r406033 = r406031 * r406032;
double r406034 = y;
double r406035 = r406033 * r406034;
double r406036 = r406031 - r406034;
double r406037 = r406035 / r406036;
return r406037;
}
double f(double x, double y) {
double r406038 = y;
double r406039 = -5.576363061111535e+137;
bool r406040 = r406038 <= r406039;
double r406041 = 2.1955332737182344e+93;
bool r406042 = r406038 <= r406041;
double r406043 = !r406042;
bool r406044 = r406040 || r406043;
double r406045 = x;
double r406046 = 2.0;
double r406047 = r406045 * r406046;
double r406048 = r406045 / r406038;
double r406049 = 1.0;
double r406050 = r406048 - r406049;
double r406051 = 3.0;
double r406052 = pow(r406050, r406051);
double r406053 = cbrt(r406052);
double r406054 = r406047 / r406053;
double r406055 = r406045 - r406038;
double r406056 = r406047 / r406055;
double r406057 = r406056 * r406038;
double r406058 = r406044 ? r406054 : r406057;
return r406058;
}




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