\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -24215928678.961597442626953125 \lor \neg \left(x \le 3500.846768719505689659854397177696228027\right):\\
\;\;\;\;1 \cdot \left(\frac{1}{{x}^{5}} - \frac{1}{{x}^{3}}\right) + \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \frac{x}{x \cdot x + 1}\\
\end{array}double f(double x) {
double r73461 = x;
double r73462 = r73461 * r73461;
double r73463 = 1.0;
double r73464 = r73462 + r73463;
double r73465 = r73461 / r73464;
return r73465;
}
double f(double x) {
double r73466 = x;
double r73467 = -24215928678.961597;
bool r73468 = r73466 <= r73467;
double r73469 = 3500.8467687195057;
bool r73470 = r73466 <= r73469;
double r73471 = !r73470;
bool r73472 = r73468 || r73471;
double r73473 = 1.0;
double r73474 = 1.0;
double r73475 = 5.0;
double r73476 = pow(r73466, r73475);
double r73477 = r73474 / r73476;
double r73478 = 3.0;
double r73479 = pow(r73466, r73478);
double r73480 = r73474 / r73479;
double r73481 = r73477 - r73480;
double r73482 = r73473 * r73481;
double r73483 = r73474 / r73466;
double r73484 = r73482 + r73483;
double r73485 = r73466 * r73466;
double r73486 = r73485 + r73473;
double r73487 = r73466 / r73486;
double r73488 = r73474 * r73487;
double r73489 = r73472 ? r73484 : r73488;
return r73489;
}




Bits error versus x
Results
| Original | 15.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -24215928678.961597 or 3500.8467687195057 < x Initial program 30.8
Taylor expanded around inf 0.0
Simplified0.0
if -24215928678.961597 < x < 3500.8467687195057Initial program 0.0
rmApplied add-sqr-sqrt0.0
Applied associate-/r*0.0
rmApplied *-un-lft-identity0.0
Applied sqrt-prod0.0
Applied *-un-lft-identity0.0
Applied sqrt-prod0.0
Applied *-un-lft-identity0.0
Applied times-frac0.0
Applied times-frac0.0
Simplified0.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)))