\frac{1}{x + 1} - \frac{1}{x}\begin{array}{l}
\mathbf{if}\;\frac{1}{x + 1} - \frac{1}{x} \le -5.252123328811039127089581313168054066409 \cdot 10^{-17}:\\
\;\;\;\;\frac{1 \cdot x - 1 \cdot \left(x + 1\right)}{\left(x + 1\right) \cdot x}\\
\mathbf{elif}\;\frac{1}{x + 1} - \frac{1}{x} \le 0.0:\\
\;\;\;\;\frac{1}{\left(x \cdot x\right) \cdot x} - \mathsf{fma}\left(\frac{1}{x \cdot x}, \frac{1}{x \cdot x}, \frac{\frac{1}{x}}{x}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x + 1} - \frac{1}{x}\\
\end{array}double f(double x) {
double r3444258 = 1.0;
double r3444259 = x;
double r3444260 = r3444259 + r3444258;
double r3444261 = r3444258 / r3444260;
double r3444262 = r3444258 / r3444259;
double r3444263 = r3444261 - r3444262;
return r3444263;
}
double f(double x) {
double r3444264 = 1.0;
double r3444265 = x;
double r3444266 = r3444265 + r3444264;
double r3444267 = r3444264 / r3444266;
double r3444268 = r3444264 / r3444265;
double r3444269 = r3444267 - r3444268;
double r3444270 = -5.252123328811039e-17;
bool r3444271 = r3444269 <= r3444270;
double r3444272 = r3444264 * r3444265;
double r3444273 = r3444264 * r3444266;
double r3444274 = r3444272 - r3444273;
double r3444275 = r3444266 * r3444265;
double r3444276 = r3444274 / r3444275;
double r3444277 = 0.0;
bool r3444278 = r3444269 <= r3444277;
double r3444279 = r3444265 * r3444265;
double r3444280 = r3444279 * r3444265;
double r3444281 = r3444264 / r3444280;
double r3444282 = r3444264 / r3444279;
double r3444283 = 1.0;
double r3444284 = r3444283 / r3444279;
double r3444285 = r3444268 / r3444265;
double r3444286 = fma(r3444282, r3444284, r3444285);
double r3444287 = r3444281 - r3444286;
double r3444288 = r3444278 ? r3444287 : r3444269;
double r3444289 = r3444271 ? r3444276 : r3444288;
return r3444289;
}



Bits error versus x
if (- (/ 1.0 (+ x 1.0)) (/ 1.0 x)) < -5.252123328811039e-17Initial program 0.6
rmApplied frac-sub0.0
if -5.252123328811039e-17 < (- (/ 1.0 (+ x 1.0)) (/ 1.0 x)) < 0.0Initial program 29.0
rmApplied frac-sub28.0
rmApplied div-sub29.0
Simplified59.5
Simplified29.0
Taylor expanded around inf 0.8
Simplified0.8
rmApplied associate-/r*0.1
if 0.0 < (- (/ 1.0 (+ x 1.0)) (/ 1.0 x)) Initial program 0.0
rmApplied frac-sub0.0
rmApplied div-sub0.0
Simplified0.0
Simplified0.0
Final simplification0.1
herbie shell --seed 2019170 +o rules:numerics
(FPCore (x)
:name "2frac (problem 3.3.1)"
(- (/ 1.0 (+ x 1.0)) (/ 1.0 x)))