\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.9550884380039752 \cdot 10^{149}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le -3.2249699642398948 \cdot 10^{-151}:\\
\;\;\;\;\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 1.981429660423225 \cdot 10^{-178}:\\
\;\;\;\;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 r64760 = x;
double r64761 = y;
double r64762 = r64760 - r64761;
double r64763 = r64760 + r64761;
double r64764 = r64762 * r64763;
double r64765 = r64760 * r64760;
double r64766 = r64761 * r64761;
double r64767 = r64765 + r64766;
double r64768 = r64764 / r64767;
return r64768;
}
double f(double x, double y) {
double r64769 = y;
double r64770 = -1.9550884380039752e+149;
bool r64771 = r64769 <= r64770;
double r64772 = -1.0;
double r64773 = -3.224969964239895e-151;
bool r64774 = r64769 <= r64773;
double r64775 = x;
double r64776 = r64775 - r64769;
double r64777 = r64775 + r64769;
double r64778 = r64776 * r64777;
double r64779 = r64775 * r64775;
double r64780 = r64769 * r64769;
double r64781 = r64779 + r64780;
double r64782 = r64778 / r64781;
double r64783 = 3.0;
double r64784 = pow(r64782, r64783);
double r64785 = cbrt(r64784);
double r64786 = 1.981429660423225e-178;
bool r64787 = r64769 <= r64786;
double r64788 = 1.0;
double r64789 = r64787 ? r64788 : r64785;
double r64790 = r64774 ? r64785 : r64789;
double r64791 = r64771 ? r64772 : r64790;
return r64791;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.9 |
|---|---|
| Target | 0.0 |
| Herbie | 5.5 |
if y < -1.9550884380039752e+149Initial program 62.0
Taylor expanded around 0 0
if -1.9550884380039752e+149 < y < -3.224969964239895e-151 or 1.981429660423225e-178 < y Initial program 1.0
rmApplied add-cbrt-cube37.4
Applied add-cbrt-cube37.6
Applied add-cbrt-cube37.8
Applied cbrt-unprod37.4
Applied cbrt-undiv37.3
Simplified1.0
if -3.224969964239895e-151 < y < 1.981429660423225e-178Initial program 29.2
Taylor expanded around inf 16.2
Final simplification5.5
herbie shell --seed 2020003
(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))))