\frac{x}{x \cdot x + 1}\frac{\frac{x}{\sqrt{x \cdot x + 1}}}{\sqrt{x \cdot x + 1}}(FPCore (x) :precision binary64 (/ x (+ (* x x) 1.0)))
(FPCore (x) :precision binary64 (/ (/ x (sqrt (+ (* x x) 1.0))) (sqrt (+ (* x x) 1.0))))
double code(double x) {
return x / ((x * x) + 1.0);
}
double code(double x) {
return (x / sqrt((x * x) + 1.0)) / sqrt((x * x) + 1.0);
}




Bits error versus x
Results
| Original | 14.8 |
|---|---|
| Target | 0.1 |
| Herbie | 14.7 |
Initial program 14.8
rmApplied add-sqr-sqrt_binary64_167214.8
Applied associate-/r*_binary64_175014.7
Final simplification14.7
herbie shell --seed 2020268
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1.0 (+ x (/ 1.0 x)))
(/ x (+ (* x x) 1.0)))