\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(1 \cdot \left(\frac{1}{{x}^{5}} - \frac{1}{{x}^{3}}\right) + \frac{1}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \frac{x}{x \cdot x + 1}\\
\end{array}double f(double x) {
double r67966 = x;
double r67967 = r67966 * r67966;
double r67968 = 1.0;
double r67969 = r67967 + r67968;
double r67970 = r67966 / r67969;
return r67970;
}
double f(double x) {
double r67971 = x;
double r67972 = -24215928678.961597;
bool r67973 = r67971 <= r67972;
double r67974 = 3500.8467687195057;
bool r67975 = r67971 <= r67974;
double r67976 = !r67975;
bool r67977 = r67973 || r67976;
double r67978 = 1.0;
double r67979 = 1.0;
double r67980 = 5.0;
double r67981 = pow(r67971, r67980);
double r67982 = r67978 / r67981;
double r67983 = 3.0;
double r67984 = pow(r67971, r67983);
double r67985 = r67978 / r67984;
double r67986 = r67982 - r67985;
double r67987 = r67979 * r67986;
double r67988 = r67978 / r67971;
double r67989 = r67987 + r67988;
double r67990 = r67978 * r67989;
double r67991 = r67971 * r67971;
double r67992 = r67991 + r67979;
double r67993 = r67971 / r67992;
double r67994 = r67978 * r67993;
double r67995 = r67977 ? r67990 : r67994;
return r67995;
}




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
rmApplied add-sqr-sqrt30.8
Applied associate-/r*30.7
rmApplied *-un-lft-identity30.7
Applied sqrt-prod30.7
Applied *-un-lft-identity30.7
Applied sqrt-prod30.7
Applied *-un-lft-identity30.7
Applied times-frac30.7
Applied times-frac30.7
Simplified30.7
Simplified30.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)))