\frac{x}{x \cdot x + 1}\begin{array}{l}
\mathbf{if}\;x \le -3787.2690012206258 \lor \neg \left(x \le 19.9196551064145986\right):\\
\;\;\;\;\mathsf{fma}\left(1, \frac{1}{{x}^{9}}, \mathsf{fma}\left(1, \frac{1}{{x}^{5}}, \frac{1}{x}\right)\right) + \frac{x}{\mathsf{fma}\left(-1, 1, {x}^{4}\right)} \cdot \left(-1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\mathsf{fma}\left(-1, 1, {x}^{4}\right)} \cdot \left(x \cdot x - 1\right)\\
\end{array}double f(double x) {
double r61019 = x;
double r61020 = r61019 * r61019;
double r61021 = 1.0;
double r61022 = r61020 + r61021;
double r61023 = r61019 / r61022;
return r61023;
}
double f(double x) {
double r61024 = x;
double r61025 = -3787.269001220626;
bool r61026 = r61024 <= r61025;
double r61027 = 19.9196551064146;
bool r61028 = r61024 <= r61027;
double r61029 = !r61028;
bool r61030 = r61026 || r61029;
double r61031 = 1.0;
double r61032 = 1.0;
double r61033 = 9.0;
double r61034 = pow(r61024, r61033);
double r61035 = r61032 / r61034;
double r61036 = 5.0;
double r61037 = pow(r61024, r61036);
double r61038 = r61032 / r61037;
double r61039 = r61032 / r61024;
double r61040 = fma(r61031, r61038, r61039);
double r61041 = fma(r61031, r61035, r61040);
double r61042 = -r61031;
double r61043 = 4.0;
double r61044 = pow(r61024, r61043);
double r61045 = fma(r61042, r61031, r61044);
double r61046 = r61024 / r61045;
double r61047 = r61046 * r61042;
double r61048 = r61041 + r61047;
double r61049 = r61024 * r61024;
double r61050 = r61049 - r61031;
double r61051 = r61046 * r61050;
double r61052 = r61030 ? r61048 : r61051;
return r61052;
}




Bits error versus x
| Original | 14.7 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
if x < -3787.269001220626 or 19.9196551064146 < x Initial program 29.7
rmApplied flip-+47.0
Applied associate-/r/47.1
Simplified47.1
rmApplied sub-neg47.1
Applied distribute-lft-in47.1
Simplified47.5
Taylor expanded around inf 0.0
Simplified0.0
if -3787.269001220626 < x < 19.9196551064146Initial program 0.0
rmApplied flip-+0.0
Applied associate-/r/0.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020027 +o rules:numerics
(FPCore (x)
:name "x / (x^2 + 1)"
:precision binary64
:herbie-target
(/ 1 (+ x (/ 1 x)))
(/ x (+ (* x x) 1)))