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



Bits error versus f



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