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



Bits error versus f
Initial program 61.4
Simplified61.4
Taylor expanded in f around 0 2.2
Simplified2.2
Applied associate-*r/_binary642.1
Simplified2.1
Final simplification2.1
herbie shell --seed 2022094
(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)))))))))