\frac{1}{x + 1} - \frac{1}{x}\begin{array}{l}
\mathbf{if}\;\frac{1}{1 + x} - \frac{1}{x} \leq -14019661722.627342 \lor \neg \left(\frac{1}{1 + x} - \frac{1}{x} \leq 0\right):\\
\;\;\;\;\frac{1}{1 + x} - \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\frac{1}{x} + -1}{x}}{x} + \frac{-1}{{x}^{4}}\\
\end{array}(FPCore (x) :precision binary64 (- (/ 1.0 (+ x 1.0)) (/ 1.0 x)))
(FPCore (x)
:precision binary64
(if (or (<= (- (/ 1.0 (+ 1.0 x)) (/ 1.0 x)) -14019661722.627342)
(not (<= (- (/ 1.0 (+ 1.0 x)) (/ 1.0 x)) 0.0)))
(- (/ 1.0 (+ 1.0 x)) (/ 1.0 x))
(+ (/ (/ (+ (/ 1.0 x) -1.0) x) x) (/ -1.0 (pow x 4.0)))))double code(double x) {
return (1.0 / (x + 1.0)) - (1.0 / x);
}
double code(double x) {
double tmp;
if ((((1.0 / (1.0 + x)) - (1.0 / x)) <= -14019661722.627342) || !(((1.0 / (1.0 + x)) - (1.0 / x)) <= 0.0)) {
tmp = (1.0 / (1.0 + x)) - (1.0 / x);
} else {
tmp = ((((1.0 / x) + -1.0) / x) / x) + (-1.0 / pow(x, 4.0));
}
return tmp;
}



Bits error versus x
Results
if (-.f64 (/.f64 1 (+.f64 x 1)) (/.f64 1 x)) < -14019661722.627342 or 0.0 < (-.f64 (/.f64 1 (+.f64 x 1)) (/.f64 1 x)) Initial program 0.0
if -14019661722.627342 < (-.f64 (/.f64 1 (+.f64 x 1)) (/.f64 1 x)) < 0.0Initial program 27.6
Taylor expanded around inf 2.0
Simplified2.0
rmApplied associate-/r*_binary641.4
Final simplification0.7
herbie shell --seed 2020224
(FPCore (x)
:name "2frac (problem 3.3.1)"
:precision binary64
(- (/ 1.0 (+ x 1.0)) (/ 1.0 x)))