\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\log \left(e^{\frac{\left(y + x\right) \cdot \frac{x - y}{\mathsf{hypot}\left(y, x\right)}}{\mathsf{hypot}\left(y, x\right)}}\right)double f(double x, double y) {
double r2747763 = x;
double r2747764 = y;
double r2747765 = r2747763 - r2747764;
double r2747766 = r2747763 + r2747764;
double r2747767 = r2747765 * r2747766;
double r2747768 = r2747763 * r2747763;
double r2747769 = r2747764 * r2747764;
double r2747770 = r2747768 + r2747769;
double r2747771 = r2747767 / r2747770;
return r2747771;
}
double f(double x, double y) {
double r2747772 = y;
double r2747773 = x;
double r2747774 = r2747772 + r2747773;
double r2747775 = r2747773 - r2747772;
double r2747776 = hypot(r2747772, r2747773);
double r2747777 = r2747775 / r2747776;
double r2747778 = r2747774 * r2747777;
double r2747779 = r2747778 / r2747776;
double r2747780 = exp(r2747779);
double r2747781 = log(r2747780);
return r2747781;
}




Bits error versus x




Bits error versus y
Results
| Original | 19.8 |
|---|---|
| Target | 0.0 |
| Herbie | 0.0 |
Initial program 19.8
Simplified19.8
rmApplied clear-num19.8
rmApplied add-sqr-sqrt19.8
Applied times-frac19.7
Applied add-cube-cbrt19.7
Applied times-frac19.7
Simplified19.7
Simplified0.0
rmApplied associate-*l/0.0
rmApplied add-log-exp0.0
Final simplification0.0
herbie shell --seed 2019151 +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))))