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




Bits error versus x
Results
| Original | 15.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -128910779844.2735 or 407.785094800499166 < x Initial program 31.3
Taylor expanded around inf 0.0
Simplified0.0
if -128910779844.2735 < x < 407.785094800499166Initial program 0.0
rmApplied flip3-+0.0
Applied associate-/r/0.0
Final simplification0.0
herbie shell --seed 2020175
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1.0 (+ x (/ 1.0 x)))
(/ x (+ (* x x) 1.0)))