\frac{x}{x \cdot x + 1}\frac{1}{\mathsf{fma}\left(1, \frac{1}{x}, x\right)}double f(double x) {
double r62946 = x;
double r62947 = r62946 * r62946;
double r62948 = 1.0;
double r62949 = r62947 + r62948;
double r62950 = r62946 / r62949;
return r62950;
}
double f(double x) {
double r62951 = 1.0;
double r62952 = 1.0;
double r62953 = x;
double r62954 = r62951 / r62953;
double r62955 = fma(r62952, r62954, r62953);
double r62956 = r62951 / r62955;
return r62956;
}




Bits error versus x
| Original | 14.6 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 14.6
rmApplied add-sqr-sqrt14.6
Applied associate-/r*14.5
rmApplied *-un-lft-identity14.5
Applied *-un-lft-identity14.5
Applied times-frac14.5
Applied associate-/l*14.6
Simplified14.6
Taylor expanded around 0 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020035 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))