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




Bits error versus x
Results
| Original | 15.1 |
|---|---|
| Target | 0.1 |
| Herbie | 15.0 |
Initial program 15.1
rmApplied add-sqr-sqrt_binary64_64515.1
Applied *-un-lft-identity_binary64_66015.1
Applied times-frac_binary64_65515.0
Final simplification15.0
herbie shell --seed 2020270
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1.0 (+ x (/ 1.0 x)))
(/ x (+ (* x x) 1.0)))