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



Bits error versus f
Initial program 61.4
Simplified61.4
Taylor expanded in f around 0 2.2
Simplified2.2
Taylor expanded in f around 0 2.1
Simplified2.1
Applied add-log-exp_binary642.1
Simplified2.0
Final simplification2.0
herbie shell --seed 2022039
(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)))))))))