\left(\frac{1}{x + 1} - \frac{2}{x}\right) + \frac{1}{x - 1}\begin{array}{l}
\mathbf{if}\;x \le -94.31796734081924:\\
\;\;\;\;\frac{2}{{x}^{7}} + \left(\frac{2}{{x}^{3}} + \frac{2}{{x}^{5}}\right)\\
\mathbf{elif}\;x \le 89.72182339181649:\\
\;\;\;\;\mathsf{fma}\left(1, \frac{1}{\sqrt[3]{1 + x}} \cdot \frac{1}{\sqrt[3]{1 + x} \cdot \sqrt[3]{1 + x}}, -2 \cdot \frac{1}{x}\right) + \left(\frac{1}{x - 1} + \mathsf{fma}\left(-\frac{1}{x}, 2, 2 \cdot \frac{1}{x}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{{x}^{7}} + \left(\frac{2}{{x}^{3}} + \frac{2}{{x}^{5}}\right)\\
\end{array}double f(double x) {
double r2076404 = 1.0;
double r2076405 = x;
double r2076406 = r2076405 + r2076404;
double r2076407 = r2076404 / r2076406;
double r2076408 = 2.0;
double r2076409 = r2076408 / r2076405;
double r2076410 = r2076407 - r2076409;
double r2076411 = r2076405 - r2076404;
double r2076412 = r2076404 / r2076411;
double r2076413 = r2076410 + r2076412;
return r2076413;
}
double f(double x) {
double r2076414 = x;
double r2076415 = -94.31796734081924;
bool r2076416 = r2076414 <= r2076415;
double r2076417 = 2.0;
double r2076418 = 7.0;
double r2076419 = pow(r2076414, r2076418);
double r2076420 = r2076417 / r2076419;
double r2076421 = 3.0;
double r2076422 = pow(r2076414, r2076421);
double r2076423 = r2076417 / r2076422;
double r2076424 = 5.0;
double r2076425 = pow(r2076414, r2076424);
double r2076426 = r2076417 / r2076425;
double r2076427 = r2076423 + r2076426;
double r2076428 = r2076420 + r2076427;
double r2076429 = 89.72182339181649;
bool r2076430 = r2076414 <= r2076429;
double r2076431 = 1.0;
double r2076432 = r2076431 + r2076414;
double r2076433 = cbrt(r2076432);
double r2076434 = r2076431 / r2076433;
double r2076435 = r2076433 * r2076433;
double r2076436 = r2076431 / r2076435;
double r2076437 = r2076434 * r2076436;
double r2076438 = -2.0;
double r2076439 = r2076431 / r2076414;
double r2076440 = r2076438 * r2076439;
double r2076441 = fma(r2076431, r2076437, r2076440);
double r2076442 = r2076414 - r2076431;
double r2076443 = r2076431 / r2076442;
double r2076444 = -r2076439;
double r2076445 = r2076417 * r2076439;
double r2076446 = fma(r2076444, r2076417, r2076445);
double r2076447 = r2076443 + r2076446;
double r2076448 = r2076441 + r2076447;
double r2076449 = r2076430 ? r2076448 : r2076428;
double r2076450 = r2076416 ? r2076428 : r2076449;
return r2076450;
}




Bits error versus x
| Original | 9.6 |
|---|---|
| Target | 0.3 |
| Herbie | 0.3 |
if x < -94.31796734081924 or 89.72182339181649 < x Initial program 19.5
Taylor expanded around inf 0.5
Simplified0.5
rmApplied pow10.5
Applied pow10.5
Applied pow-prod-up0.5
Applied pow10.5
Applied pow-prod-up0.5
Simplified0.5
if -94.31796734081924 < x < 89.72182339181649Initial program 0.0
rmApplied div-inv0.0
Applied *-un-lft-identity0.0
Applied prod-diff0.0
Applied associate-+l+0.0
rmApplied add-cube-cbrt0.0
Applied add-sqr-sqrt0.0
Applied times-frac0.0
Final simplification0.3
herbie shell --seed 2019154 +o rules:numerics
(FPCore (x)
:name "3frac (problem 3.3.3)"
:herbie-target
(/ 2 (* x (- (* x x) 1)))
(+ (- (/ 1 (+ x 1)) (/ 2 x)) (/ 1 (- x 1))))