\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\sqrt[3]{\left(\left(\frac{y + x}{\mathsf{hypot}\left(y, x\right)} \cdot \frac{x - y}{\mathsf{hypot}\left(x, y\right)}\right) \cdot \left(\frac{y + x}{\mathsf{hypot}\left(y, x\right)} \cdot \frac{x - y}{\mathsf{hypot}\left(x, y\right)}\right)\right) \cdot \left(\frac{y + x}{\mathsf{hypot}\left(y, x\right)} \cdot \frac{x - y}{\mathsf{hypot}\left(x, y\right)}\right)}double f(double x, double y) {
double r14936935 = x;
double r14936936 = y;
double r14936937 = r14936935 - r14936936;
double r14936938 = r14936935 + r14936936;
double r14936939 = r14936937 * r14936938;
double r14936940 = r14936935 * r14936935;
double r14936941 = r14936936 * r14936936;
double r14936942 = r14936940 + r14936941;
double r14936943 = r14936939 / r14936942;
return r14936943;
}
double f(double x, double y) {
double r14936944 = y;
double r14936945 = x;
double r14936946 = r14936944 + r14936945;
double r14936947 = hypot(r14936944, r14936945);
double r14936948 = r14936946 / r14936947;
double r14936949 = r14936945 - r14936944;
double r14936950 = hypot(r14936945, r14936944);
double r14936951 = r14936949 / r14936950;
double r14936952 = r14936948 * r14936951;
double r14936953 = r14936952 * r14936952;
double r14936954 = r14936953 * r14936952;
double r14936955 = cbrt(r14936954);
return r14936955;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 20.4
Simplified20.4
rmApplied clear-num20.4
rmApplied add-sqr-sqrt20.4
Applied times-frac20.4
Applied add-cube-cbrt20.4
Applied times-frac20.4
Simplified20.4
Simplified0.0
rmApplied add-cbrt-cube0.0
Applied add-cbrt-cube0.1
Applied cbrt-unprod0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019128 +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))))