\frac{x}{x \cdot x + 1}\frac{1}{\frac{1}{x} + x}double f(double x) {
double r70598 = x;
double r70599 = r70598 * r70598;
double r70600 = 1.0;
double r70601 = r70599 + r70600;
double r70602 = r70598 / r70601;
return r70602;
}
double f(double x) {
double r70603 = 1.0;
double r70604 = 1.0;
double r70605 = x;
double r70606 = r70604 / r70605;
double r70607 = r70606 + r70605;
double r70608 = r70603 / r70607;
return r70608;
}




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