\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -64270072.71622894704341888427734375 \lor \neg \left(x \le 454.9257941514320577880425844341516494751\right):\\
\;\;\;\;\frac{1}{{x}^{5}} + \left(\frac{1}{x} - \frac{1}{{x}^{3}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{{x}^{6} + {1}^{3}} \cdot \left(\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(1 \cdot 1 - \left(x \cdot x\right) \cdot 1\right)\right)\\
\end{array}double f(double x) {
double r100310 = x;
double r100311 = r100310 * r100310;
double r100312 = 1.0;
double r100313 = r100311 + r100312;
double r100314 = r100310 / r100313;
return r100314;
}
double f(double x) {
double r100315 = x;
double r100316 = -64270072.71622895;
bool r100317 = r100315 <= r100316;
double r100318 = 454.92579415143206;
bool r100319 = r100315 <= r100318;
double r100320 = !r100319;
bool r100321 = r100317 || r100320;
double r100322 = 1.0;
double r100323 = 5.0;
double r100324 = pow(r100315, r100323);
double r100325 = r100322 / r100324;
double r100326 = 1.0;
double r100327 = r100326 / r100315;
double r100328 = 3.0;
double r100329 = pow(r100315, r100328);
double r100330 = r100322 / r100329;
double r100331 = r100327 - r100330;
double r100332 = r100325 + r100331;
double r100333 = 6.0;
double r100334 = pow(r100315, r100333);
double r100335 = pow(r100322, r100328);
double r100336 = r100334 + r100335;
double r100337 = r100315 / r100336;
double r100338 = r100315 * r100315;
double r100339 = r100338 * r100338;
double r100340 = r100322 * r100322;
double r100341 = r100338 * r100322;
double r100342 = r100340 - r100341;
double r100343 = r100339 + r100342;
double r100344 = r100337 * r100343;
double r100345 = r100321 ? r100332 : r100344;
return r100345;
}




Bits error versus x
Results
| Original | 15.4 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -64270072.71622895 or 454.92579415143206 < x Initial program 31.2
rmApplied add-sqr-sqrt31.2
Applied *-un-lft-identity31.2
Applied times-frac31.1
Simplified31.1
Simplified31.1
Taylor expanded around inf 0.0
Simplified0.0
if -64270072.71622895 < x < 454.92579415143206Initial program 0.0
rmApplied flip3-+0.0
Applied associate-/r/0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019212 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))