\frac{x}{x \cdot x + 1}\frac{1}{\mathsf{fma}\left(1, \frac{1}{x}, x\right)}double code(double x) {
return (x / ((x * x) + 1.0));
}
double code(double x) {
return (1.0 / fma(1.0, (1.0 / x), x));
}




Bits error versus x
Results
| Original | 15.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 15.1
rmApplied clear-num15.1
Simplified15.1
Taylor expanded around 0 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020091 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))