\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\begin{array}{l}
\mathbf{if}\;y \le -1.070030759127226 \cdot 10^{151}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le -6.1699005892544436 \cdot 10^{-170}:\\
\;\;\;\;\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 -5.28163054182752652 \cdot 10^{-193}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \le 1.45312618291428704 \cdot 10^{-160}:\\
\;\;\;\;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 r99824 = x;
double r99825 = y;
double r99826 = r99824 - r99825;
double r99827 = r99824 + r99825;
double r99828 = r99826 * r99827;
double r99829 = r99824 * r99824;
double r99830 = r99825 * r99825;
double r99831 = r99829 + r99830;
double r99832 = r99828 / r99831;
return r99832;
}
double f(double x, double y) {
double r99833 = y;
double r99834 = -1.070030759127226e+151;
bool r99835 = r99833 <= r99834;
double r99836 = -1.0;
double r99837 = -6.1699005892544436e-170;
bool r99838 = r99833 <= r99837;
double r99839 = x;
double r99840 = r99839 - r99833;
double r99841 = r99839 + r99833;
double r99842 = r99840 * r99841;
double r99843 = r99839 * r99839;
double r99844 = r99833 * r99833;
double r99845 = r99843 + r99844;
double r99846 = r99842 / r99845;
double r99847 = 3.0;
double r99848 = pow(r99846, r99847);
double r99849 = cbrt(r99848);
double r99850 = -5.281630541827527e-193;
bool r99851 = r99833 <= r99850;
double r99852 = 1.453126182914287e-160;
bool r99853 = r99833 <= r99852;
double r99854 = 1.0;
double r99855 = r99853 ? r99854 : r99849;
double r99856 = r99851 ? r99836 : r99855;
double r99857 = r99838 ? r99849 : r99856;
double r99858 = r99835 ? r99836 : r99857;
return r99858;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.6 |
|---|---|
| Target | 0.0 |
| Herbie | 5.3 |
if y < -1.070030759127226e+151 or -6.1699005892544436e-170 < y < -5.281630541827527e-193Initial program 58.8
Taylor expanded around 0 4.3
if -1.070030759127226e+151 < y < -6.1699005892544436e-170 or 1.453126182914287e-160 < y Initial program 0.4
rmApplied add-cbrt-cube38.1
Applied add-cbrt-cube38.3
Applied add-cbrt-cube38.4
Applied cbrt-unprod38.1
Applied cbrt-undiv38.0
Simplified0.4
if -5.281630541827527e-193 < y < 1.453126182914287e-160Initial program 30.5
rmApplied add-log-exp30.5
Taylor expanded around inf 14.9
Final simplification5.3
herbie shell --seed 2020025
(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))))