-\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(f, \pi \cdot 0.08333333333333333, \frac{4}{f \cdot \pi}\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 f (* PI 0.08333333333333333) (/ 4.0 (* f PI))) (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(f, (((double) M_PI) * 0.08333333333333333), (4.0 / (f * ((double) M_PI)))), sqrt(1.0 / ((double) M_PI)))) * (-4.0 / sqrt((double) M_PI));
}



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