\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.3308054258701725 \cdot 10^{+154}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le -3.1512930280169555 \cdot 10^{-162}:\\
\;\;\;\;\sqrt[3]{\frac{\frac{1}{\frac{x \cdot x + y \cdot y}{\left(x - y\right) \cdot \left(y + x\right)} \cdot \frac{x \cdot x + y \cdot y}{\left(x - y\right) \cdot \left(y + x\right)}}}{\frac{x \cdot x + y \cdot y}{\left(x - y\right) \cdot \left(y + x\right)}}}\\
\mathbf{elif}\;y \le 8.250332507489211 \cdot 10^{-160}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{x \cdot x + y \cdot y}{\left(x - y\right) \cdot \left(y + x\right)}}\\
\end{array}double f(double x, double y) {
double r34729430 = x;
double r34729431 = y;
double r34729432 = r34729430 - r34729431;
double r34729433 = r34729430 + r34729431;
double r34729434 = r34729432 * r34729433;
double r34729435 = r34729430 * r34729430;
double r34729436 = r34729431 * r34729431;
double r34729437 = r34729435 + r34729436;
double r34729438 = r34729434 / r34729437;
return r34729438;
}
double f(double x, double y) {
double r34729439 = y;
double r34729440 = -1.3308054258701725e+154;
bool r34729441 = r34729439 <= r34729440;
double r34729442 = -1.0;
double r34729443 = -3.1512930280169555e-162;
bool r34729444 = r34729439 <= r34729443;
double r34729445 = 1.0;
double r34729446 = x;
double r34729447 = r34729446 * r34729446;
double r34729448 = r34729439 * r34729439;
double r34729449 = r34729447 + r34729448;
double r34729450 = r34729446 - r34729439;
double r34729451 = r34729439 + r34729446;
double r34729452 = r34729450 * r34729451;
double r34729453 = r34729449 / r34729452;
double r34729454 = r34729453 * r34729453;
double r34729455 = r34729445 / r34729454;
double r34729456 = r34729455 / r34729453;
double r34729457 = cbrt(r34729456);
double r34729458 = 8.250332507489211e-160;
bool r34729459 = r34729439 <= r34729458;
double r34729460 = r34729445 / r34729453;
double r34729461 = r34729459 ? r34729445 : r34729460;
double r34729462 = r34729444 ? r34729457 : r34729461;
double r34729463 = r34729441 ? r34729442 : r34729462;
return r34729463;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.4 |
|---|---|
| Target | 0.1 |
| Herbie | 5.1 |
if y < -1.3308054258701725e+154Initial program 63.6
rmApplied clear-num63.6
rmApplied add-cbrt-cube63.6
Applied add-cbrt-cube63.6
Applied cbrt-undiv63.6
Applied add-cbrt-cube63.6
Applied cbrt-undiv63.6
Simplified63.6
Taylor expanded around inf 0
if -1.3308054258701725e+154 < y < -3.1512930280169555e-162Initial program 0.0
rmApplied clear-num0.0
rmApplied add-cbrt-cube37.7
Applied add-cbrt-cube38.1
Applied cbrt-undiv38.1
Applied add-cbrt-cube38.1
Applied cbrt-undiv38.1
Simplified0.0
if -3.1512930280169555e-162 < y < 8.250332507489211e-160Initial program 29.9
Taylor expanded around inf 15.9
if 8.250332507489211e-160 < y Initial program 0.1
rmApplied clear-num0.1
Final simplification5.1
herbie shell --seed 2019128
(FPCore (x y)
:name "Kahan p9 Example"
:pre (and (< 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))))