\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\sqrt[3]{{\left(\log \left(e^{\frac{x - y}{\mathsf{hypot}\left(x, y\right)}}\right)\right)}^{3}} \cdot \frac{x + y}{\mathsf{hypot}\left(x, y\right)}double f(double x, double y) {
double r64783 = x;
double r64784 = y;
double r64785 = r64783 - r64784;
double r64786 = r64783 + r64784;
double r64787 = r64785 * r64786;
double r64788 = r64783 * r64783;
double r64789 = r64784 * r64784;
double r64790 = r64788 + r64789;
double r64791 = r64787 / r64790;
return r64791;
}
double f(double x, double y) {
double r64792 = x;
double r64793 = y;
double r64794 = r64792 - r64793;
double r64795 = hypot(r64792, r64793);
double r64796 = r64794 / r64795;
double r64797 = exp(r64796);
double r64798 = log(r64797);
double r64799 = 3.0;
double r64800 = pow(r64798, r64799);
double r64801 = cbrt(r64800);
double r64802 = r64792 + r64793;
double r64803 = r64802 / r64795;
double r64804 = r64801 * r64803;
return r64804;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.0 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 20.0
rmApplied add-sqr-sqrt20.0
Applied times-frac20.1
Simplified20.1
Simplified0.0
rmApplied add-cbrt-cube32.1
Applied add-cbrt-cube32.0
Applied cbrt-undiv32.0
Simplified0.0
rmApplied add-log-exp0.1
Final simplification0.1
herbie shell --seed 2019235 +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))))