\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -2777649326.315958 \lor \neg \left(x \le 50461.0592015108195\right):\\
\;\;\;\;\mathsf{fma}\left(1, \frac{1}{{x}^{5}}, \frac{1}{x} - 1 \cdot \frac{1}{{x}^{3}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x \cdot x + 1}\\
\end{array}double f(double x) {
double r74133 = x;
double r74134 = r74133 * r74133;
double r74135 = 1.0;
double r74136 = r74134 + r74135;
double r74137 = r74133 / r74136;
return r74137;
}
double f(double x) {
double r74138 = x;
double r74139 = -2777649326.315958;
bool r74140 = r74138 <= r74139;
double r74141 = 50461.05920151082;
bool r74142 = r74138 <= r74141;
double r74143 = !r74142;
bool r74144 = r74140 || r74143;
double r74145 = 1.0;
double r74146 = 1.0;
double r74147 = 5.0;
double r74148 = pow(r74138, r74147);
double r74149 = r74146 / r74148;
double r74150 = r74146 / r74138;
double r74151 = 3.0;
double r74152 = pow(r74138, r74151);
double r74153 = r74146 / r74152;
double r74154 = r74145 * r74153;
double r74155 = r74150 - r74154;
double r74156 = fma(r74145, r74149, r74155);
double r74157 = r74138 * r74138;
double r74158 = r74157 + r74145;
double r74159 = r74138 / r74158;
double r74160 = r74144 ? r74156 : r74159;
return r74160;
}




Bits error versus x
| Original | 15.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -2777649326.315958 or 50461.05920151082 < x Initial program 30.8
rmApplied div-inv30.8
Simplified30.8
Taylor expanded around inf 0.0
Simplified0.0
if -2777649326.315958 < x < 50461.05920151082Initial program 0.0
Final simplification0.0
herbie shell --seed 2020057 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))