\frac{1}{x + 1} - \frac{1}{x - 1}
\frac{-2}{\mathsf{fma}\left(x, x, -1\right)}
(FPCore (x) :precision binary64 (- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))
(FPCore (x) :precision binary64 (/ -2.0 (fma x x -1.0)))
double code(double x) {
return (1.0 / (x + 1.0)) - (1.0 / (x - 1.0));
}
double code(double x) {
return -2.0 / fma(x, x, -1.0);
}



Bits error versus x
Initial program 14.7
Applied frac-sub_binary6414.0
Simplified13.9
Simplified13.9
Taylor expanded in x around 0 0.4
Final simplification0.4
herbie shell --seed 2022020
(FPCore (x)
:name "Asymptote A"
:precision binary64
(- (/ 1.0 (+ x 1.0)) (/ 1.0 (- x 1.0))))