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



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