\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\log \left(e^{\frac{x - y}{\mathsf{hypot}\left(x, y\right)} \cdot \frac{x + y}{\mathsf{hypot}\left(x, y\right)}}\right)double f(double x, double y) {
double r3705090 = x;
double r3705091 = y;
double r3705092 = r3705090 - r3705091;
double r3705093 = r3705090 + r3705091;
double r3705094 = r3705092 * r3705093;
double r3705095 = r3705090 * r3705090;
double r3705096 = r3705091 * r3705091;
double r3705097 = r3705095 + r3705096;
double r3705098 = r3705094 / r3705097;
return r3705098;
}
double f(double x, double y) {
double r3705099 = x;
double r3705100 = y;
double r3705101 = r3705099 - r3705100;
double r3705102 = hypot(r3705099, r3705100);
double r3705103 = r3705101 / r3705102;
double r3705104 = r3705099 + r3705100;
double r3705105 = r3705104 / r3705102;
double r3705106 = r3705103 * r3705105;
double r3705107 = exp(r3705106);
double r3705108 = log(r3705107);
return r3705108;
}




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 add-sqr-sqrt19.8
Applied times-frac19.9
rmApplied add-log-exp19.9
Simplified0.0
Final simplification0.0
herbie shell --seed 2019162 +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))))