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



Bits error versus f
Initial program 61.5
Simplified61.5
Taylor expanded in f around 0 2.1
Simplified2.1
Final simplification2.1
herbie shell --seed 2022081
(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)))))))))