-\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[3]{\frac{4}{\pi \cdot f}}\\
\log \left({\left(\mathsf{fma}\left({\left(\pi \cdot f\right)}^{3}, -0.00034722222222222224, \mathsf{fma}\left(2.066798941798942 \cdot 10^{-6}, {\pi}^{5} \cdot {f}^{5}, \mathsf{fma}\left(\pi \cdot f, 0.08333333333333333, t_0 \cdot \left(t_0 \cdot t_0\right)\right)\right)\right)\right)}^{\left(\sqrt{\frac{1}{\pi}}\right)}\right) \cdot \frac{-4}{\sqrt{\pi}}
\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 (cbrt (/ 4.0 (* PI f)))))
(*
(log
(pow
(fma
(pow (* PI f) 3.0)
-0.00034722222222222224
(fma
2.066798941798942e-6
(* (pow PI 5.0) (pow f 5.0))
(fma (* PI f) 0.08333333333333333 (* t_0 (* t_0 t_0)))))
(sqrt (/ 1.0 PI))))
(/ -4.0 (sqrt 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) {
double t_0 = cbrt(4.0 / (((double) M_PI) * f));
return log(pow(fma(pow((((double) M_PI) * f), 3.0), -0.00034722222222222224, fma(2.066798941798942e-6, (pow(((double) M_PI), 5.0) * pow(f, 5.0)), fma((((double) M_PI) * f), 0.08333333333333333, (t_0 * (t_0 * t_0))))), sqrt(1.0 / ((double) M_PI)))) * (-4.0 / sqrt((double) M_PI));
}



Bits error versus f
Initial program 59.9
Simplified59.9
Taylor expanded in f around 0 2.2
Simplified2.2
Applied add-sqr-sqrt_binary643.0
Applied *-un-lft-identity_binary643.0
Applied times-frac_binary642.5
Applied associate-*r*_binary642.1
Applied add-log-exp_binary642.1
Simplified2.1
Applied add-cube-cbrt_binary642.1
Final simplification2.1
herbie shell --seed 2022067
(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)))))))))