\frac{x}{x \cdot x + 1}\frac{1}{\mathsf{fma}\left(1, \frac{1}{x}, x\right)}double f(double x) {
double r68932 = x;
double r68933 = r68932 * r68932;
double r68934 = 1.0;
double r68935 = r68933 + r68934;
double r68936 = r68932 / r68935;
return r68936;
}
double f(double x) {
double r68937 = 1.0;
double r68938 = 1.0;
double r68939 = x;
double r68940 = r68937 / r68939;
double r68941 = fma(r68938, r68940, r68939);
double r68942 = r68937 / r68941;
return r68942;
}




Bits error versus x
| Original | 15.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 15.2
rmApplied add-sqr-sqrt15.2
Applied associate-/r*15.1
rmApplied *-un-lft-identity15.1
Applied *-un-lft-identity15.1
Applied times-frac15.1
Applied associate-/l*15.2
Simplified15.2
Taylor expanded around 0 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020039 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))