\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -12032692145665368408206631501824 \lor \neg \left(x \le 470.1828671092736726677685510367155075073\right):\\
\;\;\;\;\left(\frac{1}{{x}^{5}} + \frac{1}{x}\right) - \frac{1}{{x}^{3}}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \frac{x}{x \cdot x + 1}\\
\end{array}double f(double x) {
double r42390 = x;
double r42391 = r42390 * r42390;
double r42392 = 1.0;
double r42393 = r42391 + r42392;
double r42394 = r42390 / r42393;
return r42394;
}
double f(double x) {
double r42395 = x;
double r42396 = -1.2032692145665368e+31;
bool r42397 = r42395 <= r42396;
double r42398 = 470.1828671092737;
bool r42399 = r42395 <= r42398;
double r42400 = !r42399;
bool r42401 = r42397 || r42400;
double r42402 = 1.0;
double r42403 = 5.0;
double r42404 = pow(r42395, r42403);
double r42405 = r42402 / r42404;
double r42406 = 1.0;
double r42407 = r42406 / r42395;
double r42408 = r42405 + r42407;
double r42409 = 3.0;
double r42410 = pow(r42395, r42409);
double r42411 = r42402 / r42410;
double r42412 = r42408 - r42411;
double r42413 = r42395 * r42395;
double r42414 = r42413 + r42402;
double r42415 = r42395 / r42414;
double r42416 = r42406 * r42415;
double r42417 = r42401 ? r42412 : r42416;
return r42417;
}




Bits error versus x
Results
| Original | 14.8 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -1.2032692145665368e+31 or 470.1828671092737 < x Initial program 31.6
rmApplied add-sqr-sqrt31.7
Applied *-un-lft-identity31.7
Applied times-frac31.5
Taylor expanded around inf 0.0
Simplified0.0
if -1.2032692145665368e+31 < x < 470.1828671092737Initial program 0.0
rmApplied add-sqr-sqrt0.0
Applied *-un-lft-identity0.0
Applied times-frac0.0
rmApplied *-un-lft-identity0.0
Applied sqrt-prod0.0
Applied add-cube-cbrt0.0
Applied times-frac0.0
Applied associate-*l*0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019304
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))