\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;\frac{x}{x \cdot x + 1} \le -8.305525141653350098708202002602406887923 \cdot 10^{-306} \lor \neg \left(\frac{x}{x \cdot x + 1} \le -0.0\right):\\
\;\;\;\;\frac{\frac{x}{\sqrt{x \cdot x + 1}}}{\sqrt{x \cdot x + 1}}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\frac{1}{{x}^{5}} - \frac{1}{{x}^{3}}\right) + \frac{1}{x}\\
\end{array}double f(double x) {
double r37457 = x;
double r37458 = r37457 * r37457;
double r37459 = 1.0;
double r37460 = r37458 + r37459;
double r37461 = r37457 / r37460;
return r37461;
}
double f(double x) {
double r37462 = x;
double r37463 = r37462 * r37462;
double r37464 = 1.0;
double r37465 = r37463 + r37464;
double r37466 = r37462 / r37465;
double r37467 = -8.30552514165335e-306;
bool r37468 = r37466 <= r37467;
double r37469 = -0.0;
bool r37470 = r37466 <= r37469;
double r37471 = !r37470;
bool r37472 = r37468 || r37471;
double r37473 = sqrt(r37465);
double r37474 = r37462 / r37473;
double r37475 = r37474 / r37473;
double r37476 = 1.0;
double r37477 = 5.0;
double r37478 = pow(r37462, r37477);
double r37479 = r37476 / r37478;
double r37480 = 3.0;
double r37481 = pow(r37462, r37480);
double r37482 = r37476 / r37481;
double r37483 = r37479 - r37482;
double r37484 = r37464 * r37483;
double r37485 = r37476 / r37462;
double r37486 = r37484 + r37485;
double r37487 = r37472 ? r37475 : r37486;
return r37487;
}




Bits error versus x
Results
| Original | 15.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
if (/ x (+ (* x x) 1.0)) < -8.30552514165335e-306 or -0.0 < (/ x (+ (* x x) 1.0)) Initial program 8.8
rmApplied add-sqr-sqrt8.9
Applied associate-/r*8.8
if -8.30552514165335e-306 < (/ x (+ (* x x) 1.0)) < -0.0Initial program 57.9
Taylor expanded around inf 1.7
Simplified1.7
Final simplification0.2
herbie shell --seed 2019291
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))