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



Bits error versus f



Bits error versus n
Results
Initial program 0.0
Simplified0.0
rmApplied add-log-exp_binary640.0
Simplified0.0
Final simplification0.0
herbie shell --seed 2020231
(FPCore (f n)
:name "subtraction fraction"
:precision binary64
(/ (- (+ f n)) (- f n)))