\frac{x}{x \cdot x + 1}\frac{1}{\frac{1}{x} + x}double f(double x) {
double r47031 = x;
double r47032 = r47031 * r47031;
double r47033 = 1.0;
double r47034 = r47032 + r47033;
double r47035 = r47031 / r47034;
return r47035;
}
double f(double x) {
double r47036 = 1.0;
double r47037 = 1.0;
double r47038 = x;
double r47039 = r47037 / r47038;
double r47040 = r47039 + r47038;
double r47041 = r47036 / r47040;
return r47041;
}




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