\frac{1}{x + 1} - \frac{1}{x}-\frac{x - 1}{x} \cdot \frac{\frac{1}{x + 1}}{x - 1}double f(double x) {
double r2742584 = 1.0;
double r2742585 = x;
double r2742586 = r2742585 + r2742584;
double r2742587 = r2742584 / r2742586;
double r2742588 = r2742584 / r2742585;
double r2742589 = r2742587 - r2742588;
return r2742589;
}
double f(double x) {
double r2742590 = x;
double r2742591 = 1.0;
double r2742592 = r2742590 - r2742591;
double r2742593 = r2742592 / r2742590;
double r2742594 = r2742590 + r2742591;
double r2742595 = r2742591 / r2742594;
double r2742596 = r2742595 / r2742592;
double r2742597 = r2742593 * r2742596;
double r2742598 = -r2742597;
return r2742598;
}



Bits error versus x
Results
Initial program 14.8
rmApplied frac-sub14.2
Taylor expanded around 0 0.4
rmApplied associate-/r*0.1
rmApplied *-un-lft-identity0.1
Applied flip-+0.5
Applied associate-/r/0.5
Applied times-frac0.4
Simplified0.1
Final simplification0.1
herbie shell --seed 2019174 +o rules:numerics
(FPCore (x)
:name "2frac (problem 3.3.1)"
(- (/ 1.0 (+ x 1.0)) (/ 1.0 x)))