\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 | 15.0 |
|---|---|
| Target | 0.1 |
| Herbie | 14.9 |
Initial program 15.0
rmApplied add-sqr-sqrt_binary64_176215.0
Applied associate-/r*_binary64_184014.9
Final simplification14.9
herbie shell --seed 2020288
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1.0 (+ x (/ 1.0 x)))
(/ x (+ (* x x) 1.0)))