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



Bits error versus f
Initial program 61.4
Simplified61.4
Taylor expanded in f around 0 2.4
Simplified2.4
Applied associate-*r/_binary642.3
Applied add-sqr-sqrt_binary642.3
Applied associate-*l*_binary642.3
Final simplification2.3
herbie shell --seed 2022068
(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)))))))))