-\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(\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{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
(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))))))
(/ 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(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))))))) * (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.2
Simplified2.2
Applied add-sqr-sqrt_binary643.1
Applied *-un-lft-identity_binary643.1
Applied times-frac_binary642.5
Applied associate-*r*_binary642.2
Final simplification2.2
herbie shell --seed 2022004
(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)))))))))