\frac{x}{x \cdot x + 1}
\frac{\frac{x}{\mathsf{hypot}\left(1, x\right)}}{\mathsf{hypot}\left(1, x\right)}
(FPCore (x) :precision binary64 (/ x (+ (* x x) 1.0)))
(FPCore (x) :precision binary64 (/ (/ x (hypot 1.0 x)) (hypot 1.0 x)))
double code(double x) {
return x / ((x * x) + 1.0);
}
double code(double x) {
return (x / hypot(1.0, x)) / hypot(1.0, x);
}




Bits error versus x
Results
| Original | 15.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 15.3
Simplified15.3
Applied add-sqr-sqrt_binary6415.3
Applied *-un-lft-identity_binary6415.3
Applied times-frac_binary6415.2
Simplified15.2
Simplified0.0
Applied associate-*l/_binary640.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021329
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1.0 (+ x (/ 1.0 x)))
(/ x (+ (* x x) 1.0)))