\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.3274516788363714 \cdot 10^{+154}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le -2.1787343740722824 \cdot 10^{-157}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot \left(y + x\right)}{y \cdot y + x \cdot x}\\
\mathbf{elif}\;y \le 3.804078574192898 \cdot 10^{-162}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{\left(\frac{\left(x - y\right) \cdot \left(y + x\right)}{y \cdot y + x \cdot x} \cdot \frac{\left(x - y\right) \cdot \left(y + x\right)}{y \cdot y + x \cdot x}\right) \cdot \frac{\left(x - y\right) \cdot \left(y + x\right)}{y \cdot y + x \cdot x}}\\
\end{array}double f(double x, double y) {
double r12688337 = x;
double r12688338 = y;
double r12688339 = r12688337 - r12688338;
double r12688340 = r12688337 + r12688338;
double r12688341 = r12688339 * r12688340;
double r12688342 = r12688337 * r12688337;
double r12688343 = r12688338 * r12688338;
double r12688344 = r12688342 + r12688343;
double r12688345 = r12688341 / r12688344;
return r12688345;
}
double f(double x, double y) {
double r12688346 = y;
double r12688347 = -1.3274516788363714e+154;
bool r12688348 = r12688346 <= r12688347;
double r12688349 = -1.0;
double r12688350 = -2.1787343740722824e-157;
bool r12688351 = r12688346 <= r12688350;
double r12688352 = x;
double r12688353 = r12688352 - r12688346;
double r12688354 = r12688346 + r12688352;
double r12688355 = r12688353 * r12688354;
double r12688356 = r12688346 * r12688346;
double r12688357 = r12688352 * r12688352;
double r12688358 = r12688356 + r12688357;
double r12688359 = r12688355 / r12688358;
double r12688360 = 3.804078574192898e-162;
bool r12688361 = r12688346 <= r12688360;
double r12688362 = 1.0;
double r12688363 = r12688359 * r12688359;
double r12688364 = r12688363 * r12688359;
double r12688365 = cbrt(r12688364);
double r12688366 = r12688361 ? r12688362 : r12688365;
double r12688367 = r12688351 ? r12688359 : r12688366;
double r12688368 = r12688348 ? r12688349 : r12688367;
return r12688368;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.4 |
|---|---|
| Target | 0.0 |
| Herbie | 4.7 |
if y < -1.3274516788363714e+154Initial program 63.6
rmApplied add-cbrt-cube63.6
Taylor expanded around 0 0
if -1.3274516788363714e+154 < y < -2.1787343740722824e-157Initial program 0.0
if -2.1787343740722824e-157 < y < 3.804078574192898e-162Initial program 27.3
rmApplied add-sqr-sqrt27.3
Applied times-frac27.7
Taylor expanded around -inf 15.0
if 3.804078574192898e-162 < y Initial program 0.1
rmApplied add-cbrt-cube0.1
Final simplification4.7
herbie shell --seed 2019124
(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))))