-\frac{1}{\frac{\pi}{4}} \cdot \log \left(\frac{e^{\frac{\pi}{4} \cdot f} + e^{-\frac{\pi}{4} \cdot f}}{e^{\frac{\pi}{4} \cdot f} - e^{-\frac{\pi}{4} \cdot f}}\right)-4 \cdot \frac{\log \left(\frac{f}{\frac{4}{\pi}}\right)}{-\pi}(FPCore (f)
:precision binary64
(-
(*
(/ 1.0 (/ PI 4.0))
(log
(/
(+ (exp (* (/ PI 4.0) f)) (exp (- (* (/ PI 4.0) f))))
(- (exp (* (/ PI 4.0) f)) (exp (- (* (/ PI 4.0) f)))))))))(FPCore (f) :precision binary64 (* -4.0 (/ (log (/ f (/ 4.0 PI))) (- PI))))
double code(double f) {
return -((1.0 / (((double) M_PI) / 4.0)) * log((exp((((double) M_PI) / 4.0) * f) + exp(-((((double) M_PI) / 4.0) * f))) / (exp((((double) M_PI) / 4.0) * f) - exp(-((((double) M_PI) / 4.0) * f)))));
}
double code(double f) {
return -4.0 * (log(f / (4.0 / ((double) M_PI))) / -((double) M_PI));
}



Bits error versus f
Results
Initial program 61.5
Simplified61.5
Taylor expanded around 0 2.8
Simplified2.8
Taylor expanded around 0 2.6
Simplified2.7
rmApplied frac-2neg_binary642.7
Simplified2.6
rmApplied diff-log_binary642.6
Final simplification2.6
herbie shell --seed 2021015
(FPCore (f)
:name "VandenBroeck and Keller, Equation (20)"
:precision binary64
(- (* (/ 1.0 (/ PI 4.0)) (log (/ (+ (exp (* (/ PI 4.0) f)) (exp (- (* (/ PI 4.0) f)))) (- (exp (* (/ PI 4.0) f)) (exp (- (* (/ PI 4.0) f)))))))))