\frac{1}{x + 1} - \frac{1}{x - 1}\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\frac{1}{x + 1}}{x - 1}\right)\right) \cdot -2double f(double x) {
double r2542147 = 1.0;
double r2542148 = x;
double r2542149 = r2542148 + r2542147;
double r2542150 = r2542147 / r2542149;
double r2542151 = r2542148 - r2542147;
double r2542152 = r2542147 / r2542151;
double r2542153 = r2542150 - r2542152;
return r2542153;
}
double f(double x) {
double r2542154 = 1.0;
double r2542155 = x;
double r2542156 = r2542155 + r2542154;
double r2542157 = r2542154 / r2542156;
double r2542158 = r2542155 - r2542154;
double r2542159 = r2542157 / r2542158;
double r2542160 = expm1(r2542159);
double r2542161 = log1p(r2542160);
double r2542162 = -2.0;
double r2542163 = r2542161 * r2542162;
return r2542163;
}



Bits error versus x
Results
Initial program 14.5
rmApplied flip--29.3
Applied associate-/r/29.3
Applied flip-+14.5
Applied associate-/r/14.5
Applied distribute-lft-out--13.8
Taylor expanded around 0 0.4
rmApplied difference-of-squares0.4
Applied associate-/r*0.1
rmApplied log1p-expm1-u0.1
Final simplification0.1
herbie shell --seed 2019155 +o rules:numerics
(FPCore (x)
:name "Asymptote A"
(- (/ 1 (+ x 1)) (/ 1 (- x 1))))