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



Bits error versus f
Initial program 61.6
Simplified61.6
Taylor expanded in f around 0 2.4
Simplified2.4
Taylor expanded in f around 0 2.4
Simplified2.3
Applied sub-neg_binary642.3
Final simplification2.3
herbie shell --seed 2022072
(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)))))))))