\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \leq -54864435368.92307:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{elif}\;x \leq 117265524.41492076:\\
\;\;\;\;\frac{x}{1 + x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}(FPCore (x) :precision binary64 (/ x (+ (* x x) 1.0)))
(FPCore (x) :precision binary64 (if (<= x -54864435368.92307) (/ 1.0 x) (if (<= x 117265524.41492076) (/ x (+ 1.0 (* x x))) (/ 1.0 x))))
double code(double x) {
return x / ((x * x) + 1.0);
}
double code(double x) {
double tmp;
if (x <= -54864435368.92307) {
tmp = 1.0 / x;
} else if (x <= 117265524.41492076) {
tmp = x / (1.0 + (x * x));
} else {
tmp = 1.0 / x;
}
return tmp;
}

















Bits error versus x
Results
| Original | 14.9 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
| Alternative 1 | |
|---|---|
| Error | 39.4 |
| Cost | 26560 |
| Alternative 2 | |
|---|---|
| Error | 15.9 |
| Cost | 20672 |
| Alternative 3 | |
|---|---|
| Error | 15.9 |
| Cost | 19904 |
| Alternative 4 | |
|---|---|
| Error | 14.8 |
| Cost | 13760 |
| Alternative 5 | |
|---|---|
| Error | 39.4 |
| Cost | 13376 |
| Alternative 6 | |
|---|---|
| Error | 39.6 |
| Cost | 13312 |
| Alternative 7 | |
|---|---|
| Error | 14.9 |
| Cost | 576 |
| Alternative 8 | |
|---|---|
| Error | 14.9 |
| Cost | 448 |
| Alternative 9 | |
|---|---|
| Error | 31.4 |
| Cost | 192 |
| Alternative 10 | |
|---|---|
| Error | 30.9 |
| Cost | 64 |
| Alternative 11 | |
|---|---|
| Error | 61.5 |
| Cost | 64 |
| Alternative 12 | |
|---|---|
| Error | 60.5 |
| Cost | 64 |
| Alternative 13 | |
|---|---|
| Error | 61.6 |
| Cost | 64 |

if x < -54864435368.9230728 or 117265524.414920762 < x Initial program 31.0
Taylor expanded around inf 0.0
Simplified0.0
if -54864435368.9230728 < x < 117265524.414920762Initial program 0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2021042
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1.0 (+ x (/ 1.0 x)))
(/ x (+ (* x x) 1.0)))