\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -1117.275627842930816768785007297992706299:\\
\;\;\;\;\frac{1}{x} - \left(\frac{1}{x \cdot \left(x \cdot x\right)} - \frac{1}{{x}^{5}}\right)\\
\mathbf{elif}\;x \le 207140092.4427032172679901123046875:\\
\;\;\;\;\left(1 - x \cdot x\right) \cdot \frac{x}{\left(1 + x \cdot x\right) \cdot \left(1 - x \cdot x\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x} - \left(\frac{1}{x \cdot \left(x \cdot x\right)} - \frac{1}{{x}^{5}}\right)\\
\end{array}double f(double x) {
double r3479118 = x;
double r3479119 = r3479118 * r3479118;
double r3479120 = 1.0;
double r3479121 = r3479119 + r3479120;
double r3479122 = r3479118 / r3479121;
return r3479122;
}
double f(double x) {
double r3479123 = x;
double r3479124 = -1117.2756278429308;
bool r3479125 = r3479123 <= r3479124;
double r3479126 = 1.0;
double r3479127 = r3479126 / r3479123;
double r3479128 = 1.0;
double r3479129 = r3479123 * r3479123;
double r3479130 = r3479123 * r3479129;
double r3479131 = r3479128 / r3479130;
double r3479132 = 5.0;
double r3479133 = pow(r3479123, r3479132);
double r3479134 = r3479128 / r3479133;
double r3479135 = r3479131 - r3479134;
double r3479136 = r3479127 - r3479135;
double r3479137 = 207140092.44270322;
bool r3479138 = r3479123 <= r3479137;
double r3479139 = r3479128 - r3479129;
double r3479140 = r3479128 + r3479129;
double r3479141 = r3479140 * r3479139;
double r3479142 = r3479123 / r3479141;
double r3479143 = r3479139 * r3479142;
double r3479144 = r3479138 ? r3479143 : r3479136;
double r3479145 = r3479125 ? r3479136 : r3479144;
return r3479145;
}




Bits error versus x
Results
| Original | 15.3 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -1117.2756278429308 or 207140092.44270322 < x Initial program 30.9
Taylor expanded around inf 0.0
Simplified0.0
if -1117.2756278429308 < x < 207140092.44270322Initial program 0.0
rmApplied add-sqr-sqrt0.0
Applied associate-/r*0.0
rmApplied *-un-lft-identity0.0
Applied sqrt-prod0.0
Applied div-inv0.0
Applied times-frac0.0
Simplified0.0
Simplified0.0
rmApplied flip-+0.0
Applied associate-/r/0.0
Applied associate-*r*0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2019170
(FPCore (x)
:name "x / (x^2 + 1)"
:herbie-target
(/ 1.0 (+ x (/ 1.0 x)))
(/ x (+ (* x x) 1.0)))