double f(double x) {
double r5662522 = x;
double r5662523 = r5662522 * r5662522;
double r5662524 = 1.0;
double r5662525 = r5662523 + r5662524;
double r5662526 = r5662522 / r5662525;
return r5662526;
}
double f(double x) {
double r5662527 = 1.0;
double r5662528 = x;
double r5662529 = hypot(r5662527, r5662528);
double r5662530 = r5662527 / r5662529;
double r5662531 = r5662528 / r5662529;
double r5662532 = r5662530 * r5662531;
return r5662532;
}
\frac{x}{x \cdot x + 1}\frac{1}{\sqrt{1^2 + x^2}^*} \cdot \frac{x}{\sqrt{1^2 + x^2}^*}



Bits error versus x
| Original | 14.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 14.3
Simplified14.3
rmApplied *-un-lft-identity14.3
Applied associate-/l*14.3
rmApplied *-un-lft-identity14.3
Applied add-sqr-sqrt14.3
Applied times-frac14.3
Applied add-cube-cbrt14.3
Applied times-frac14.3
Simplified14.3
Simplified0.0
Final simplification0.0
herbie shell --seed 2019101 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))