\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -1.01915671757898777 \cdot 10^{31} \lor \neg \left(x \le 7097.135133098112\right):\\
\;\;\;\;{\left(\mathsf{fma}\left(1, \frac{1}{{x}^{5}}, \frac{1}{x} - 1 \cdot \frac{1}{{x}^{3}}\right)\right)}^{1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sqrt{x \cdot x + 1}} \cdot \frac{x}{\frac{\mathsf{hypot}\left({1}^{\frac{3}{2}}, {x}^{3}\right)}{\sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(1 \cdot 1 - \left(x \cdot x\right) \cdot 1\right)}}}\\
\end{array}double f(double x) {
double r89346 = x;
double r89347 = r89346 * r89346;
double r89348 = 1.0;
double r89349 = r89347 + r89348;
double r89350 = r89346 / r89349;
return r89350;
}
double f(double x) {
double r89351 = x;
double r89352 = -1.0191567175789878e+31;
bool r89353 = r89351 <= r89352;
double r89354 = 7097.135133098112;
bool r89355 = r89351 <= r89354;
double r89356 = !r89355;
bool r89357 = r89353 || r89356;
double r89358 = 1.0;
double r89359 = 1.0;
double r89360 = 5.0;
double r89361 = pow(r89351, r89360);
double r89362 = r89359 / r89361;
double r89363 = r89359 / r89351;
double r89364 = 3.0;
double r89365 = pow(r89351, r89364);
double r89366 = r89359 / r89365;
double r89367 = r89358 * r89366;
double r89368 = r89363 - r89367;
double r89369 = fma(r89358, r89362, r89368);
double r89370 = pow(r89369, r89359);
double r89371 = r89351 * r89351;
double r89372 = r89371 + r89358;
double r89373 = sqrt(r89372);
double r89374 = r89359 / r89373;
double r89375 = 1.5;
double r89376 = pow(r89358, r89375);
double r89377 = hypot(r89376, r89365);
double r89378 = r89371 * r89371;
double r89379 = r89358 * r89358;
double r89380 = r89371 * r89358;
double r89381 = r89379 - r89380;
double r89382 = r89378 + r89381;
double r89383 = sqrt(r89382);
double r89384 = r89377 / r89383;
double r89385 = r89351 / r89384;
double r89386 = r89374 * r89385;
double r89387 = r89357 ? r89370 : r89386;
return r89387;
}




Bits error versus x
| Original | 15.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -1.0191567175789878e+31 or 7097.135133098112 < x Initial program 32.4
rmApplied add-sqr-sqrt32.4
Applied *-un-lft-identity32.4
Applied times-frac32.3
rmApplied pow132.3
Taylor expanded around inf 0.0
Simplified0.0
if -1.0191567175789878e+31 < x < 7097.135133098112Initial program 0.0
rmApplied add-sqr-sqrt0.0
Applied *-un-lft-identity0.0
Applied times-frac0.0
rmApplied flip3-+0.0
Applied sqrt-div0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020024 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))