\frac{1}{x + 1} - \frac{1}{x}\begin{array}{l}
\mathbf{if}\;\frac{1}{1 + x} - \frac{1}{x} \leq -23649614954.58966 \lor \neg \left(\frac{1}{1 + x} - \frac{1}{x} \leq 0\right):\\
\;\;\;\;\frac{1}{1 + x} - \frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;{x}^{-2} \cdot \left(\frac{1}{x} - 1\right) - \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)) -23649614954.58966)
(not (<= (- (/ 1.0 (+ 1.0 x)) (/ 1.0 x)) 0.0)))
(- (/ 1.0 (+ 1.0 x)) (/ 1.0 x))
(- (* (pow x -2.0) (- (/ 1.0 x) 1.0)) (/ 1.0 (pow x 4.0)))))double code(double x) {
return ((double) ((1.0 / ((double) (x + 1.0))) - (1.0 / x)));
}
double code(double x) {
double tmp;
if (((((double) ((1.0 / ((double) (1.0 + x))) - (1.0 / x))) <= -23649614954.58966) || !(((double) ((1.0 / ((double) (1.0 + x))) - (1.0 / x))) <= 0.0))) {
tmp = ((double) ((1.0 / ((double) (1.0 + x))) - (1.0 / x)));
} else {
tmp = ((double) (((double) (((double) pow(x, -2.0)) * ((double) ((1.0 / x) - 1.0)))) - (1.0 / ((double) pow(x, 4.0)))));
}
return tmp;
}



Bits error versus x
Results
if (- (/ 1.0 (+ x 1.0)) (/ 1.0 x)) < -23649614954.589661 or 0.0 < (- (/ 1.0 (+ x 1.0)) (/ 1.0 x)) Initial program Error: 0.0 bits
if -23649614954.589661 < (- (/ 1.0 (+ x 1.0)) (/ 1.0 x)) < 0.0Initial program Error: 27.8 bits
Taylor expanded around inf Error: 2.2 bits
SimplifiedError: 2.2 bits
rmApplied associate-/r*Error: 1.6 bits
rmApplied *-un-lft-identityError: 1.6 bits
Applied add-cube-cbrtError: 2.2 bits
Applied times-fracError: 2.2 bits
SimplifiedError: 2.2 bits
Taylor expanded around 0 Error: 2.2 bits
SimplifiedError: 1.5 bits
Final simplificationError: 0.8 bits
herbie shell --seed 2020204
(FPCore (x)
:name "2frac (problem 3.3.1)"
:precision binary64
(- (/ 1.0 (+ x 1.0)) (/ 1.0 x)))