-\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(f \cdot \left(f \cdot {\pi}^{2}\right)\right) \cdot 0.0078125 + \left(\left(\log \left(\frac{4}{\pi}\right) + \left(0.5 \cdot \left(\pi \cdot \left(f \cdot -0.25\right)\right) + \left(f \cdot \pi\right) \cdot 0.125\right)\right) - \left(\left(f \cdot \left(f \cdot {\pi}^{2}\right)\right) \cdot 0.0026041666666666665 + \left(\log f + 0.0625 \cdot \left(\left(f \cdot \left(f \cdot {\pi}^{2}\right)\right) \cdot -0.25\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
(*
(+
(* (* f (* f (pow PI 2.0))) 0.0078125)
(-
(+ (log (/ 4.0 PI)) (+ (* 0.5 (* PI (* f -0.25))) (* (* f PI) 0.125)))
(+
(* (* f (* f (pow PI 2.0))) 0.0026041666666666665)
(+ (log f) (* 0.0625 (* (* f (* f (pow PI 2.0))) -0.25))))))
(/ -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 (((f * (f * pow(((double) M_PI), 2.0))) * 0.0078125) + ((log(4.0 / ((double) M_PI)) + ((0.5 * (((double) M_PI) * (f * -0.25))) + ((f * ((double) M_PI)) * 0.125))) - (((f * (f * pow(((double) M_PI), 2.0))) * 0.0026041666666666665) + (log(f) + (0.0625 * ((f * (f * pow(((double) M_PI), 2.0))) * -0.25)))))) * (-4.0 / ((double) M_PI));
}



Bits error versus f
Results
Initial program 61.3
Simplified61.3
Taylor expanded around 0 2.6
Simplified2.6
Taylor expanded around 0 2.5
Simplified2.5
Final simplification2.5
herbie shell --seed 2020280
(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)))))))))