-\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(\left(0.020833333333333332 \cdot \left(\left(\pi \cdot f\right) \cdot \left(\pi \cdot f\right)\right) + \log \left(\frac{4}{\pi}\right)\right) - \left(\log f + 0.00030381944444444445 \cdot \left({f}^{4} \cdot \left({\left(\sqrt[3]{\pi}\right)}^{8} \cdot {\left(\sqrt[3]{\pi}\right)}^{4}\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
(*
(-
(+ (* 0.020833333333333332 (* (* PI f) (* PI f))) (log (/ 4.0 PI)))
(+
(log f)
(*
0.00030381944444444445
(* (pow f 4.0) (* (pow (cbrt PI) 8.0) (pow (cbrt PI) 4.0))))))
(/ -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 (((0.020833333333333332 * ((((double) M_PI) * f) * (((double) M_PI) * f))) + log(4.0 / ((double) M_PI))) - (log(f) + (0.00030381944444444445 * (pow(f, 4.0) * (pow(cbrt((double) M_PI), 8.0) * pow(cbrt((double) M_PI), 4.0)))))) * (-4.0 / ((double) M_PI));
}



Bits error versus f
Results
Initial program 61.6
Simplified61.6
Taylor expanded around 0 2.3
Simplified2.3
rmApplied add-cube-cbrt_binary642.3
Applied unpow-prod-down_binary642.3
Simplified2.3
Final simplification2.3
herbie shell --seed 2020220
(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)))))))))