\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -34917646116603.26953125 \lor \neg \left(x \le 14991943.2062681615352630615234375\right):\\
\;\;\;\;\frac{1}{x} + \left(\frac{1}{{x}^{5}} - \frac{1}{{x}^{3}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x \cdot x + 1}\\
\end{array}double f(double x) {
double r109435 = x;
double r109436 = r109435 * r109435;
double r109437 = 1.0;
double r109438 = r109436 + r109437;
double r109439 = r109435 / r109438;
return r109439;
}
double f(double x) {
double r109440 = x;
double r109441 = -34917646116603.27;
bool r109442 = r109440 <= r109441;
double r109443 = 14991943.206268162;
bool r109444 = r109440 <= r109443;
double r109445 = !r109444;
bool r109446 = r109442 || r109445;
double r109447 = 1.0;
double r109448 = r109447 / r109440;
double r109449 = 1.0;
double r109450 = 5.0;
double r109451 = pow(r109440, r109450);
double r109452 = r109449 / r109451;
double r109453 = 3.0;
double r109454 = pow(r109440, r109453);
double r109455 = r109449 / r109454;
double r109456 = r109452 - r109455;
double r109457 = r109448 + r109456;
double r109458 = r109440 * r109440;
double r109459 = r109458 + r109449;
double r109460 = r109440 / r109459;
double r109461 = r109446 ? r109457 : r109460;
return r109461;
}




Bits error versus x
Results
| Original | 14.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -34917646116603.27 or 14991943.206268162 < x Initial program 30.7
rmApplied flip-+48.9
Applied associate-/r/49.0
Simplified49.0
Taylor expanded around inf 0.0
Simplified0.0
if -34917646116603.27 < x < 14991943.206268162Initial program 0.0
Final simplification0.0
herbie shell --seed 2019362 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))