\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\sqrt[3]{\frac{\left(x - y\right) \cdot \frac{y + x}{\mathsf{hypot}\left(x, y\right)}}{\mathsf{hypot}\left(x, y\right)} \cdot \left(\frac{\left(x - y\right) \cdot \frac{y + x}{\mathsf{hypot}\left(x, y\right)}}{\mathsf{hypot}\left(x, y\right)} \cdot \frac{\left(x - y\right) \cdot \frac{y + x}{\mathsf{hypot}\left(x, y\right)}}{\mathsf{hypot}\left(x, y\right)}\right)}double f(double x, double y) {
double r3059944 = x;
double r3059945 = y;
double r3059946 = r3059944 - r3059945;
double r3059947 = r3059944 + r3059945;
double r3059948 = r3059946 * r3059947;
double r3059949 = r3059944 * r3059944;
double r3059950 = r3059945 * r3059945;
double r3059951 = r3059949 + r3059950;
double r3059952 = r3059948 / r3059951;
return r3059952;
}
double f(double x, double y) {
double r3059953 = x;
double r3059954 = y;
double r3059955 = r3059953 - r3059954;
double r3059956 = r3059954 + r3059953;
double r3059957 = hypot(r3059953, r3059954);
double r3059958 = r3059956 / r3059957;
double r3059959 = r3059955 * r3059958;
double r3059960 = r3059959 / r3059957;
double r3059961 = r3059960 * r3059960;
double r3059962 = r3059960 * r3059961;
double r3059963 = cbrt(r3059962);
return r3059963;
}




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))))