Class bessel_K_exp_integ_direct (o2scl)

O2scl : Class List

template<class fp_t = double, class func_t = funct_ld, class internal_fp_t = long double>
class bessel_K_exp_integ_direct

Compute exponentially scaled modified Bessel function of the second kind by direct integration.

This class computes \( K_n(z) e^z\) for \( n=1,2,3 \) by directly integrating. It integrates the representation

\[ K_n(z) e^{z} = \frac{\sqrt{\pi} z^{n}}{2^{n} \Gamma(n+1/2)} \int_1^{\infty} e^{z(1-t)} \left(t^2-1\right)^{n-1/2}~dt \]
(see http://functions.wolfram.com/Bessel-TypeFunctions/BesselK/07/01/01/) by applying an integrator (of type o2scl::bessel_K_exp_integ_tl) with a larger floating point type and then casting the result back to fp t. This should work with boost multiprecision types but is only currently tested with internal_fp_t=long double.

With the default types, this class should give almost identical results to o2scl::bessel_K_exp_integ_gsl .

Public Functions

inline bessel_K_exp_integ_direct()
inline void set_tol(const fp_t &tol)

Set tolerance.

inline fp_t K1exp(fp_t x)

Compute \( K_1(x) e^x \).

inline int K1exp_ret(fp_t x, fp_t &res, fp_t &err)

Compute \( K_1(x) e^x \).

inline fp_t K2exp(fp_t x)

Compute \( K_2(x) e^x \).

inline int K2exp_ret(fp_t x, fp_t &res, fp_t &err)

Compute \( K_2(x) e^x \).

inline fp_t K3exp(fp_t x)

Compute \( K_3(x) e^x \).

inline int K3exp_ret(fp_t x, fp_t &res, fp_t &err)

Compute \( K_3(x) e^x \).

Public Members

bessel_K_exp_integ_tl<o2scl::inte_double_exp_boost<func_t, internal_fp_t>, internal_fp_t> it

The integrator.