(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
(/
(+ (pow (exp PI) (* 0.25 f)) (pow (exp -0.25) (* PI f)))
(fma
1.6276041666666666e-5
(pow (* PI f) 5.0)
(fma
0.005208333333333333
(pow (* PI f) 3.0)
(fma 0.5 (* PI f) (* 2.422030009920635e-8 (pow (* PI f) 7.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(((pow(exp(((double) M_PI)), (0.25 * f)) + pow(exp(-0.25), (((double) M_PI) * f))) / fma(1.6276041666666666e-5, pow((((double) M_PI) * f), 5.0), fma(0.005208333333333333, pow((((double) M_PI) * f), 3.0), fma(0.5, (((double) M_PI) * f), (2.422030009920635e-8 * pow((((double) M_PI) * f), 7.0))))))) * -4.0) / ((double) M_PI);
}
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 Float64(Float64(log(Float64(Float64((exp(pi) ^ Float64(0.25 * f)) + (exp(-0.25) ^ Float64(pi * f))) / fma(1.6276041666666666e-5, (Float64(pi * f) ^ 5.0), fma(0.005208333333333333, (Float64(pi * f) ^ 3.0), fma(0.5, Float64(pi * f), Float64(2.422030009920635e-8 * (Float64(pi * f) ^ 7.0))))))) * -4.0) / pi) 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[(N[(N[Log[N[(N[(N[Power[N[Exp[Pi], $MachinePrecision], N[(0.25 * f), $MachinePrecision]], $MachinePrecision] + N[Power[N[Exp[-0.25], $MachinePrecision], N[(Pi * f), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(1.6276041666666666e-5 * N[Power[N[(Pi * f), $MachinePrecision], 5.0], $MachinePrecision] + N[(0.005208333333333333 * N[Power[N[(Pi * f), $MachinePrecision], 3.0], $MachinePrecision] + N[(0.5 * N[(Pi * f), $MachinePrecision] + N[(2.422030009920635e-8 * N[Power[N[(Pi * f), $MachinePrecision], 7.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * -4.0), $MachinePrecision] / Pi), $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)
\frac{\log \left(\frac{{\left(e^{\pi}\right)}^{\left(0.25 \cdot f\right)} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\mathsf{fma}\left(1.6276041666666666 \cdot 10^{-5}, {\left(\pi \cdot f\right)}^{5}, \mathsf{fma}\left(0.005208333333333333, {\left(\pi \cdot f\right)}^{3}, \mathsf{fma}\left(0.5, \pi \cdot f, 2.422030009920635 \cdot 10^{-8} \cdot {\left(\pi \cdot f\right)}^{7}\right)\right)\right)}\right) \cdot -4}{\pi}



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