-\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)
\left(\log \left(\frac{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\mathsf{fma}\left(0.005208333333333333, {\left(\pi \cdot f\right)}^{3}, \mathsf{fma}\left(1.6276041666666666 \cdot 10^{-5}, {f}^{5} \cdot {\pi}^{5}, \mathsf{fma}\left(0.5, \pi \cdot f, 2.422030009920635 \cdot 10^{-8} \cdot \left({f}^{7} \cdot {\pi}^{7}\right)\right)\right)\right)}\right) \cdot \frac{1}{\sqrt{\pi}}\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
(/
(+ (exp (* (/ PI 4.0) f)) (pow (exp -0.25) (* PI f)))
(fma
0.005208333333333333
(pow (* PI f) 3.0)
(fma
1.6276041666666666e-5
(* (pow f 5.0) (pow PI 5.0))
(fma
0.5
(* PI f)
(* 2.422030009920635e-8 (* (pow f 7.0) (pow PI 7.0))))))))
(/ 1.0 (sqrt 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((exp((((double) M_PI) / 4.0) * f) + pow(exp(-0.25), (((double) M_PI) * f))) / fma(0.005208333333333333, pow((((double) M_PI) * f), 3.0), fma(1.6276041666666666e-5, (pow(f, 5.0) * pow(((double) M_PI), 5.0)), fma(0.5, (((double) M_PI) * f), (2.422030009920635e-8 * (pow(f, 7.0) * pow(((double) M_PI), 7.0))))))) * (1.0 / sqrt((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
Final simplification2.3
herbie shell --seed 2022019
(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)))))))))