-\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 := f \cdot \frac{\pi}{4}\\
t_1 := \sqrt{e^{t_0} + e^{-t_0}}\\
\frac{\log \left(\frac{t_1}{\sinh t_0}\right)}{\pi} \cdot -4 - \frac{4}{\pi} \cdot \log \left(\frac{t_1}{2}\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 (* f (/ PI 4.0))) (t_1 (sqrt (+ (exp t_0) (exp (- t_0))))))
(-
(* (/ (log (/ t_1 (sinh t_0))) PI) -4.0)
(* (/ 4.0 PI) (log (/ t_1 2.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 = f * (((double) M_PI) / 4.0);
double t_1 = sqrt((exp(t_0) + exp(-t_0)));
return ((log((t_1 / sinh(t_0))) / ((double) M_PI)) * -4.0) - ((4.0 / ((double) M_PI)) * log((t_1 / 2.0)));
}



Bits error versus f
Results
Initial program 61.6
Applied sinh-undef_binary641.9
Applied add-sqr-sqrt_binary641.9
Applied times-frac_binary642.0
Applied log-prod_binary642.1
Applied distribute-rgt-in_binary641.9
Simplified1.9
Simplified1.9
Applied div-inv_binary641.9
Applied associate-*l*_binary641.9
Simplified1.8
Final simplification1.8
herbie shell --seed 2022160
(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)))))))))