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 -> float
Source val airy_zero_Bi : int -> float
Bessel functionsSource val bessel_J0 : float -> float
Source val bessel_J1 : float -> float
Source val bessel_Jn : int -> float -> float
Source val bessel_Jn_array : int -> float -> float array -> unit
Source val bessel_Y0 : float -> float
Source val bessel_Y1 : float -> float
Source val bessel_Yn : int -> float -> float
Source val bessel_Yn_array : int -> float -> float array -> unit
Source val bessel_I0 : float -> float
Source val bessel_I1 : float -> float
Source val bessel_In : int -> float -> float
Source val bessel_In_array : int -> float -> float array -> unit
Source val bessel_K0 : float -> float
Source val bessel_K1 : float -> float
Source val bessel_Kn : int -> float -> float
Source val bessel_Kn_array : int -> float -> float array -> unit
Source val bessel_I0_scaled : float -> float
Source val bessel_I1_scaled : float -> float
Source val bessel_In_scaled : int -> float -> float
Source val bessel_In_scaled_array : int -> float -> float array -> unit
Source val bessel_K0_scaled : float -> float
Source val bessel_K1_scaled : float -> float
Source val bessel_Kn_scaled : int -> float -> float
Source val bessel_Kn_scaled_array : int -> float -> float array -> unit
Source val bessel_j0 : float -> float
Source val bessel_j1 : float -> float
Source val bessel_j2 : float -> float
Source val bessel_jl : int -> float -> float
Source val bessel_jl_array : int -> float -> float array -> unit
Source val bessel_jl_steed_array : float -> float array -> unit
Source val bessel_y0 : float -> float
Source val bessel_y1 : float -> float
Source val bessel_y2 : float -> float
Source val bessel_yl : int -> float -> float
Source val bessel_yl_array : int -> float -> float array -> unit
Source val bessel_i0_scaled : float -> float
Source val bessel_i1_scaled : float -> float
Source val bessel_il_scaled : int -> float -> float
Source val bessel_il_scaled_array : int -> float -> float array -> unit
Source val bessel_k0_scaled : float -> float
Source val bessel_k1_scaled : float -> float
Source val bessel_kl_scaled : int -> float -> float
Source val bessel_kl_scaled_array : int -> float -> float array -> unit
Source val bessel_Jnu : float -> float -> float
Source val bessel_sequence_Jnu_e : float -> Fun.mode -> float array -> unit
Source val bessel_Ynu : float -> float -> float
Source val bessel_Inu : float -> float -> float
Source val bessel_Inu_scaled : float -> float -> float
Source val bessel_Knu : float -> float -> float
Source val bessel_lnKnu : float -> float -> float
Source val bessel_Knu_scaled : float -> float -> float
Source val bessel_zero_J0 : int -> float
Source val bessel_zero_J1 : int -> float
Source val bessel_zero_Jnu : float -> int -> float
Clausen functionsSource val clausen : float -> float
Coulomb functionsSource val hydrogenicR_1 : float -> float -> float
Source val hydrogenicR : int -> int -> float -> float -> float
Source val coulomb_CL_array : float -> float -> float array -> unit
Coupling coefficients The Dawson functionSource val dawson : float -> float
Debye functionsSource val debye_1 : float -> float
Source val debye_2 : float -> float
Source val debye_3 : float -> float
Source val debye_4 : float -> float
Source val debye_5 : float -> float
Source 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 -> float
Source val erfc : float -> float
Source val log_erfc : float -> float
Source val erf_Z : float -> float
Source val erf_Q : float -> float
Exponential functionsSource val exp : float -> float
exp 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 -> float
exp_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 -> float
expm1 x
compute the quantity eˣ-1 using an algorithm that is accurate for small x
.
Source val exprel : float -> float
exprel 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 -> float
exprel_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 -> float
exprel_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 -> float
Source val expint_E2 : float -> float
Source val expint_E1_scaled : float -> float
Source val expint_E2_scaled : float -> float
Source val expint_Ei : float -> float
Source val expint_Ei_scaled : float -> float
Source val shi : float -> float
Source val chi : float -> float
Source val expint_3 : float -> float
Source val atanint : float -> float
Fermi-Dirac functionSource val fermi_dirac_m1 : float -> float
Source val fermi_dirac_0 : float -> float
Source val fermi_dirac_1 : float -> float
Source val fermi_dirac_2 : float -> float
Source val fermi_dirac_int : int -> float -> float
Source val fermi_dirac_mhalf : float -> float
Source val fermi_dirac_half : float -> float
Source val fermi_dirac_3half : float -> float
Source val fermi_dirac_inc_0 : float -> float -> float
Gamma functionSource val gamma : float -> float
Source val lngamma : float -> float
Source val gammastar : float -> float
Source val gammainv : float -> float
Source val taylorcoeff : int -> float -> float
Source val doublefact : int -> float
Source val lnfact : int -> float
Source val lndoublefact : int -> float
Source val choose : int -> int -> float
Source val lnchoose : int -> int -> float
Source val poch : float -> float -> float
Source val lnpoch : float -> float -> float
Source val pochrel : float -> float -> float
Source val gamma_inc_Q : float -> float -> float
Source val gamma_inc_P : float -> float -> float
Source val gamma_inc : float -> float -> float
Source val beta : float -> float -> float
Source val lnbeta : float -> float -> float
Source val beta_inc : float -> float -> float -> float
Gegenbauer functions aka Ultraspherical polynomialsGegenbauer functions are defined in DLMF .
Source val gegenpoly_1 : float -> float -> float
gegenpoly_1 l x
= C₁⁽ˡ⁾(x).
Source val gegenpoly_2 : float -> float -> float
gegenpoly_2 l x
= C₂⁽ˡ⁾(x).
Source val gegenpoly_3 : float -> float -> float
gegenpoly_3 l x
= C₃⁽ˡ⁾(x).
Source val gegenpoly_n : int -> float -> float -> float
gegenpoly_n n l x
= Cₙ⁽ˡ⁾(x). Constraints: l > -1/2, n ≥ 0.
Source val gegenpoly_array : float -> float -> float array -> unit
gegenpoly_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 -> float
hyperg_0F1 c x
computes the hypergeometric function ₀F₁(c; x).
Source val hyperg_1F1_int : m :int -> n :int -> float -> float
hyperg_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 -> float
hyperg_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 -> float
hyperg_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 -> float
hyperg_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 -> float
hyperg_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 -> float
Source 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 -> float
Source 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 -> float
Source 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 -> float
hyperg_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 -> float
Source val laguerre_2 : a :float -> float -> float
Source val laguerre_3 : a :float -> float -> float
Source val laguerre_n : n :int -> a :float -> float -> float
Lambert W functionsSource val lambert_W0 : float -> float
Source val lambert_Wm1 : float -> float
Legendre functionsSource val legendre_P1 : float -> float
Source val legendre_P2 : float -> float
Source val legendre_P3 : float -> float
Source val legendre_Pl : int -> float -> float
Source val legendre_Pl_array : float -> float array -> unit
Source val legendre_Q0 : float -> float
Source val legendre_Q1 : float -> float
Source 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 -> int
legendre_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 -> int
legendre_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 -> float
legendre_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 -> float
legendre_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 -> float
Source val log_abs : float -> float
Source val log_1plusx : float -> float
Source val log_1plusx_mx : float -> float
Power functionSource val pow_int : float -> int -> float
Psi (Digamma) functionSource val psi_int : int -> float
Source val psi : float -> float
Source val psi_1piy : float -> float
Source val psi_1_int : int -> float
Source val psi_1 : float -> float
Source val psi_n : int -> float -> float
Synchrotron functionsSource val synchrotron_1 : float -> float
Source val synchrotron_2 : float -> float
Transport functionsSource val transport_2 : float -> float
Source val transport_3 : float -> float
Source val transport_4 : float -> float
Source val transport_5 : float -> float
Trigonometric functionsSource val sin : float -> float
Source val cos : float -> float
Source val hypot : float -> float -> float
Source val sinc : float -> float
Source val lnsinh : float -> float
Source val lncosh : float -> float
Source val angle_restrict_symm : float -> float
Source val angle_restrict_pos : float -> float
Zeta functionsSource val zeta_int : int -> float
Source val zeta : float -> float
Source val hzeta : float -> float -> float
Source val eta_int : int -> float
Source val eta : float -> float