\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -361128223798.23687744140625 \lor \neg \left(x \le 422.2996736029814428547979332506656646729\right):\\
\;\;\;\;\frac{1}{x} + \left(\frac{1}{{x}^{5}} - \frac{1}{{x}^{3}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x \cdot x + 1}\\
\end{array}double f(double x) {
double r64751 = x;
double r64752 = r64751 * r64751;
double r64753 = 1.0;
double r64754 = r64752 + r64753;
double r64755 = r64751 / r64754;
return r64755;
}
double f(double x) {
double r64756 = x;
double r64757 = -361128223798.2369;
bool r64758 = r64756 <= r64757;
double r64759 = 422.29967360298144;
bool r64760 = r64756 <= r64759;
double r64761 = !r64760;
bool r64762 = r64758 || r64761;
double r64763 = 1.0;
double r64764 = r64763 / r64756;
double r64765 = 1.0;
double r64766 = 5.0;
double r64767 = pow(r64756, r64766);
double r64768 = r64765 / r64767;
double r64769 = 3.0;
double r64770 = pow(r64756, r64769);
double r64771 = r64765 / r64770;
double r64772 = r64768 - r64771;
double r64773 = r64764 + r64772;
double r64774 = r64756 * r64756;
double r64775 = r64774 + r64765;
double r64776 = r64756 / r64775;
double r64777 = r64762 ? r64773 : r64776;
return r64777;
}




Bits error versus x
Results
| Original | 15.5 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -361128223798.2369 or 422.29967360298144 < x Initial program 31.0
rmApplied flip-+49.1
Applied associate-/r/49.1
Simplified49.1
Taylor expanded around inf 0.0
Simplified0.0
if -361128223798.2369 < x < 422.29967360298144Initial program 0.0
Final simplification0.0
herbie shell --seed 2020002 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))