\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\sqrt[3]{\left(\left(\frac{x - y}{\mathsf{hypot}\left(x, y\right)} \cdot \frac{y + x}{\mathsf{hypot}\left(x, y\right)}\right) \cdot \left(\frac{x - y}{\mathsf{hypot}\left(x, y\right)} \cdot \frac{y + x}{\mathsf{hypot}\left(x, y\right)}\right)\right) \cdot \left(\frac{x - y}{\mathsf{hypot}\left(x, y\right)} \cdot \frac{y + x}{\mathsf{hypot}\left(x, y\right)}\right)}double f(double x, double y) {
double r2962671 = x;
double r2962672 = y;
double r2962673 = r2962671 - r2962672;
double r2962674 = r2962671 + r2962672;
double r2962675 = r2962673 * r2962674;
double r2962676 = r2962671 * r2962671;
double r2962677 = r2962672 * r2962672;
double r2962678 = r2962676 + r2962677;
double r2962679 = r2962675 / r2962678;
return r2962679;
}
double f(double x, double y) {
double r2962680 = x;
double r2962681 = y;
double r2962682 = r2962680 - r2962681;
double r2962683 = hypot(r2962680, r2962681);
double r2962684 = r2962682 / r2962683;
double r2962685 = r2962681 + r2962680;
double r2962686 = r2962685 / r2962683;
double r2962687 = r2962684 * r2962686;
double r2962688 = r2962687 * r2962687;
double r2962689 = r2962688 * r2962687;
double r2962690 = cbrt(r2962689);
return r2962690;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.7 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 19.7
rmApplied add-sqr-sqrt19.7
Applied times-frac19.7
rmApplied add-cbrt-cube31.7
Applied add-cbrt-cube31.6
Applied cbrt-undiv31.6
Applied add-cbrt-cube32.2
Applied add-cbrt-cube31.6
Applied cbrt-undiv31.6
Applied cbrt-unprod31.6
Simplified0.0
Final simplification0.0
herbie shell --seed 2019163 +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))))