\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -2.9357056044533087 \cdot 10^{55} \lor \neg \left(x \le 458.02780979250457\right):\\
\;\;\;\;\mathsf{fma}\left(1, \frac{1}{{x}^{5}} - \frac{1}{{x}^{3}}, \frac{1}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{\mathsf{fma}\left(x, x, 1\right)}\\
\end{array}double code(double x) {
return (x / ((x * x) + 1.0));
}
double code(double x) {
double VAR;
if (((x <= -2.9357056044533087e+55) || !(x <= 458.02780979250457))) {
VAR = fma(1.0, ((1.0 / pow(x, 5.0)) - (1.0 / pow(x, 3.0))), (1.0 / x));
} else {
VAR = (x * (1.0 / fma(x, x, 1.0)));
}
return VAR;
}




Bits error versus x
Results
| Original | 14.9 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -2.9357056044533087e+55 or 458.02780979250457 < x Initial program 32.9
Taylor expanded around inf 0.0
Simplified0.0
if -2.9357056044533087e+55 < x < 458.02780979250457Initial program 0.0
rmApplied div-inv0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020106 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))