(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 (fma 4.0 (- (log (cbrt (pow (pow f (/ 1.0 PI)) 3.0))) (/ (log (/ 4.0 PI)) PI)) (* (* f (* f PI)) -0.08333333333333333)))
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 fma(4.0, (log(cbrt(pow(pow(f, (1.0 / ((double) M_PI))), 3.0))) - (log((4.0 / ((double) M_PI))) / ((double) M_PI))), ((f * (f * ((double) M_PI))) * -0.08333333333333333));
}
function code(f) return Float64(-Float64(Float64(1.0 / Float64(pi / 4.0)) * log(Float64(Float64(exp(Float64(Float64(pi / 4.0) * f)) + exp(Float64(-Float64(Float64(pi / 4.0) * f)))) / Float64(exp(Float64(Float64(pi / 4.0) * f)) - exp(Float64(-Float64(Float64(pi / 4.0) * f)))))))) end
function code(f) return fma(4.0, Float64(log(cbrt(((f ^ Float64(1.0 / pi)) ^ 3.0))) - Float64(log(Float64(4.0 / pi)) / pi)), Float64(Float64(f * Float64(f * pi)) * -0.08333333333333333)) end
code[f_] := (-N[(N[(1.0 / N[(Pi / 4.0), $MachinePrecision]), $MachinePrecision] * N[Log[N[(N[(N[Exp[N[(N[(Pi / 4.0), $MachinePrecision] * f), $MachinePrecision]], $MachinePrecision] + N[Exp[(-N[(N[(Pi / 4.0), $MachinePrecision] * f), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] / N[(N[Exp[N[(N[(Pi / 4.0), $MachinePrecision] * f), $MachinePrecision]], $MachinePrecision] - N[Exp[(-N[(N[(Pi / 4.0), $MachinePrecision] * f), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision])
code[f_] := N[(4.0 * N[(N[Log[N[Power[N[Power[N[Power[f, N[(1.0 / Pi), $MachinePrecision]], $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision]], $MachinePrecision] - N[(N[Log[N[(4.0 / Pi), $MachinePrecision]], $MachinePrecision] / Pi), $MachinePrecision]), $MachinePrecision] + N[(N[(f * N[(f * Pi), $MachinePrecision]), $MachinePrecision] * -0.08333333333333333), $MachinePrecision]), $MachinePrecision]
-\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)
\mathsf{fma}\left(4, \log \left(\sqrt[3]{{\left({f}^{\left(\frac{1}{\pi}\right)}\right)}^{3}}\right) - \frac{\log \left(\frac{4}{\pi}\right)}{\pi}, \left(f \cdot \left(f \cdot \pi\right)\right) \cdot -0.08333333333333333\right)



Bits error versus f
Initial program 61.4
Simplified61.4
Taylor expanded in f around 0 2.3
Simplified2.3
Taylor expanded in f around 0 2.3
Simplified2.2
Applied egg-rr2.2
Applied egg-rr2.2
Final simplification2.2
herbie shell --seed 2022156
(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)))))))))