\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -1289.378311905943519377615302801132202148 \lor \neg \left(x \le 1795596.18567813746631145477294921875\right):\\
\;\;\;\;\left(\frac{1}{x} + \frac{1}{{x}^{5}}\right) - \frac{1}{{x}^{3}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{{x}^{4} - 1 \cdot 1} \cdot \left(x \cdot x - 1\right)\\
\end{array}double f(double x) {
double r55113 = x;
double r55114 = r55113 * r55113;
double r55115 = 1.0;
double r55116 = r55114 + r55115;
double r55117 = r55113 / r55116;
return r55117;
}
double f(double x) {
double r55118 = x;
double r55119 = -1289.3783119059435;
bool r55120 = r55118 <= r55119;
double r55121 = 1795596.1856781375;
bool r55122 = r55118 <= r55121;
double r55123 = !r55122;
bool r55124 = r55120 || r55123;
double r55125 = 1.0;
double r55126 = r55125 / r55118;
double r55127 = 1.0;
double r55128 = 5.0;
double r55129 = pow(r55118, r55128);
double r55130 = r55127 / r55129;
double r55131 = r55126 + r55130;
double r55132 = 3.0;
double r55133 = pow(r55118, r55132);
double r55134 = r55127 / r55133;
double r55135 = r55131 - r55134;
double r55136 = 4.0;
double r55137 = pow(r55118, r55136);
double r55138 = r55127 * r55127;
double r55139 = r55137 - r55138;
double r55140 = r55118 / r55139;
double r55141 = r55118 * r55118;
double r55142 = r55141 - r55127;
double r55143 = r55140 * r55142;
double r55144 = r55124 ? r55135 : r55143;
return r55144;
}




Bits error versus x
Results
| Original | 15.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -1289.3783119059435 or 1795596.1856781375 < x Initial program 31.2
rmApplied flip-+48.9
Applied associate-/r/48.9
Simplified48.9
Taylor expanded around inf 0.0
Simplified0.0
if -1289.3783119059435 < x < 1795596.1856781375Initial program 0.0
rmApplied flip-+0.0
Applied associate-/r/0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019347
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))