\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.3483719131786158 \cdot 10^{+154}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le -6.3662280950353905 \cdot 10^{-155}:\\
\;\;\;\;\left(\sqrt[3]{\frac{\left(x - y\right) \cdot \left(y + x\right)}{\mathsf{fma}\left(x, x, y \cdot y\right)}} \cdot \sqrt[3]{\frac{\left(x - y\right) \cdot \left(y + x\right)}{\mathsf{fma}\left(x, x, y \cdot y\right)}}\right) \cdot \sqrt[3]{\frac{\left(x - y\right) \cdot \left(y + x\right)}{\mathsf{fma}\left(x, x, y \cdot y\right)}}\\
\mathbf{elif}\;y \le 3.1003292371794966 \cdot 10^{-168}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\left(\sqrt[3]{\frac{\left(x - y\right) \cdot \left(y + x\right)}{\mathsf{fma}\left(x, x, y \cdot y\right)}} \cdot \sqrt[3]{\frac{\left(x - y\right) \cdot \left(y + x\right)}{\mathsf{fma}\left(x, x, y \cdot y\right)}}\right) \cdot \sqrt[3]{\frac{\left(x - y\right) \cdot \left(y + x\right)}{\mathsf{fma}\left(x, x, y \cdot y\right)}}\\
\end{array}double f(double x, double y) {
double r1329191 = x;
double r1329192 = y;
double r1329193 = r1329191 - r1329192;
double r1329194 = r1329191 + r1329192;
double r1329195 = r1329193 * r1329194;
double r1329196 = r1329191 * r1329191;
double r1329197 = r1329192 * r1329192;
double r1329198 = r1329196 + r1329197;
double r1329199 = r1329195 / r1329198;
return r1329199;
}
double f(double x, double y) {
double r1329200 = y;
double r1329201 = -1.3483719131786158e+154;
bool r1329202 = r1329200 <= r1329201;
double r1329203 = -1.0;
double r1329204 = -6.3662280950353905e-155;
bool r1329205 = r1329200 <= r1329204;
double r1329206 = x;
double r1329207 = r1329206 - r1329200;
double r1329208 = r1329200 + r1329206;
double r1329209 = r1329207 * r1329208;
double r1329210 = r1329200 * r1329200;
double r1329211 = fma(r1329206, r1329206, r1329210);
double r1329212 = r1329209 / r1329211;
double r1329213 = cbrt(r1329212);
double r1329214 = r1329213 * r1329213;
double r1329215 = r1329214 * r1329213;
double r1329216 = 3.1003292371794966e-168;
bool r1329217 = r1329200 <= r1329216;
double r1329218 = 1.0;
double r1329219 = r1329217 ? r1329218 : r1329215;
double r1329220 = r1329205 ? r1329215 : r1329219;
double r1329221 = r1329202 ? r1329203 : r1329220;
return r1329221;
}




Bits error versus x




Bits error versus y
| Original | 20.2 |
|---|---|
| Target | 0.1 |
| Herbie | 5.2 |
if y < -1.3483719131786158e+154Initial program 63.6
Simplified63.6
Taylor expanded around 0 0
if -1.3483719131786158e+154 < y < -6.3662280950353905e-155 or 3.1003292371794966e-168 < y Initial program 0.3
Simplified0.3
rmApplied add-cube-cbrt0.3
if -6.3662280950353905e-155 < y < 3.1003292371794966e-168Initial program 28.9
Simplified28.9
Taylor expanded around inf 16.0
Final simplification5.2
herbie shell --seed 2019153 +o rules:numerics
(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))))