-\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)
\log \left({\left(\mathsf{fma}\left({\left(\pi \cdot f\right)}^{3}, -0.00034722222222222224, \mathsf{fma}\left(0.08333333333333333, \pi \cdot f, \frac{4}{\pi \cdot f}\right)\right)\right)}^{\left(\sqrt{\frac{1}{\pi}}\right)}\right) \cdot \frac{-4}{\sqrt{\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
(*
(log
(pow
(fma
(pow (* PI f) 3.0)
-0.00034722222222222224
(fma 0.08333333333333333 (* PI f) (/ 4.0 (* PI f))))
(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) {
return log(pow(fma(pow((((double) M_PI) * f), 3.0), -0.00034722222222222224, fma(0.08333333333333333, (((double) M_PI) * f), (4.0 / (((double) M_PI) * f)))), sqrt(1.0 / ((double) M_PI)))) * (-4.0 / sqrt((double) M_PI));
}



Bits error versus f
Initial program 61.4
Simplified61.4
Taylor expanded in f around 0 2.4
Simplified2.4
Applied add-sqr-sqrt_binary643.2
Applied *-un-lft-identity_binary643.2
Applied times-frac_binary642.6
Applied associate-*r*_binary642.3
Applied add-log-exp_binary642.3
Simplified2.2
Final simplification2.2
herbie shell --seed 2021291
(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)))))))))