-\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)
\begin{array}{l}
t_0 := \sqrt{\frac{4}{\pi}}\\
t_1 := f \cdot \frac{\pi}{4}\\
-t_0 \cdot \left(\log \left(\frac{\cosh t_1}{\sinh t_1}\right) \cdot t_0\right)
\end{array}
(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 (let* ((t_0 (sqrt (/ 4.0 PI))) (t_1 (* f (/ PI 4.0)))) (- (* t_0 (* (log (/ (cosh t_1) (sinh t_1))) t_0)))))
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) {
double t_0 = sqrt(4.0 / ((double) M_PI));
double t_1 = f * (((double) M_PI) / 4.0);
return -(t_0 * (log(cosh(t_1) / sinh(t_1)) * t_0));
}



Bits error versus f
Results
Initial program 61.7
rmApplied sinh-undef_binary641.9
Applied associate-/r*_binary641.9
Simplified1.9
rmApplied add-sqr-sqrt_binary642.2
Applied associate-*l*_binary641.8
Simplified1.8
rmApplied associate-*r*_binary641.8
Simplified1.8
Final simplification1.8
herbie shell --seed 2021202
(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)))))))))