\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -3.009912847037178514101182261968247974013 \cdot 10^{153}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le -3.748181836506679035654613993854921642505 \cdot 10^{-150} \lor \neg \left(y \le 6.410512806354982094014968147888518178732 \cdot 10^{-156}\right):\\
\;\;\;\;\sqrt[3]{{\left(\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;-\sqrt[3]{-1}\\
\end{array}double f(double x, double y) {
double r102411 = x;
double r102412 = y;
double r102413 = r102411 - r102412;
double r102414 = r102411 + r102412;
double r102415 = r102413 * r102414;
double r102416 = r102411 * r102411;
double r102417 = r102412 * r102412;
double r102418 = r102416 + r102417;
double r102419 = r102415 / r102418;
return r102419;
}
double f(double x, double y) {
double r102420 = y;
double r102421 = -3.0099128470371785e+153;
bool r102422 = r102420 <= r102421;
double r102423 = -1.0;
double r102424 = -3.748181836506679e-150;
bool r102425 = r102420 <= r102424;
double r102426 = 6.410512806354982e-156;
bool r102427 = r102420 <= r102426;
double r102428 = !r102427;
bool r102429 = r102425 || r102428;
double r102430 = x;
double r102431 = r102430 - r102420;
double r102432 = r102430 + r102420;
double r102433 = r102431 * r102432;
double r102434 = r102430 * r102430;
double r102435 = r102420 * r102420;
double r102436 = r102434 + r102435;
double r102437 = r102433 / r102436;
double r102438 = 3.0;
double r102439 = pow(r102437, r102438);
double r102440 = cbrt(r102439);
double r102441 = cbrt(r102423);
double r102442 = -r102441;
double r102443 = r102429 ? r102440 : r102442;
double r102444 = r102422 ? r102423 : r102443;
return r102444;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.4 |
|---|---|
| Target | 0.0 |
| Herbie | 5.3 |
if y < -3.0099128470371785e+153Initial program 63.7
Taylor expanded around 0 0
if -3.0099128470371785e+153 < y < -3.748181836506679e-150 or 6.410512806354982e-156 < y Initial program 0.0
rmApplied add-cbrt-cube37.0
Applied add-cbrt-cube37.3
Applied add-cbrt-cube37.4
Applied cbrt-unprod37.1
Applied cbrt-undiv37.0
Simplified0.0
if -3.748181836506679e-150 < y < 6.410512806354982e-156Initial program 29.1
rmApplied add-cbrt-cube53.0
Applied add-cbrt-cube53.0
Applied add-cbrt-cube53.1
Applied cbrt-unprod52.7
Applied cbrt-undiv52.7
Simplified29.1
Taylor expanded around -inf 16.1
Simplified16.1
Final simplification5.3
herbie shell --seed 2019350
(FPCore (x y)
:name "Kahan p9 Example"
:precision binary64
:pre (and (< 0.0 x 1) (< y 1))
:herbie-target
(if (< 0.5 (fabs (/ x y)) 2) (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) (- 1 (/ 2 (+ 1 (* (/ x y) (/ x y))))))
(/ (* (- x y) (+ x y)) (+ (* x x) (* y y))))