Package index
gsl
Library gsl
Gsl
. Sf
Module
Module Gsl.Sf Source Special functionsThe library includes routines for calculating the values of Airy functions , Bessel functions , Clausen functions , Coulomb functions , Coupling coefficients , The Dawson function , Debye functions , Dilogarithms , Elliptic integrals , Error , Exponential functions , Exponential integrals , Fermi-Dirac function , Gamma function , Gegenbauer functions aka Ultraspherical polynomials , Hypergeometric functions , Laguerre functions , Lambert W functions , Legendre functions and Associated Legendre functions and Spherical Harmonics , log , Power function , Psi (Digamma) function , Synchrotron functions , Transport functions , Trigonometric functions , and Zeta functions .
Each routine also computes an estimate of the numerical error in the calculated value of the function.
Airy functionsSource val airy_zero_Ai : int -> floatSource val airy_zero_Bi : int -> float Bessel functionsSource val bessel_J0 : float -> floatSource val bessel_J1 : float -> floatSource val bessel_Jn : int -> float -> floatSource val bessel_Jn_array : int -> float -> float array -> unitSource val bessel_Y0 : float -> floatSource val bessel_Y1 : float -> floatSource val bessel_Yn : int -> float -> floatSource val bessel_Yn_array : int -> float -> float array -> unitSource val bessel_I0 : float -> floatSource val bessel_I1 : float -> floatSource val bessel_In : int -> float -> floatSource val bessel_In_array : int -> float -> float array -> unitSource val bessel_K0 : float -> floatSource val bessel_K1 : float -> floatSource val bessel_Kn : int -> float -> floatSource val bessel_Kn_array : int -> float -> float array -> unitSource val bessel_I0_scaled : float -> floatSource val bessel_I1_scaled : float -> floatSource val bessel_In_scaled : int -> float -> floatSource val bessel_In_scaled_array : int -> float -> float array -> unitSource val bessel_K0_scaled : float -> floatSource val bessel_K1_scaled : float -> floatSource val bessel_Kn_scaled : int -> float -> floatSource val bessel_Kn_scaled_array : int -> float -> float array -> unitSource val bessel_j0 : float -> floatSource val bessel_j1 : float -> floatSource val bessel_j2 : float -> floatSource val bessel_jl : int -> float -> floatSource val bessel_jl_array : int -> float -> float array -> unitSource val bessel_jl_steed_array : float -> float array -> unitSource val bessel_y0 : float -> floatSource val bessel_y1 : float -> floatSource val bessel_y2 : float -> floatSource val bessel_yl : int -> float -> floatSource val bessel_yl_array : int -> float -> float array -> unitSource val bessel_i0_scaled : float -> floatSource val bessel_i1_scaled : float -> floatSource val bessel_il_scaled : int -> float -> floatSource val bessel_il_scaled_array : int -> float -> float array -> unitSource val bessel_k0_scaled : float -> floatSource val bessel_k1_scaled : float -> floatSource val bessel_kl_scaled : int -> float -> floatSource val bessel_kl_scaled_array : int -> float -> float array -> unitSource val bessel_Jnu : float -> float -> floatSource val bessel_sequence_Jnu_e : float -> Fun.mode -> float array -> unitSource val bessel_Ynu : float -> float -> floatSource val bessel_Inu : float -> float -> floatSource val bessel_Inu_scaled : float -> float -> floatSource val bessel_Knu : float -> float -> floatSource val bessel_lnKnu : float -> float -> floatSource val bessel_Knu_scaled : float -> float -> floatSource val bessel_zero_J0 : int -> floatSource val bessel_zero_J1 : int -> floatSource val bessel_zero_Jnu : float -> int -> float Clausen functionsSource val clausen : float -> float Coulomb functionsSource val hydrogenicR_1 : float -> float -> floatSource val hydrogenicR : int -> int -> float -> float -> floatSource val coulomb_CL_array : float -> float -> float array -> unit Coupling coefficients The Dawson functionSource val dawson : float -> float Debye functionsSource val debye_1 : float -> floatSource val debye_2 : float -> floatSource val debye_3 : float -> floatSource val debye_4 : float -> floatSource val debye_5 : float -> floatSource val debye_6 : float -> float DilogarithmsSource val dilog : float -> float Elementary operationsSource val multiply_err_e : x :float -> dx :float -> y :float -> dy :float -> Fun.result Elliptic integralsSource val ellint_RJ : float -> float -> float -> float -> Fun.mode -> float Error functionSource val erf : float -> floatSource val erfc : float -> floatSource val log_erfc : float -> floatSource val erf_Z : float -> floatSource val erf_Q : float -> float Exponential functionsSource val exp : float -> floatexp x computes the exponential function eˣ using GSL semantics and error checking.
exp_e10 x computes the exponential eˣ and returns a result with extended range. This function may be useful if the value of eˣ would overflow the numeric range of double.
Source val exp_mult : float -> float -> floatexp_mult x y exponentiate x and multiply by the factor y to return the product y eˣ.
Same as exp_e10 but return a result with extended numeric range.
Source val expm1 : float -> floatexpm1 x compute the quantity eˣ-1 using an algorithm that is accurate for small x.
Source val exprel : float -> floatexprel x compute the quantity (eˣ-1)/x using an algorithm that is accurate for small x. For small x the algorithm is based on the expansion (eˣ-1)/x = 1 + x/2 + x²/(2*3) + x³/(2*3*4) + ⋯
Source val exprel_2 : float -> floatexprel_2 x compute the quantity 2(eˣ-1-x)/x² using an algorithm that is accurate for small x. For small x the algorithm is based on the expansion 2(eˣ-1-x)/x^2 = 1 + x/3 + x²/(3*4) + x³/(3*4*5) + ⋯
Source val exprel_n : int -> float -> floatexprel_n x compute the n-relative exponential, which is the n-th generalization of the functions exprel and exprel_2 . The N-relative exponential is given by,
n-1
exprel_n x = n!/xⁿ (aˣ - ∑ xᵏ/k!)
k=0
= 1 + x/(N+1) + x²/((N+1)(N+2)) + ⋯Source val exp_mult_err_e : x :float -> dx :float -> y :float -> dy :float -> Fun.result Exponential integralsSource val expint_E1 : float -> floatSource val expint_E2 : float -> floatSource val expint_E1_scaled : float -> floatSource val expint_E2_scaled : float -> floatSource val expint_Ei : float -> floatSource val expint_Ei_scaled : float -> floatSource val shi : float -> floatSource val chi : float -> floatSource val expint_3 : float -> floatSource val atanint : float -> float Fermi-Dirac functionSource val fermi_dirac_m1 : float -> floatSource val fermi_dirac_0 : float -> floatSource val fermi_dirac_1 : float -> floatSource val fermi_dirac_2 : float -> floatSource val fermi_dirac_int : int -> float -> floatSource val fermi_dirac_mhalf : float -> floatSource val fermi_dirac_half : float -> floatSource val fermi_dirac_3half : float -> floatSource val fermi_dirac_inc_0 : float -> float -> float Gamma functionSource val gamma : float -> floatSource val lngamma : float -> floatSource val gammastar : float -> floatSource val gammainv : float -> floatSource val taylorcoeff : int -> float -> floatSource val doublefact : int -> floatSource val lnfact : int -> floatSource val lndoublefact : int -> floatSource val choose : int -> int -> floatSource val lnchoose : int -> int -> floatSource val poch : float -> float -> floatSource val lnpoch : float -> float -> floatSource val pochrel : float -> float -> floatSource val gamma_inc_Q : float -> float -> floatSource val gamma_inc_P : float -> float -> floatSource val gamma_inc : float -> float -> floatSource val beta : float -> float -> floatSource val lnbeta : float -> float -> floatSource val beta_inc : float -> float -> float -> float Gegenbauer functions aka Ultraspherical polynomialsGegenbauer functions are defined in DLMF .
Source val gegenpoly_1 : float -> float -> floatgegenpoly_1 l x = C₁⁽ˡ⁾(x).
Source val gegenpoly_2 : float -> float -> floatgegenpoly_2 l x = C₂⁽ˡ⁾(x).
Source val gegenpoly_3 : float -> float -> floatgegenpoly_3 l x = C₃⁽ˡ⁾(x).
Source val gegenpoly_n : int -> float -> float -> floatgegenpoly_n n l x = Cₙ⁽ˡ⁾(x). Constraints: l > -1/2, n ≥ 0.
Source val gegenpoly_array : float -> float -> float array -> unitgegenpoly_array l x c computes an array of Gegenbauer polynomials c.(n) = Cₙ⁽ˡ⁾(x) for n = 0, 1, 2,̣..., Array.length c - 1. Constraints: l > -1/2.
Hypergeometric functionsSource val hyperg_0F1 : c :float -> float -> floathyperg_0F1 c x computes the hypergeometric function ₀F₁(c; x).
Source val hyperg_1F1_int : m :int -> n :int -> float -> floathyperg_1F1_int m n x computes the confluent hypergeometric function ₁F₁(m;n;x) = M(m,n,x) for integer parameters m, n.
Source val hyperg_1F1 : a :float -> b :float -> float -> floathyperg_1F1 a b x computes the confluent hypergeometric function ₁F₁(a;b;x) = M(a,b,x) for general parameters a, b.
Source val hyperg_U_int : m :int -> n :int -> float -> floathyperg_U_int m n x computes the confluent hypergeometric function U(m,n,x) for integer parameters m, n.
hyperg_U_int_e10 m n x computes the confluent hypergeometric function U(m,n,x) for integer parameters m, n with extended range.
Source val hyperg_U : a :float -> b :float -> float -> floathyperg_U a b x computes the confluent hypergeometric function U(a,b,x).
hyperg_U_e10 a b x computes the confluent hypergeometric function U(a,b,x) with extended range.
Source val hyperg_2F1 : a :float -> b :float -> c :float -> float -> floathyperg_2F1 a b c x computes the Gauss hypergeometric function ₂F₁(a,b,c,x) = F(a,b,c,x) for |x| < 1.
If the arguments (a,b,c,x) are too close to a singularity then the function can raise the exception Error.Gsl_exn(Error.EMAXITER, _) when the series approximation converges too slowly. This occurs in the region of x=1, c - a - b ∈ ℤ.
Source val hyperg_2F1_conj : aR :float -> aI :float -> c :float -> float -> floatSource val hyperg_2F1_conj_e : aR :float -> aI :float -> c :float -> float -> Fun.result hyperg_2F1_conj aR aI c x computes the Gauss hypergeometric function ₂F₁(aR + i aI, aR - i aI, c, x) with complex parameters for |x| < 1.
Source val hyperg_2F1_renorm : a :float -> b :float -> c :float -> float -> floatSource val hyperg_2F1_renorm_e : a :float -> b :float -> c :float -> float -> Fun.result hyperg_2F1_renorm a b c x computes the renormalized Gauss hypergeometric function ₂F₁(a,b,c,x) / Γ(c) for |x| < 1.
Source val hyperg_2F1_conj_renorm : aR :float -> aI :float -> c :float -> float -> floatSource val hyperg_2F1_conj_renorm_e :
aR :float ->
aI :float ->
c :float ->
float ->
Fun.result hyperg_2F1_conj_renorm aR aI c x computes the renormalized Gauss hypergeometric function ₂F₁(aR + i aI, aR - i aI, c, x) / Γ(c) for |x| < 1.
Source val hyperg_2F0 : a :float -> b :float -> float -> floathyperg_2F0 a b x computes the hypergeometric function ₂F₀(a,b,x). The series representation is a divergent hypergeometric series. However, for x < 0 we have ₂F₀(a,b,x) = (-1/x)ᵃ U(a,1+a-b,-1/x)
Laguerre functionsSource val laguerre_1 : a :float -> float -> floatSource val laguerre_2 : a :float -> float -> floatSource val laguerre_3 : a :float -> float -> floatSource val laguerre_n : n :int -> a :float -> float -> float Lambert W functionsSource val lambert_W0 : float -> floatSource val lambert_Wm1 : float -> float Legendre functionsSource val legendre_P1 : float -> floatSource val legendre_P2 : float -> floatSource val legendre_P3 : float -> floatSource val legendre_Pl : int -> float -> floatSource val legendre_Pl_array : float -> float array -> unitSource val legendre_Q0 : float -> floatSource val legendre_Q1 : float -> floatSource val legendre_Ql : int -> float -> float Associated Legendre functions and Spherical HarmonicsSource type legendre_t = | Schmidt Specifies the computation of the Schmidt semi-normalized associated Legendre polynomials Sₗᵐ(x).
| Spharm Specifies the computation of the spherical harmonic associated Legendre polynomials Yₗᵐ(x).
| Full Specifies the computation of the fully normalized associated Legendre polynomials Nₗᵐ(x).
| None Specifies the computation of the unnormalized associated Legendre polynomials Pₗᵐ(x).
legendre_array norm lmax x result calculate all normalized associated Legendre polynomials for 0 ≤ l ≤ lmax and 0 ≤ m ≤ l for |x| ≤ 1. The norm parameter specifies which normalization is used. The normalized Pₗᵐ(x) values are stored in result, whose minimum size can be obtained from calling legendre_array_n . The array index of Pₗᵐ(x) is obtained from calling legendre_array_index(l, m). To include or exclude the Condon-Shortley phase factor of (-1)ᵐ, set the parameter csphase to either -1 or 1 respectively in the _e function. This factor is included by default.
Source val legendre_array_n : int -> intlegendre_array_n lmax returns the minimum array size for maximum degree lmax needed for the array versions of the associated Legendre functions. Size is calculated as the total number of Pₗᵐ(x) functions, plus extra space for precomputing multiplicative factors used in the recurrence relations.
Source val legendre_array_index : int -> int -> intlegendre_array_index l m returns the index into the result array of the legendre_array, legendre_deriv_array, legendre_deriv_alt_array, legendre_deriv2_array, and !legendre_deriv2_alt_array corresponding to Pₗᵐ(x), ∂ₓPₗᵐ(x), or ∂ₓ²Pₗₗᵐ(x). The index is given by l(l+1)/2 + m.
Source val legendre_Plm : int -> int -> float -> floatlegendre_Plm l m x and legendre_Plm_e l m x compute the associated Legendre polynomial Pₗᵐ(x) for m ≥ 0, l ≥ m, |x| ≤ 1.
Source val legendre_sphPlm : int -> int -> float -> floatlegendre_sphPlm l m x and legendre_Plm_e compute the normalized associated Legendre polynomial √((2l+1)/(4\pi)) √((l-m)!/(l+m)!) Pₗᵐ(x) suitable for use in spherical harmonics. The parameters must satisfy m ≥ 0, l ≥ m, |x| ≤ 1. Theses routines avoid the overflows that occur for the standard normalization of Pₗᵐ(x).
Logarithm and related functionsSource val log : float -> floatSource val log_abs : float -> floatSource val log_1plusx : float -> floatSource val log_1plusx_mx : float -> float Power functionSource val pow_int : float -> int -> float Psi (Digamma) functionSource val psi_int : int -> floatSource val psi : float -> floatSource val psi_1piy : float -> floatSource val psi_1_int : int -> floatSource val psi_1 : float -> floatSource val psi_n : int -> float -> float Synchrotron functionsSource val synchrotron_1 : float -> floatSource val synchrotron_2 : float -> float Transport functionsSource val transport_2 : float -> floatSource val transport_3 : float -> floatSource val transport_4 : float -> floatSource val transport_5 : float -> float Trigonometric functionsSource val sin : float -> floatSource val cos : float -> floatSource val hypot : float -> float -> floatSource val sinc : float -> floatSource val lnsinh : float -> floatSource val lncosh : float -> floatSource val angle_restrict_symm : float -> floatSource val angle_restrict_pos : float -> float Zeta functionsSource val zeta_int : int -> floatSource val zeta : float -> floatSource val hzeta : float -> float -> floatSource val eta_int : int -> floatSource val eta : float -> float