\frac{x}{x + 1} - \frac{x + 1}{x - 1}\frac{-1}{x \cdot x - 1 \cdot 1} - \frac{x}{1 + x} \cdot \frac{3}{x - 1}double code(double x) {
return ((double) ((x / ((double) (x + 1.0))) - (((double) (x + 1.0)) / ((double) (x - 1.0)))));
}
double code(double x) {
return ((double) ((((double) -(1.0)) / ((double) (((double) (x * x)) - ((double) (1.0 * 1.0))))) - ((double) ((x / ((double) (1.0 + x))) * (3.0 / ((double) (x - 1.0)))))));
}



Bits error versus x
Results
Initial program Error: 29.3 bits
rmApplied frac-subError: 30.4 bits
SimplifiedError: 30.4 bits
Taylor expanded around 0 Error: 14.7 bits
SimplifiedError: 14.7 bits
rmApplied div-subError: 14.7 bits
SimplifiedError: 0.0 bits
Final simplificationError: 0.0 bits
herbie shell --seed 2020200
(FPCore (x)
:name "Asymptote C"
:precision binary64
(- (/ x (+ x 1.0)) (/ (+ x 1.0) (- x 1.0))))