\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -12032692145665368408206631501824 \lor \neg \left(x \le \frac{8271544473083267}{17592186044416}\right):\\
\;\;\;\;\frac{1}{x} + 1 \cdot \left(\frac{1}{{x}^{5}} - \frac{1}{{x}^{3}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{1}} \cdot \frac{x}{x \cdot x + 1}\\
\end{array}double f(double x) {
double r45993 = x;
double r45994 = r45993 * r45993;
double r45995 = 1.0;
double r45996 = r45994 + r45995;
double r45997 = r45993 / r45996;
return r45997;
}
double f(double x) {
double r45998 = x;
double r45999 = -1.2032692145665368e+31;
bool r46000 = r45998 <= r45999;
double r46001 = 8271544473083267.0;
double r46002 = 17592186044416.0;
double r46003 = r46001 / r46002;
bool r46004 = r45998 <= r46003;
double r46005 = !r46004;
bool r46006 = r46000 || r46005;
double r46007 = 1.0;
double r46008 = r46007 / r45998;
double r46009 = 1.0;
double r46010 = 5.0;
double r46011 = pow(r45998, r46010);
double r46012 = r46007 / r46011;
double r46013 = 3.0;
double r46014 = pow(r45998, r46013);
double r46015 = r46007 / r46014;
double r46016 = r46012 - r46015;
double r46017 = r46009 * r46016;
double r46018 = r46008 + r46017;
double r46019 = sqrt(r46007);
double r46020 = r46007 / r46019;
double r46021 = r45998 * r45998;
double r46022 = r46021 + r46009;
double r46023 = r45998 / r46022;
double r46024 = r46020 * r46023;
double r46025 = r46006 ? r46018 : r46024;
return r46025;
}




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
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 *-un-lft-identity0.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)))