\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -4.22741385849907756 \cdot 10^{28} \lor \neg \left(x \le 747.668589388476107\right):\\
\;\;\;\;\left(\frac{1}{x} - 1 \cdot \frac{1}{{x}^{3}}\right) + \frac{1}{{x}^{5}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x \cdot x + 1}\\
\end{array}double f(double x) {
double r64597 = x;
double r64598 = r64597 * r64597;
double r64599 = 1.0;
double r64600 = r64598 + r64599;
double r64601 = r64597 / r64600;
return r64601;
}
double f(double x) {
double r64602 = x;
double r64603 = -4.227413858499078e+28;
bool r64604 = r64602 <= r64603;
double r64605 = 747.6685893884761;
bool r64606 = r64602 <= r64605;
double r64607 = !r64606;
bool r64608 = r64604 || r64607;
double r64609 = 1.0;
double r64610 = r64609 / r64602;
double r64611 = 1.0;
double r64612 = 3.0;
double r64613 = pow(r64602, r64612);
double r64614 = r64609 / r64613;
double r64615 = r64611 * r64614;
double r64616 = r64610 - r64615;
double r64617 = 5.0;
double r64618 = pow(r64602, r64617);
double r64619 = r64611 / r64618;
double r64620 = r64616 + r64619;
double r64621 = r64602 * r64602;
double r64622 = r64621 + r64611;
double r64623 = r64602 / r64622;
double r64624 = r64608 ? r64620 : r64623;
return r64624;
}




Bits error versus x
Results
| Original | 15.2 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -4.227413858499078e+28 or 747.6685893884761 < x Initial program 31.3
rmApplied add-sqr-sqrt31.3
Applied associate-/r*31.2
Taylor expanded around inf 0.0
Simplified0.0
if -4.227413858499078e+28 < x < 747.6685893884761Initial program 0.0
Final simplification0.0
herbie shell --seed 2020025
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))