(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
(let* ((t_0
(sqrt
(/
(+ (pow (pow (exp PI) 0.25) f) (pow (exp -0.25) (* PI f)))
(fma
PI
(* f 0.5)
(fma
(pow (* PI f) 3.0)
0.005208333333333333
(* (pow PI 5.0) (* 1.6276041666666666e-5 (pow f 5.0)))))))))
(/ (* (log (* t_0 t_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) {
double t_0 = sqrt(((pow(pow(exp(((double) M_PI)), 0.25), f) + pow(exp(-0.25), (((double) M_PI) * f))) / fma(((double) M_PI), (f * 0.5), fma(pow((((double) M_PI) * f), 3.0), 0.005208333333333333, (pow(((double) M_PI), 5.0) * (1.6276041666666666e-5 * pow(f, 5.0)))))));
return (log((t_0 * t_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) t_0 = sqrt(Float64(Float64(((exp(pi) ^ 0.25) ^ f) + (exp(-0.25) ^ Float64(pi * f))) / fma(pi, Float64(f * 0.5), fma((Float64(pi * f) ^ 3.0), 0.005208333333333333, Float64((pi ^ 5.0) * Float64(1.6276041666666666e-5 * (f ^ 5.0))))))) return Float64(Float64(log(Float64(t_0 * t_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_] := Block[{t$95$0 = N[Sqrt[N[(N[(N[Power[N[Power[N[Exp[Pi], $MachinePrecision], 0.25], $MachinePrecision], f], $MachinePrecision] + N[Power[N[Exp[-0.25], $MachinePrecision], N[(Pi * f), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[(Pi * N[(f * 0.5), $MachinePrecision] + N[(N[Power[N[(Pi * f), $MachinePrecision], 3.0], $MachinePrecision] * 0.005208333333333333 + N[(N[Power[Pi, 5.0], $MachinePrecision] * N[(1.6276041666666666e-5 * N[Power[f, 5.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[(N[Log[N[(t$95$0 * t$95$0), $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)
\begin{array}{l}
t_0 := \sqrt{\frac{{\left({\left(e^{\pi}\right)}^{0.25}\right)}^{f} + {\left(e^{-0.25}\right)}^{\left(\pi \cdot f\right)}}{\mathsf{fma}\left(\pi, f \cdot 0.5, \mathsf{fma}\left({\left(\pi \cdot f\right)}^{3}, 0.005208333333333333, {\pi}^{5} \cdot \left(1.6276041666666666 \cdot 10^{-5} \cdot {f}^{5}\right)\right)\right)}}\\
\frac{\log \left(t_0 \cdot t_0\right) \cdot -4}{\pi}
\end{array}
Initial program 61.5
Simplified61.5
Taylor expanded in f around 0 2.1
Simplified2.1
Applied egg-rr2.1
Applied egg-rr2.1
Final simplification2.1
herbie shell --seed 2022192
(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)))))))))