\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\log \left(e^{\frac{\left(x + y\right) \cdot \frac{x - y}{\mathsf{hypot}\left(x, y\right)}}{\mathsf{hypot}\left(x, y\right)}}\right)double f(double x, double y) {
double r85243 = x;
double r85244 = y;
double r85245 = r85243 - r85244;
double r85246 = r85243 + r85244;
double r85247 = r85245 * r85246;
double r85248 = r85243 * r85243;
double r85249 = r85244 * r85244;
double r85250 = r85248 + r85249;
double r85251 = r85247 / r85250;
return r85251;
}
double f(double x, double y) {
double r85252 = x;
double r85253 = y;
double r85254 = r85252 + r85253;
double r85255 = r85252 - r85253;
double r85256 = hypot(r85252, r85253);
double r85257 = r85255 / r85256;
double r85258 = r85254 * r85257;
double r85259 = r85258 / r85256;
double r85260 = exp(r85259);
double r85261 = log(r85260);
return r85261;
}




Bits error versus x




Bits error versus y
Results
| Original | 20.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 20.2
rmApplied log1p-expm1-u20.2
rmApplied log1p-udef20.2
rmApplied add-sqr-sqrt20.2
Applied times-frac20.2
Simplified20.2
Simplified0.0
rmApplied add-exp-log0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020034 +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))))