\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -24215928678.961597442626953125 \lor \neg \left(x \le 3853.575133649498638988006860017776489258\right):\\
\;\;\;\;\left(\frac{1}{x} - 1 \cdot \frac{1}{{x}^{3}}\right) + \frac{1}{{x}^{5}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x \cdot x + 1}\\
\end{array}double f(double x) {
double r67391 = x;
double r67392 = r67391 * r67391;
double r67393 = 1.0;
double r67394 = r67392 + r67393;
double r67395 = r67391 / r67394;
return r67395;
}
double f(double x) {
double r67396 = x;
double r67397 = -24215928678.961597;
bool r67398 = r67396 <= r67397;
double r67399 = 3853.5751336494986;
bool r67400 = r67396 <= r67399;
double r67401 = !r67400;
bool r67402 = r67398 || r67401;
double r67403 = 1.0;
double r67404 = r67403 / r67396;
double r67405 = 1.0;
double r67406 = 3.0;
double r67407 = pow(r67396, r67406);
double r67408 = r67403 / r67407;
double r67409 = r67405 * r67408;
double r67410 = r67404 - r67409;
double r67411 = 5.0;
double r67412 = pow(r67396, r67411);
double r67413 = r67405 / r67412;
double r67414 = r67410 + r67413;
double r67415 = r67396 * r67396;
double r67416 = r67415 + r67405;
double r67417 = r67396 / r67416;
double r67418 = r67402 ? r67414 : r67417;
return r67418;
}




Bits error versus x
Results
| Original | 15.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -24215928678.961597 or 3853.5751336494986 < x Initial program 30.8
rmApplied add-sqr-sqrt30.8
Applied associate-/r*30.7
Taylor expanded around inf 0.0
Simplified0.0
if -24215928678.961597 < x < 3853.5751336494986Initial program 0.0
rmApplied add-sqr-sqrt0.0
Applied associate-/r*0.0
rmApplied div-inv0.0
Applied associate-/l*0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020001
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))