Special functions
Airy functions
val airy_Ai : float -> Fun.mode -> float
val airy_Bi : float -> Fun.mode -> float
val airy_Ai_scaled : float -> Fun.mode -> float
val airy_Bi_scaled : float -> Fun.mode -> float
val airy_Ai_deriv : float -> Fun.mode -> float
val airy_Bi_deriv : float -> Fun.mode -> float
val airy_Ai_deriv_scaled : float -> Fun.mode -> float
val airy_Bi_deriv_scaled : float -> Fun.mode -> float
val airy_zero_Ai : int -> float
val airy_zero_Bi : int -> float
Bessel functions
val bessel_J0 : float -> float
val bessel_J1 : float -> float
val bessel_Jn : int -> float -> float
val bessel_Jn_array : int -> float -> float array -> unit
val bessel_Y0 : float -> float
val bessel_Y1 : float -> float
val bessel_Yn : int -> float -> float
val bessel_Yn_array : int -> float -> float array -> unit
val bessel_I0 : float -> float
val bessel_I1 : float -> float
val bessel_In : int -> float -> float
val bessel_In_array : int -> float -> float array -> unit
val bessel_K0 : float -> float
val bessel_K1 : float -> float
val bessel_Kn : int -> float -> float
val bessel_Kn_array : int -> float -> float array -> unit
val bessel_I0_scaled : float -> float
val bessel_I1_scaled : float -> float
val bessel_In_scaled : int -> float -> float
val bessel_In_scaled_e : int -> float -> Fun.result
val bessel_In_scaled_array : int -> float -> float array -> unit
val bessel_K0_scaled : float -> float
val bessel_K1_scaled : float -> float
val bessel_Kn_scaled : int -> float -> float
val bessel_Kn_scaled_e : int -> float -> Fun.result
val bessel_Kn_scaled_array : int -> float -> float array -> unit
val bessel_j0 : float -> float
val bessel_j1 : float -> float
val bessel_j2 : float -> float
val bessel_jl : int -> float -> float
val bessel_jl_array : int -> float -> float array -> unit
val bessel_jl_steed_array : float -> float array -> unit
val bessel_y0 : float -> float
val bessel_y1 : float -> float
val bessel_y2 : float -> float
val bessel_yl : int -> float -> float
val bessel_yl_array : int -> float -> float array -> unit
val bessel_i0_scaled : float -> float
val bessel_i1_scaled : float -> float
val bessel_il_scaled : int -> float -> float
val bessel_il_scaled_e : int -> float -> Fun.result
val bessel_il_scaled_array : int -> float -> float array -> unit
val bessel_k0_scaled : float -> float
val bessel_k1_scaled : float -> float
val bessel_kl_scaled : int -> float -> float
val bessel_kl_scaled_e : int -> float -> Fun.result
val bessel_kl_scaled_array : int -> float -> float array -> unit
val bessel_Jnu : float -> float -> float
val bessel_sequence_Jnu_e : float -> Fun.mode -> float array -> unit
val bessel_Ynu : float -> float -> float
val bessel_Inu : float -> float -> float
val bessel_Inu_scaled : float -> float -> float
val bessel_Inu_scaled_e : float -> float -> Fun.result
val bessel_Knu : float -> float -> float
val bessel_lnKnu : float -> float -> float
val bessel_Knu_scaled : float -> float -> float
val bessel_Knu_scaled_e : float -> float -> Fun.result
val bessel_zero_J0 : int -> float
val bessel_zero_J1 : int -> float
val bessel_zero_Jnu : float -> int -> float
val bessel_zero_Jnu_e : float -> int -> Fun.result
Clausen functions
val clausen : float -> float
Coulomb functions
val hydrogenicR_1 : float -> float -> float
val hydrogenicR_1_e : float -> float -> Fun.result
val hydrogenicR : int -> int -> float -> float -> float
val hydrogenicR_e : int -> int -> float -> float -> Fun.result
val coulomb_CL_array : float -> float -> float array -> unit
Dawson functions
val dawson : float -> float
Debye functions
val debye_1 : float -> float
val debye_2 : float -> float
val debye_3 : float -> float
val debye_4 : float -> float
val debye_5 : float -> float
val debye_6 : float -> float
Dilogarithm
val dilog : float -> float
Elementary operations
val multiply_err_e : x:float -> dx:float -> y:float -> dy:float -> Fun.result
Elliptic integrals
val ellint_Kcomp : float -> Fun.mode -> float
val ellint_Ecomp : float -> Fun.mode -> float
val ellint_Pcomp : float -> float -> Fun.mode -> float
val ellint_Dcomp : float -> Fun.mode -> float
val ellint_F : float -> float -> Fun.mode -> float
val ellint_E : float -> float -> Fun.mode -> float
val ellint_P : float -> float -> float -> Fun.mode -> float
val ellint_D : float -> float -> Fun.mode -> float
val ellint_RC : float -> float -> Fun.mode -> float
val ellint_RD : float -> float -> float -> Fun.mode -> float
val ellint_RF : float -> float -> float -> Fun.mode -> float
val ellint_RJ : float -> float -> float -> float -> Fun.mode -> float
Error function
val erfc : float -> float
val log_erfc : float -> float
val erf_Z : float -> float
val erf_Q : float -> float
Exponential functions
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.
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.
val expm1 : float -> float
expm1 x
compute the quantity eˣ-1 using an algorithm that is accurate for small x
.
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) + ⋯
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) + ⋯
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)) + ⋯
val exp_mult_err_e : x:float -> dx:float -> y:float -> dy:float -> Fun.result
val exp_mult_err_e10_e :
x:float ->
dx:float ->
y:float ->
dy:float ->
Fun.result_e10
Exponential integrals
val expint_E1 : float -> float
val expint_E2 : float -> float
val expint_E1_scaled : float -> float
val expint_E2_scaled : float -> float
val expint_Ei : float -> float
val expint_Ei_scaled : float -> float
val expint_3 : float -> float
val atanint : float -> float
Fermi-Dirac function
val fermi_dirac_m1 : float -> float
val fermi_dirac_0 : float -> float
val fermi_dirac_1 : float -> float
val fermi_dirac_2 : float -> float
val fermi_dirac_int : int -> float -> float
val fermi_dirac_int_e : int -> float -> Fun.result
val fermi_dirac_mhalf : float -> float
val fermi_dirac_half : float -> float
val fermi_dirac_3half : float -> float
val fermi_dirac_inc_0 : float -> float -> float
val fermi_dirac_inc_0_e : float -> float -> Fun.result
Gamma function
val gamma : float -> float
val lngamma : float -> float
val gammastar : float -> float
val gammainv : float -> float
val taylorcoeff : int -> float -> float
val doublefact : int -> float
val lnfact : int -> float
val lndoublefact : int -> float
val choose : int -> int -> float
val lnchoose : int -> int -> float
val poch : float -> float -> float
val lnpoch : float -> float -> float
val lnpoch_sgn_e : float -> float -> Fun.result * float
val pochrel : float -> float -> float
val gamma_inc_Q : float -> float -> float
val gamma_inc_P : float -> float -> float
val gamma_inc : float -> float -> float
val beta : float -> float -> float
val lnbeta : float -> float -> float
val lnbeta_sgn_e : float -> float -> Fun.result * float
val beta_inc : float -> float -> float -> float
val beta_inc_e : float -> float -> float -> Fun.result
Gegenbauer functions aka Ultraspherical polynomials
Gegenbauer functions are defined in DLMF.
val gegenpoly_1 : float -> float -> float
gegenpoly_1 l x
= C₁⁽ˡ⁾(x).
val gegenpoly_2 : float -> float -> float
gegenpoly_2 l x
= C₂⁽ˡ⁾(x).
val gegenpoly_3 : float -> float -> float
gegenpoly_3 l x
= C₃⁽ˡ⁾(x).
val gegenpoly_n : int -> float -> float -> float
val gegenpoly_n_e : int -> float -> float -> Fun.result
gegenpoly_n n l x
= Cₙ⁽ˡ⁾(x). Constraints: l > -1/2, n ≥ 0.
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 functions
Laguerre functions
val laguerre_1 : float -> float -> float
val laguerre_2 : float -> float -> float
val laguerre_3 : float -> float -> float
val laguerre_n : int -> float -> float -> float
val laguerre_n_e : int -> float -> float -> Fun.result
Lambert W functions
val lambert_W0 : float -> float
val lambert_Wm1 : float -> float
Legendre functions
val legendre_P1 : float -> float
val legendre_P2 : float -> float
val legendre_P3 : float -> float
val legendre_Pl : int -> float -> float
val legendre_Pl_array : float -> float array -> unit
val legendre_Q0 : float -> float
val legendre_Q1 : float -> float
val legendre_Ql : int -> float -> float
Associated Legendre functions and Spherical Harmonics
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).
val legendre_array : legendre_t -> int -> float -> float array -> unit
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.
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.
val legendre_array_index : int -> int -> int
legendre_array_index l m
returns the index into the result
array of 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.
val legendre_Plm : int -> int -> float -> float
val legendre_Plm_e : int -> int -> float -> Fun.result
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
.
val legendre_sphPlm : int -> int -> float -> float
val legendre_sphPlm_e : int -> int -> float -> Fun.result
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).
val log_abs : float -> float
val log_1plusx : float -> float
val log_1plusx_mx : float -> float
Power function
val pow_int : float -> int -> float
Psi (Digamma) function
val psi_int : int -> float
val psi_1piy : float -> float
val psi_1_int : int -> float
val psi_1 : float -> float
val psi_n : int -> float -> float
Synchrotron functions
val synchrotron_1 : float -> float
val synchrotron_2 : float -> float
Transport functions
val transport_2 : float -> float
val transport_3 : float -> float
val transport_4 : float -> float
val transport_5 : float -> float
Trigonometric functions
val hypot : float -> float -> float
val sinc : float -> float
val lnsinh : float -> float
val lncosh : float -> float
val angle_restrict_symm : float -> float
val angle_restrict_pos : float -> float
Zeta functions
val zeta_int : int -> float
val zeta : float -> float
val hzeta : float -> float -> float
val eta_int : int -> float