-\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)\log \left(\left(\left(0.001953125 \cdot \left(\frac{f}{\pi \cdot 0.125} \cdot {\pi}^{2}\right) + \left(\frac{2}{f \cdot \left(\pi \cdot 0.5\right)} + \left(0.0625 \cdot \left(f \cdot \pi\right) + \left(0.8333333333333334 \cdot \left(\left(f \cdot \pi\right) \cdot -0.0625\right) + \left(0.001953125 \cdot \left(\frac{f}{\pi \cdot 0.125} \cdot {\pi}^{2}\right) + 0.75\right)\right)\right)\right)\right) + \left(\pi \cdot 0.125\right) \cdot \left(f \cdot 0.25 + f \cdot 0.5\right)\right) + \left(-0.5 - \left(\pi \cdot \frac{f \cdot 0.03125}{-1} + \left(\left(f \cdot \pi\right) \cdot 0.052083333333333336 + \left(0.25 + \left(\frac{f}{\pi \cdot 0.125} \cdot {\pi}^{2}\right) \cdot 0.00390625\right)\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
(*
(log
(+
(+
(+
(* 0.001953125 (* (/ f (* PI 0.125)) (pow PI 2.0)))
(+
(/ 2.0 (* f (* PI 0.5)))
(+
(* 0.0625 (* f PI))
(+
(* 0.8333333333333334 (* (* f PI) -0.0625))
(+ (* 0.001953125 (* (/ f (* PI 0.125)) (pow PI 2.0))) 0.75)))))
(* (* PI 0.125) (+ (* f 0.25) (* f 0.5))))
(-
-0.5
(+
(* PI (/ (* f 0.03125) -1.0))
(+
(* (* f PI) 0.052083333333333336)
(+ 0.25 (* (* (/ f (* PI 0.125)) (pow PI 2.0)) 0.00390625)))))))
(/ -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 log((((0.001953125 * ((f / (((double) M_PI) * 0.125)) * pow(((double) M_PI), 2.0))) + ((2.0 / (f * (((double) M_PI) * 0.5))) + ((0.0625 * (f * ((double) M_PI))) + ((0.8333333333333334 * ((f * ((double) M_PI)) * -0.0625)) + ((0.001953125 * ((f / (((double) M_PI) * 0.125)) * pow(((double) M_PI), 2.0))) + 0.75))))) + ((((double) M_PI) * 0.125) * ((f * 0.25) + (f * 0.5)))) + (-0.5 - ((((double) M_PI) * ((f * 0.03125) / -1.0)) + (((f * ((double) M_PI)) * 0.052083333333333336) + (0.25 + (((f / (((double) M_PI) * 0.125)) * pow(((double) M_PI), 2.0)) * 0.00390625)))))) * (-4.0 / ((double) M_PI));
}



Bits error versus f
Results
Initial program 61.5
Simplified61.5
Taylor expanded around 0 2.3
Simplified2.3
Simplified2.3
Final simplification2.3
herbie shell --seed 2020295
(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)))))))))