\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 r54343 = x;
double r54344 = r54343 * r54343;
double r54345 = 1.0;
double r54346 = r54344 + r54345;
double r54347 = r54343 / r54346;
return r54347;
}
double f(double x) {
double r54348 = x;
double r54349 = -62379821099783.21;
bool r54350 = r54348 <= r54349;
double r54351 = 2168.5227801871383;
bool r54352 = r54348 <= r54351;
double r54353 = !r54352;
bool r54354 = r54350 || r54353;
double r54355 = 1.0;
double r54356 = r54355 / r54348;
double r54357 = 1.0;
double r54358 = 5.0;
double r54359 = pow(r54348, r54358);
double r54360 = r54357 / r54359;
double r54361 = r54356 + r54360;
double r54362 = 3.0;
double r54363 = pow(r54348, r54362);
double r54364 = r54357 / r54363;
double r54365 = r54361 - r54364;
double r54366 = fma(r54348, r54348, r54357);
double r54367 = r54355 / r54366;
double r54368 = r54348 * r54367;
double r54369 = r54354 ? r54365 : r54368;
return r54369;
}




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 *-un-lft-identity30.9
Applied add-cube-cbrt31.4
Applied times-frac31.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)))