-\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({\pi}^{3} \cdot \left({f}^{4} \cdot 0.0012152777777777778\right) + -4 \cdot \frac{1}{\frac{\pi}{\log \left(\frac{4}{\pi}\right) - \log f}}\right) + \left(\pi \cdot \left(f \cdot f\right)\right) \cdot -0.08333333333333333(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 (+ (+ (* (pow PI 3.0) (* (pow f 4.0) 0.0012152777777777778)) (* -4.0 (/ 1.0 (/ PI (- (log (/ 4.0 PI)) (log f)))))) (* (* PI (* f f)) -0.08333333333333333)))
double code(double f) {
return ((double) -(((double) ((1.0 / (((double) M_PI) / 4.0)) * ((double) log((((double) (((double) exp(((double) ((((double) M_PI) / 4.0) * f)))) + ((double) exp(((double) -(((double) ((((double) M_PI) / 4.0) * f)))))))) / ((double) (((double) exp(((double) ((((double) M_PI) / 4.0) * f)))) - ((double) exp(((double) -(((double) ((((double) M_PI) / 4.0) * f)))))))))))))));
}
double code(double f) {
return ((double) (((double) (((double) (((double) pow(((double) M_PI), 3.0)) * ((double) (((double) pow(f, 4.0)) * 0.0012152777777777778)))) + ((double) (-4.0 * (1.0 / (((double) M_PI) / ((double) (((double) log((4.0 / ((double) M_PI)))) - ((double) log(f)))))))))) + ((double) (((double) (((double) M_PI) * ((double) (f * f)))) * -0.08333333333333333))));
}



Bits error versus f
Results
Initial program 61.5
Simplified61.5
Taylor expanded around 0 2.4
Simplified2.4
Taylor expanded around inf 2.5
Simplified2.4
rmApplied frac-sub_binary642.5
Simplified2.5
rmApplied clear-num_binary642.5
Simplified2.5
Final simplification2.5
herbie shell --seed 2020210
(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)))))))))