\frac{x}{x \cdot x + 1}\frac{1}{x + 1 \cdot \frac{1}{x}}double f(double x) {
double r55168 = x;
double r55169 = r55168 * r55168;
double r55170 = 1.0;
double r55171 = r55169 + r55170;
double r55172 = r55168 / r55171;
return r55172;
}
double f(double x) {
double r55173 = 1.0;
double r55174 = x;
double r55175 = 1.0;
double r55176 = r55173 / r55174;
double r55177 = r55175 * r55176;
double r55178 = r55174 + r55177;
double r55179 = r55173 / r55178;
return r55179;
}




Bits error versus x
Results
| 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
Final simplification0.1
herbie shell --seed 2020039
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))