\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\frac{1}{\frac{\mathsf{hypot}\left(x, y\right)}{y + x}} \cdot \sqrt[3]{{\left(\frac{x - y}{\mathsf{hypot}\left(x, y\right)}\right)}^{3}}double f(double x, double y) {
double r47843 = x;
double r47844 = y;
double r47845 = r47843 - r47844;
double r47846 = r47843 + r47844;
double r47847 = r47845 * r47846;
double r47848 = r47843 * r47843;
double r47849 = r47844 * r47844;
double r47850 = r47848 + r47849;
double r47851 = r47847 / r47850;
return r47851;
}
double f(double x, double y) {
double r47852 = 1.0;
double r47853 = x;
double r47854 = y;
double r47855 = hypot(r47853, r47854);
double r47856 = r47854 + r47853;
double r47857 = r47855 / r47856;
double r47858 = r47852 / r47857;
double r47859 = r47853 - r47854;
double r47860 = r47859 / r47855;
double r47861 = 3.0;
double r47862 = pow(r47860, r47861);
double r47863 = cbrt(r47862);
double r47864 = r47858 * r47863;
return r47864;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.3 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 20.3
rmApplied add-sqr-sqrt20.3
Applied times-frac20.4
Simplified20.3
Simplified0.0
rmApplied add-cbrt-cube32.4
Applied add-cbrt-cube32.3
Applied cbrt-undiv32.3
Simplified0.1
rmApplied clear-num0.0
Final simplification0.0
herbie shell --seed 2019196 +o rules:numerics
(FPCore (x y)
:name "Kahan p9 Example"
:pre (and (< 0.0 x 1.0) (< y 1.0))
:herbie-target
(if (< 0.5 (fabs (/ x y)) 2.0) (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))) (- 1.0 (/ 2.0 (+ 1.0 (* (/ x y) (/ x y))))))
(/ (* (- x y) (+ x y)) (+ (* x x) (* y y))))