\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\left(\sqrt[3]{\frac{x - y}{\mathsf{hypot}\left(x, y\right) \cdot \frac{\mathsf{hypot}\left(x, y\right)}{x + y}}} \cdot \sqrt[3]{\frac{x - y}{\mathsf{hypot}\left(x, y\right) \cdot \frac{\mathsf{hypot}\left(x, y\right)}{x + y}}}\right) \cdot \sqrt[3]{\frac{x - y}{\mathsf{hypot}\left(x, y\right) \cdot \frac{\mathsf{hypot}\left(x, y\right)}{x + y}}}double f(double x, double y) {
double r53434 = x;
double r53435 = y;
double r53436 = r53434 - r53435;
double r53437 = r53434 + r53435;
double r53438 = r53436 * r53437;
double r53439 = r53434 * r53434;
double r53440 = r53435 * r53435;
double r53441 = r53439 + r53440;
double r53442 = r53438 / r53441;
return r53442;
}
double f(double x, double y) {
double r53443 = x;
double r53444 = y;
double r53445 = r53443 - r53444;
double r53446 = hypot(r53443, r53444);
double r53447 = r53443 + r53444;
double r53448 = r53446 / r53447;
double r53449 = r53446 * r53448;
double r53450 = r53445 / r53449;
double r53451 = cbrt(r53450);
double r53452 = r53451 * r53451;
double r53453 = r53452 * r53451;
return r53453;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.7 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 19.7
Simplified19.9
rmApplied *-un-lft-identity19.9
Applied add-sqr-sqrt19.9
Applied times-frac19.8
Simplified19.8
Simplified0.0
rmApplied add-cube-cbrt0.0
Final simplification0.0
herbie shell --seed 2020035 +o rules:numerics
(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))))