\frac{-\left(f + n\right)}{f - n}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{f + n}{n - f}\right)\right)
(FPCore (f n) :precision binary64 (/ (- (+ f n)) (- f n)))
(FPCore (f n) :precision binary64 (log1p (expm1 (/ (+ f n) (- n f)))))
double code(double f, double n) {
return -(f + n) / (f - n);
}
double code(double f, double n) {
return log1p(expm1((f + n) / (n - f)));
}



Bits error versus f



Bits error versus n
Results
Initial program 0.0
Simplified0.0
Applied log1p-expm1-u_binary640.0
Final simplification0.0
herbie shell --seed 2022019
(FPCore (f n)
:name "subtraction fraction"
:precision binary64
(/ (- (+ f n)) (- f n)))