\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.082274284195729575558840081904180391227 \cdot 10^{154}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le -3.525836621341174380993007144208805388616 \cdot 10^{-161} \lor \neg \left(y \le 2.03127253257456944718278947981499411723 \cdot 10^{-162}\right):\\
\;\;\;\;\sqrt[3]{{\left(\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}double f(double x, double y) {
double r72688 = x;
double r72689 = y;
double r72690 = r72688 - r72689;
double r72691 = r72688 + r72689;
double r72692 = r72690 * r72691;
double r72693 = r72688 * r72688;
double r72694 = r72689 * r72689;
double r72695 = r72693 + r72694;
double r72696 = r72692 / r72695;
return r72696;
}
double f(double x, double y) {
double r72697 = y;
double r72698 = -1.0822742841957296e+154;
bool r72699 = r72697 <= r72698;
double r72700 = -1.0;
double r72701 = -3.5258366213411744e-161;
bool r72702 = r72697 <= r72701;
double r72703 = 2.0312725325745694e-162;
bool r72704 = r72697 <= r72703;
double r72705 = !r72704;
bool r72706 = r72702 || r72705;
double r72707 = x;
double r72708 = r72707 - r72697;
double r72709 = r72707 + r72697;
double r72710 = r72708 * r72709;
double r72711 = r72707 * r72707;
double r72712 = r72697 * r72697;
double r72713 = r72711 + r72712;
double r72714 = r72710 / r72713;
double r72715 = 3.0;
double r72716 = pow(r72714, r72715);
double r72717 = cbrt(r72716);
double r72718 = 1.0;
double r72719 = r72706 ? r72717 : r72718;
double r72720 = r72699 ? r72700 : r72719;
return r72720;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.2 |
|---|---|
| Target | 0.0 |
| Herbie | 5.0 |
if y < -1.0822742841957296e+154Initial program 64.0
Taylor expanded around 0 0
if -1.0822742841957296e+154 < y < -3.5258366213411744e-161 or 2.0312725325745694e-162 < y Initial program 0.1
rmApplied add-cbrt-cube0.1
Simplified0.1
if -3.5258366213411744e-161 < y < 2.0312725325745694e-162Initial program 30.4
Taylor expanded around inf 15.5
Final simplification5.0
herbie shell --seed 2019212
(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))))