\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.14178066733525963 \cdot 10^{154}:\\
\;\;\;\;\sqrt[3]{-1}\\
\mathbf{elif}\;y \le -1.6515932751816961 \cdot 10^{-162}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\right)}^{3}}\\
\mathbf{elif}\;y \le 7.8035108112990794 \cdot 10^{-163}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\sqrt[3]{{\left(\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\right)}^{3}}\\
\end{array}double f(double x, double y) {
double r68123 = x;
double r68124 = y;
double r68125 = r68123 - r68124;
double r68126 = r68123 + r68124;
double r68127 = r68125 * r68126;
double r68128 = r68123 * r68123;
double r68129 = r68124 * r68124;
double r68130 = r68128 + r68129;
double r68131 = r68127 / r68130;
return r68131;
}
double f(double x, double y) {
double r68132 = y;
double r68133 = -1.1417806673352596e+154;
bool r68134 = r68132 <= r68133;
double r68135 = -1.0;
double r68136 = cbrt(r68135);
double r68137 = -1.651593275181696e-162;
bool r68138 = r68132 <= r68137;
double r68139 = x;
double r68140 = r68139 - r68132;
double r68141 = r68139 + r68132;
double r68142 = r68140 * r68141;
double r68143 = r68139 * r68139;
double r68144 = r68132 * r68132;
double r68145 = r68143 + r68144;
double r68146 = r68142 / r68145;
double r68147 = 3.0;
double r68148 = pow(r68146, r68147);
double r68149 = cbrt(r68148);
double r68150 = 7.80351081129908e-163;
bool r68151 = r68132 <= r68150;
double r68152 = 1.0;
double r68153 = r68151 ? r68152 : r68149;
double r68154 = r68138 ? r68149 : r68153;
double r68155 = r68134 ? r68136 : r68154;
return r68155;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.0 |
|---|---|
| Target | 0.1 |
| Herbie | 4.8 |
if y < -1.1417806673352596e+154Initial program 64.0
rmApplied add-cbrt-cube64.0
Applied add-cbrt-cube64.0
Applied add-cbrt-cube64.0
Applied cbrt-unprod64.0
Applied cbrt-undiv64.0
Simplified64.0
Taylor expanded around 0 0
if -1.1417806673352596e+154 < y < -1.651593275181696e-162 or 7.80351081129908e-163 < y Initial program 0.0
rmApplied add-cbrt-cube37.2
Applied add-cbrt-cube37.5
Applied add-cbrt-cube37.7
Applied cbrt-unprod37.2
Applied cbrt-undiv37.1
Simplified0.0
if -1.651593275181696e-162 < y < 7.80351081129908e-163Initial program 29.4
Taylor expanded around inf 14.9
Final simplification4.8
herbie shell --seed 2020060
(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))))