\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -62379821099783.2109 \lor \neg \left(x \le 2168.52278018713832\right):\\
\;\;\;\;\left(\frac{1}{x} + \frac{1}{{x}^{5}}\right) - \frac{1}{{x}^{3}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{1}{\mathsf{fma}\left(x, x, 1\right)}\\
\end{array}double f(double x) {
double r83524 = x;
double r83525 = r83524 * r83524;
double r83526 = 1.0;
double r83527 = r83525 + r83526;
double r83528 = r83524 / r83527;
return r83528;
}
double f(double x) {
double r83529 = x;
double r83530 = -62379821099783.21;
bool r83531 = r83529 <= r83530;
double r83532 = 2168.5227801871383;
bool r83533 = r83529 <= r83532;
double r83534 = !r83533;
bool r83535 = r83531 || r83534;
double r83536 = 1.0;
double r83537 = r83536 / r83529;
double r83538 = 1.0;
double r83539 = 5.0;
double r83540 = pow(r83529, r83539);
double r83541 = r83538 / r83540;
double r83542 = r83537 + r83541;
double r83543 = 3.0;
double r83544 = pow(r83529, r83543);
double r83545 = r83538 / r83544;
double r83546 = r83542 - r83545;
double r83547 = fma(r83529, r83529, r83538);
double r83548 = r83536 / r83547;
double r83549 = r83529 * r83548;
double r83550 = r83535 ? r83546 : r83549;
return r83550;
}




Bits error versus x
| Original | 15.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -62379821099783.21 or 2168.5227801871383 < x Initial program 30.9
Simplified30.9
rmApplied div-inv31.0
rmApplied add-cube-cbrt31.4
Applied associate-*l*31.4
Simplified31.4
Taylor expanded around inf 0.0
Simplified0.0
if -62379821099783.21 < x < 2168.5227801871383Initial program 0.0
Simplified0.0
rmApplied div-inv0.0
Final simplification0.0
herbie shell --seed 2020047 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))