-\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(\log \left(\sqrt{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}\right) + \log \left(\frac{\sqrt{e^{\frac{\pi}{4} \cdot f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}}{0.005208333333333333 \cdot {\left(\pi \cdot f\right)}^{3} + \left(1.6276041666666666 \cdot 10^{-05} \cdot \left({\pi}^{5} \cdot {f}^{5}\right) + \left(\pi \cdot f\right) \cdot 0.5\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 (sqrt (+ (exp (* (/ PI 4.0) f)) (pow (exp -0.25) (* PI f)))))
(log
(/
(sqrt (+ (exp (* (/ PI 4.0) f)) (pow (exp -0.25) (* PI f))))
(+
(* 0.005208333333333333 (pow (* PI f) 3.0))
(+
(* 1.6276041666666666e-05 (* (pow PI 5.0) (pow f 5.0)))
(* (* PI f) 0.5))))))
(/ -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(sqrt(exp((((double) M_PI) / 4.0) * f) + pow(exp(-0.25), (((double) M_PI) * f)))) + log(sqrt(exp((((double) M_PI) / 4.0) * f) + pow(exp(-0.25), (((double) M_PI) * f))) / ((0.005208333333333333 * pow((((double) M_PI) * f), 3.0)) + ((1.6276041666666666e-05 * (pow(((double) M_PI), 5.0) * pow(f, 5.0))) + ((((double) M_PI) * f) * 0.5))))) * (-4.0 / ((double) M_PI));
}



Bits error versus f
Results
Initial program 61.8
Simplified61.8
Taylor expanded around 0 2.3
Simplified2.3
rmApplied *-un-lft-identity_binary642.3
Applied add-sqr-sqrt_binary642.3
Applied times-frac_binary642.3
Applied log-prod_binary642.2
Simplified2.2
Simplified2.2
Final simplification2.2
herbie shell --seed 2020233
(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)))))))))