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



Bits error versus f
Results
Initial program 61.4
Simplified61.4
Taylor expanded around 0 2.4
Simplified2.4
rmApplied add-cube-cbrt_binary642.4
Applied pow-unpow_binary642.4
Final simplification2.4
herbie shell --seed 2020281
(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)))))))))