Math::Libgsl::Function - An interface to libgsl, the Gnu Scientific Library - Special functions.
use Math::Libgsl::Raw::Function :ALL;
use Math::Libgsl::Function :ALL;
Math::Libgsl::Function provides an interface to special function evaluation in libgsl, the GNU Scientific Library.
Math::Libgsl::Function makes these tags available:
-
:airy
-
:bessel
-
:coulomb
-
:coupling
-
:dawson
-
:debye
-
:dilog
-
:mult
-
:ellint
-
:ellfun
-
:err
-
:exp
-
:fermidirac
-
:gammabeta
-
:gegen
-
:hermite
-
:hyperg
-
:laguerre
-
:lambert
-
:legendre
-
:log
-
:mathieu
-
:pow
-
:psi
-
:sync
-
:transport
-
:trig
-
:zeta
Throughout this module the subs whose name ends with "-e" return a List of two values: the result and its associated error.
These routines compute the Airy function Ai(x) with an accuracy specified by mode.
These routines compute the Airy function Bi(x) with an accuracy specified by mode.
These routines compute the scaled value of the Airy function Ai(x) with an accuracy specified by mode.
These routines compute the scaled value of the Airy function Bi(x) with an accuracy specified by mode.
These routines compute the scaled value of the Airy function derivative A'i(x) with an accuracy specified by mode.
These routines compute the scaled value of the Airy function derivative B'i(x) with an accuracy specified by mode.
These routines compute the scaled value of the Airy function derivative A'i(x) with an accuracy specified by mode.
These routines compute the scaled value of the Airy function derivative B'i(x) with an accuracy specified by mode.
These routines compute the location of the s-th zero of the Airy function Ai(x).
These routines compute the location of the s-th zero of the Airy function Bi(x).
These routines compute the location of the s-th zero of the Airy function derivative A'i(x).
These routines compute the location of the s-th zero of the Airy function derivative B'i(x).
These routines compute the regular cylindrical Bessel function of zeroth order, J₀(x).
These routines compute the regular cylindrical Bessel function of first order, J₁(x).
These routines compute the regular cylindrical Bessel function of order n, Jₙ(x).
This routine computes the values of the regular cylindrical Bessel functions Jₙ(x) for n from nmin to nmax inclusive.
These routines compute the irregular cylindrical Bessel function of zeroth order, Y₀(x).
These routines compute the irregular cylindrical Bessel function of first order, Y₁(x).
These routines compute the irregular cylindrical Bessel function of order n, Yₙ(x).
This routine computes the values of the irregular cylindrical Bessel functions Yₙ(x) for n from nmin to nmax inclusive.
These routines compute the regular modified cylindrical Bessel function of zeroth order, I₀(x).
These routines compute the regular modified cylindrical Bessel function of first order, I₁(x).
These routines compute the regular modified cylindrical Bessel function of order n, Iₙ(x).
This routine computes the values of the regular modified cylindrical Bessel functions Iₙ(x) for n from nmin to nmax inclusive.
These routines compute the scaled regular modified cylindrical Bessel function of zeroth order exp(−|x|)I₀(x).
These routines compute the scaled regular modified cylindrical Bessel function of first order exp(−|x|)I₁(x).
These routines compute the scaled regular modified cylindrical Bessel function of order n exp(−|x|)Iₙ(x).
sub In-scaled-array(UInt $nmin, UInt $nmax where $nmin < $nmax, Num(Cool) $x --> List) is export(:bessel)
This routine computes the values of the scaled regular cylindrical Bessel functions exp(−|x|)Iₙ(x) for n from nmin to nmax inclusive.
These routines compute the irregular modified cylindrical Bessel function of zeroth order, K₀(x).
These routines compute the irregular modified cylindrical Bessel function of first order, K₁(x).
These routines compute the irregular modified cylindrical Bessel function of order n, Kₙ(x).
sub Kn-array(UInt $nmin, UInt $nmax where $nmin < $nmax, Num(Cool) $x where * > 0 --> List) is export(:bessel)
This routine computes the values of the irregular modified cylindrical Bessel functions K n (x) for n from nmin to nmax inclusive.
These routines compute the scaled irregular modified cylindrical Bessel function of zeroth order exp(x)K₀(x).
These routines compute the scaled irregular modified cylindrical Bessel function of first order exp(x)K₁(x).
These routines compute the scaled irregular modified cylindrical Bessel function of order n exp(x)Kₙ(x).
sub Kn-scaled-array(UInt $nmin, UInt $nmax where $nmin < $nmax, Num(Cool) $x where * > 0 --> List) is export(:bessel)
This routine computes the values of the scaled irregular cylindrical Bessel functions exp(x)Kₙ(x) for n from nmin to nmax inclusive.
These routines compute the regular spherical Bessel function of zeroth order, j₀(x).
These routines compute the regular spherical Bessel function of first order, j₁(x).
These routines compute the regular spherical Bessel function of second order, j₂(x).
These routines compute the regular spherical Bessel function of order l, jₗ(x).
This routine computes the values of the regular spherical Bessel functions jₗ(x) for l from 0 to lmax inclusive.
This routine uses Steed’s method to compute the values of the regular spherical Bessel functions jₗ(x) for l from 0 to lmax inclusive.
These routines compute the irregular spherical Bessel function of zeroth order, y₀(x).
These routines compute the irregular spherical Bessel function of first order, y₁(x).
These routines compute the irregular spherical Bessel function of second order, y₂(x).
These routines compute the irregular spherical Bessel function of order l, yₗ(x).
This routine computes the values of the irregular spherical Bessel functions yₗ(x) for l from 0 to lmax inclusive.
These routines compute the scaled regular modified spherical Bessel function of zeroth order.
These routines compute the scaled regular modified spherical Bessel function of first order.
These routines compute the scaled regular modified spherical Bessel function of second order.
These routines compute the scaled regular modified spherical Bessel function of order l.
This routine computes the values of the scaled regular modified spherical Bessel functions for l from 0 to lmax inclusive.
These routines compute the scaled irregular modified spherical Bessel function of zeroth order.
These routines compute the scaled irregular modified spherical Bessel function of first order.
These routines compute the scaled irregular modified spherical Bessel function of second order.
These routines compute the scaled irregular modified spherical Bessel function of order l.
This routine computes the values of the scaled irregular modified spherical Bessel functions for l from 0 to lmax inclusive.
These routines compute the regular cylindrical Bessel function of fractional order ν, Jν(x).
This function computes the regular cylindrical Bessel function of fractional order ν, Jν(x), with an accuracy specified by $mode, evaluated at a series of x values.
These routines compute the irregular cylindrical Bessel function of fractional order ν, Yν(x).
These routines compute the regular modified Bessel function of fractional order ν, Iν(x).
These routines compute the scaled regular modified Bessel function of fractional order ν.
These routines compute the irregular modified Bessel function of fractional order ν, Kν(x).
These routines compute the logarithm of the irregular modified Bessel function of fractional order ν, ln(Kν(x)).
These routines compute the scaled irregular modified Bessel function of fractional order ν.
These routines compute the location of the s-th positive zero of the Bessel function J₀(x).
These routines compute the location of the s-th positive zero of the Bessel function J₁(x).
These routines compute the location of the s-th positive zero of the Bessel function Jν(x).
These routines compute the Clausen integral Cl₂(x).
These √ routines compute the lowest-order normalized hydrogenic bound state radial wavefunction R₁.
These routines compute the n-th normalized hydrogenic bound state radial wavefunction Rₙ.
sub coulomb-wave-FG-e(Num(Cool) $eta, Num(Cool) $x where * > 0, Num(Cool) $LF where * > -½, Int $k --> List) is export(:coulomb)
This function computes the Coulomb wave functions Fₗ(η, x), Gₗ₋ₖ(η, x) and their derivatives Fₗ’(η, x), Gₗ₋ₖ’(η, x) with respect to x. It returns a List of Pairs (that can be read as a Hash):
-
:Fval the Fₗ(η, x) value
-
:Ferr the Fₗ(η, x) error
-
:Fpval the Fₗ’(η, x) value
-
:Fperr the Fₗ’(η, x) error
-
:Gval the Gₗ₋ₖ(η, x) value
-
:Gerr the Gₗ₋ₖ(η, x) error
-
:Gpval the Gₗ₋ₖ’(η, x) value
-
:Gperr the Gₗ₋ₖ’(η, x) error
-
:overflow Bool: if an overflow occurred, this is True, otherwise False
-
:expF if an overflow occurred, this is the scaling exponent for Fₗ(η, x)
-
:expG if an overflow occurred, this is the scaling exponent for Gₗ₋ₖ(η, x)
my %res = coulomb-wave-FG-e(1, 5, 0, 0);
say %res<Fval>;
say %res<Fpval>;
say %res<Gval>;
say %res<Gpval>;
sub coulomb-wave-F-array(Num(Cool) $lmin, UInt $kmax, Num(Cool) $eta, Num(Cool) $x where * > 0 --> List) is export(:coulomb)
This function computes the Coulomb wave function Fₗ(η, x) for l = lmin … lmin + kmax. It returns a List of Pairs (that can be read as a Hash):
-
:outF array of Fₗ(η, x) values
-
:overflow Bool: if an overflow occurred, this is True, otherwise False
-
:expF if an overflow occurred, this is the scaling exponent for Fₗ(η, x)
sub coulomb-wave-FG-array(Num(Cool) $lmin, UInt $kmax, Num(Cool) $eta, Num(Cool) $x where * > 0 --> List) is export(:coulomb)
This function computes the functions Fₗ(η, x), Gₗ(η, x) for l = lmin … lmin + kmax. It returns a List of Pairs (that can be read as a Hash):
-
:outF array of Fₗ(η, x) values
-
:outG array of Gₗ(η, x) values
-
:overflow Bool: if an overflow occurred, this is True, otherwise False
-
:expF if an overflow occurred, this is the scaling exponent for Fₗ(η, x)
-
:expG if an overflow occurred, this is the scaling exponent for Gₗ₋ₖ(η, x)
sub coulomb-wave-FGp-array(Num(Cool) $lmin, UInt $kmax, Num(Cool) $eta, Num(Cool) $x where * > 0 --> List) is export(:coulomb)
This function computes the functions Fₗ(η, x), Gₗ(η, x) and their derivatives F’ₗ(η, x), G’ₗ(η, x) for l = lmin … lmin + kmax It returns a List of Pairs (that can be read as a Hash):
-
:outF array of Fₗ(η, x) values
-
:outG array of Gₗ(η, x) values
-
:outFp array of Fₗ’(η, x) values
-
:outGp array of Gₗ’(η, x) values
-
:overflow Bool: if an overflow occurred, this is True, otherwise False
-
:expF if an overflow occurred, this is the scaling exponent for Fₗ(η, x)
-
:expG if an overflow occurred, this is the scaling exponent for Gₗ₋ₖ(η, x)
sub coulomb-wave-sphF-array(Num(Cool) $lmin, UInt $kmax, Num(Cool) $eta, Num(Cool) $x where * > 0 --> List) is export(:coulomb)
This function computes the Coulomb wave function divided by the argument Fₗ(η, x)/x for l = lmin… lmin + kmax It returns a List of Pairs (that can be read as a Hash):
-
:outF array of Fₗ(η, x) values
-
:overflow Bool: if an overflow occurred, this is True, otherwise False
-
:expF if an overflow occurred, this is the scaling exponent for Fₗ(η, x)
This function computes the Coulomb wave function normalization constant Cₗ(η).
sub coulomb-CL-array(Num(Cool) $lmin where * > -1, UInt $kmax, Num(Cool) $eta --> List) is export(:coulomb)
This function computes the Coulomb wave function normalization constant C L (η) for l = lmin … lmin + kmax.
sub coupling3j(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-ma, Int $two-mb, Int $two-mc --> Num) is export(:coupling)
sub coupling3j-e(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-ma, Int $two-mb, Int $two-mc --> List) is export(:coupling)
These routines compute the Wigner 3-j coefficient. The arguments are given in half-integer units: two_ja/2, two_ma/2, etc.
sub coupling6j(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-jd, Int $two-je, Int $two-jf --> Num) is export(:coupling)
sub coupling6j-e(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-jd, Int $two-je, Int $two-jf --> List) is export(:coupling)
These routines compute the Wigner 6-j coefficient. The arguments are given in half-integer units: two_ja/2, two_ma/2, etc.
sub coupling9j(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-jd, Int $two-je, Int $two-jf, Int $two-jg, Int $two-jh, Int $two-ji --> Num) is export(:coupling)
sub coupling9j-e(Int $two-ja, Int $two-jb, Int $two-jc, Int $two-jd, Int $two-je, Int $two-jf, Int $two-jg, Int $two-jh, Int $two-ji --> List) is export(:coupling)
These routines compute the Wigner 9-j coefficient. The arguments are given in half-integer units: two_ja/2, two_ma/2, etc.
These routines compute the value of Dawson’s integral for x.
These routines compute the first-order Debye function D₁(x).
These routines compute the first-order Debye function D₂(x).
These routines compute the first-order Debye function D₃(x).
These routines compute the first-order Debye function D₄(x).
These routines compute the first-order Debye function D₅(x).
These routines compute the first-order Debye function D₆(x).
These routines compute the dilogarithm for a real argument.
This function computes the full complex-valued dilogarithm for the complex argument z = r exp(iθ).
This function computes the full complex-valued Spence integral. It returns a List: the first element is the value as a Raku’s Complex datatype, the following are the errors on the real and imaginary part.
These functions multiply x and y, allowing for the propagation of errors.
sub multiply-err-e(Num(Cool) $x, Num(Cool) $dx, Num(Cool) $y, Num(Cool) $dy --> List) is export(:mult)
This function multiplies x and y with associated absolute errors dx and dy.
These routines compute the complete elliptic integral K(k) to the accuracy specified by the mode variable mode.
These routines compute the complete elliptic integral E(k) to the accuracy specified by the mode variable mode.
These routines compute the complete elliptic integral Π(k,n) to the accuracy specified by the mode variable mode.
These routines compute the complete elliptic integral D(k) to the accuracy specified by the mode variable mode.
These routines compute the incomplete elliptic integral F(φ, k) to the accuracy specified by the mode variable mode.
These routines compute the incomplete elliptic integral E(φ, k) to the accuracy specified by the mode variable mode.
These routines compute the incomplete elliptic integral P(φ, k) to the accuracy specified by the mode variable mode.
These routines compute the incomplete elliptic integral D(φ, k) to the accuracy specified by the mode variable mode.
These routines compute the incomplete elliptic integral RC(x, y) to the accuracy specified by the mode variable mode.
These routines compute the incomplete elliptic integral RD(x, y, z) to the accuracy specified by the mode variable mode.
These routines compute the incomplete elliptic integral RF(x, y, z) to the accuracy specified by the mode variable mode.
sub RJ(Num(Cool) $x, Num(Cool) $y, Num(Cool) $z, Num(Cool) $p, UInt $mode --> Num) is export(:ellint)
sub RJ-e(Num(Cool) $x, Num(Cool) $y, Num(Cool) $z, Num(Cool) $p, UInt $mode --> List) is export(:ellint)
These routines compute the incomplete elliptic integral RJ(x, y, z, p) to the accuracy specified by the mode variable mode.
This function computes the Jacobian elliptic functions sn(u|m), cn(u|m), dn(u|m) by descending Landen transformations.
These routines compute the error function erf(x).
These routines compute the complementary error function erfc(x) = 1 − erf(x).
These routines compute the logarithm of the complementary error function log(erfc(x)).
These routines compute the Gaussian probability density function Z(x).
These routines compute the upper tail of the Gaussian probability function Q(x).
These routines compute the hazard function for the normal distribution.
These routines provide an exponential function exp(x) using GSL semantics and error checking.
This function computes the exponential exp(x) and returns a result with extended range. This function may be useful if the value of exp(x) would overflow the numeric range of double. It returns a list of three numbers: the value, the error, and the scaling exponent.
These routines exponentiate x and multiply by the factor y to return the product y exp(x).
This function computes the product y exp(x) and returns a result with extended range. This function may be useful if the value of exp(x) would overflow the numeric range of double. It returns a list of three numbers: the value, the error, and the scaling exponent.
These routines compute the quantity exp(x) − 1 using an algorithm that is accurate for small x.
These routines compute the quantity (exp(x) − 1)/x using an algorithm that is accurate for small x.
These routines compute the quantity 2(exp(x) − 1 − x)/x 2 using an algorithm that is accurate for small x.
These routines compute the N -relative exponential, which is the n-th generalization of the functions gexprel, gexprel2, gexprel-e, and gexprel2-e.
This function exponentiates x with an associated absolute error dx.
This function exponentiates a quantity x with an associated absolute error dx and returns a result with extended range. This function may be useful if the value of exp(x) would overflow the numeric range of double. It returns a list of three numbers: the value, the error, and the scaling exponent.
sub gexp-mult-err-e(Num(Cool) $x, Num(Cool) $dx, Num(Cool) $y, Num(Cool) $dy --> List) is export(:exp)
This routine computes the product y exp(x) for the quantities x, y with associated absolute errors dx, dy.
sub gexp-mult-err-e10(Num(Cool) $x, Num(Cool) $dx, Num(Cool) $y, Num(Cool) $dy --> List) is export(:exp)
This routine computes the product y exp(x) for the quantities x, y with associated absolute errors dx, dy and returns a result with extended range. This function may be useful if the value of exp(x) would overflow the numeric range of double. It returns a list of three numbers: the value, the error, and the scaling exponent.
These routines compute the exponential integral E₁(x).
These routines compute the exponential integral E₂(x).
These routines compute the exponential integral Eₙ(x) of order n.
These routines compute the exponential integral Ei(x).
These routines compute the hyperbolic integral Shi(x).
These routines compute the hyperbolic integral Chi(x).
These routines compute the third-order exponential integral Ei₃(x).
These routines compute the Sine integral Si(x).
These routines compute the Cosine integral Ci(x).
These routines compute the Arctangent integral.
These routines compute the complete Fermi-Dirac integral with an index of −1.
These routines compute the complete Fermi-Dirac integral with an index of 0.
These routines compute the complete Fermi-Dirac integral with an index of 1.
These routines compute the complete Fermi-Dirac integral with an index of 2.
These routines compute the complete Fermi-Dirac integral with an integer index j.
These routines compute the complete Fermi-Dirac integral F₋₁/₂(x).
These routines compute the complete Fermi-Dirac integral F₁/₂(x).
These routines compute the complete Fermi-Dirac integral F₃/₂(x).
These routines compute the incomplete Fermi-Dirac integral with an index of zero, F₀(x, b).
sub gamma-e(Num(Cool) $x where { $_ > 0 || ($_ < 0 && $_ ≠ $_.Int) } --> List) is export(:gammabeta)
These routines compute the Gamma function Γ(x).
sub lngamma-e(Num(Cool) $x where { $_ > 0 || ($_ < 0 && $_ ≠ $_.Int) } --> List) is export(:gammabeta)
These routines compute the logarithm of the Gamma function, log(Γ(x)).
sub lngamma-sgn-e(Num(Cool) $x where { $_ > 0 || ($_ < 0 && $_ ≠ $_.Int) } --> List) is export(:gammabeta)
This routine computes the sign of the gamma function and the logarithm of its magnitude. It returns three numbers: the value, its associated error, and the sign.
These routines compute the regulated Gamma Function Γ*(x).
sub gammainv(Num(Cool) $x where { $_ > 0 || ($_ < 0 && $_ ≠ $_.Int) } --> Num) is export(:gammabeta)
sub gammainv-e(Num(Cool) $x where { $_ > 0 || ($_ < 0 && $_ ≠ $_.Int) } --> List) is export(:gammabeta)
These routines compute the reciprocal of the gamma function, 1/Γ(x) using the real Lanczos method.
sub lngamma-complex-e(Num(Cool) $zr where { $_ > 0 || ($_ < 0 && $_ ≠ $_.Int) }, Num(Cool) $zi where { $_ > 0 || ($_ < 0 && $_ ≠ $_.Int) } --> List) is export(:gammabeta)
This routine computes log(Γ(z)) for complex z = zᵣ + izᵢ. The returned parameters are lnr = log |Γ(z)|, its error, arg = arg(Γ(z)) in (−π, π], and its error.
These routines compute the factorial n!.
These routines compute the double factorial n!! = n(n − 2)(n − 4)…
These routines compute the logarithm of the factorial of n, log(n!).
These routines compute the logarithm of the double factorial of n, log(n!!).
These routines compute the combinatorial factor n choose m = n!/(m!(n − m)!).
These routines compute the logarithm of n choose m.
These routines compute the Taylor coefficient xⁿ/n!.
These routines compute the Pochhammer symbol (a)ₓ = Γ(a + x)/Γ(a).
These routines compute the Pochhammer symbol log((a)ₓ) = log(Γ(a + x)/Γ(a)).
These routines compute the sign of the Pochhammer symbol and the logarithm of its magnitude. It returns three numbers: the value, its associated error, and the sign.
These routines compute the relative Pochhammer symbol ((a)ₓ − 1)/x
These functions compute the unnormalized incomplete Gamma Function Γ(a, x).
sub gamma-inc-Q-e(Num(Cool) $a where * > 0, Num(Cool) $x where * ≥ 0 --> List) is export(:gammabeta)
These routines compute the normalized incomplete Gamma Function Q(a, x) = 1/Γ(a).
sub gamma-inc-P-e(Num(Cool) $a where * > 0, Num(Cool) $x where * ≥ 0 --> List) is export(:gammabeta)
These routines compute the complementary normalized incomplete Gamma Function P (a, x).
These routines compute the Beta Function, B(a, b).
These routines compute the logarithm of the Beta Function, log(B(a, b)).
sub beta-inc(Num(Cool) $a where * > 0, Num(Cool) $b where * > 0, Num(Cool) $x where 0 ≤ * ≤ 1 --> Num) is export(:gammabeta)
sub beta-inc-e(Num(Cool) $a where * > 0, Num(Cool) $b where * > 0, Num(Cool) $x where 0 ≤ * ≤ 1 --> List) is export(:gammabeta)
These routines compute the normalized incomplete Beta function I x (a, b).
These functions evaluate the Gegenbauer polynomials Cₙλ(x) using explicit representations for n = 1, 2, 3.
These functions evaluate the Gegenbauer polynomials Cₙλ(x) for a specific value of n, λ, x.
sub gegenpoly-array(UInt $nmax, Num(Cool) $lambda where * > -½, Num(Cool) $x --> List) is export(:gegen)
This function computes an array of Gegenbauer polynomials Cₙλ(x) for n = 0, 1, 2 … $nmax.
These routines evaluate the physicist Hermite polynomial H n (x) of order n at position x.
This routine evaluates all physicist Hermite polynomials H n up to order nmax at position x.
These routines evaluate the series Σ aⱼHⱼ(x) for j = 0 … n.
These routines evaluate the probabilist Hermite polynomial He n (x) of order n at position x.
This routine evaluates all probabilist Hermite polynomials Heₙ(x) up to order nmax at position x.
These routines evaluate the series Σ aⱼHeⱼ(x) for j = 0 … n.
These routines evaluate the m-th derivative of the physicist Hermite polynomial Hₙ(x) of order n at position x.
This routine evaluates the m-th derivative of all physicist Hermite polynomials Hₙ(x) from orders 0 … nmax at position x.
This routine evaluates all derivative orders from 0 … mmax of the physicist Hermite polynomial of order n, Hₙ, at position x.
These routines evaluate the m-th derivative of the probabilist Hermite polynomial Heₙ(x) of order n at position x.
This routine evaluates the m-th derivative of all probabilist Hermite polynomials Heₙ(x) from orders 0 … nmax at position x.
This routine evaluates all derivative orders from 0 … mmax of the probabilist Hermite polynomial of order n, Heₙ, at position x.
These routines evaluate the Hermite function ψₙ(x) of order n at position x.
This routine evaluates all Hermite functions ψₙ(x) for orders n = 0 … nmax at position x.
These routines evaluate the series Σ aⱼψⱼ(x) for j = 0 … n.
These routines evaluate the m-th derivative of the Hermite function ψₙ(x) of order n at position x.
These routines evaluate the s-th zero of the physicist Hermite polynomial Hₙ(x) of order n.
These routines evaluate the s-th zero of the probabilist Hermite polynomial Heₙ(x) of order n.
These routines evaluate the s-th zero of the Hermite function ψₙ(x) of order n.
These routines compute the hypergeometric function ₀F₁(c, x).
These routines compute the confluent hypergeometric function ₁F₁(a, b, x).
These routines compute the confluent hypergeometric function ₁F₁(m, n, x) for integer parameters m, n.
These routines compute the confluent hypergeometric function U(a, b, x).
This routine computes the confluent hypergeometric function U(a, b, x) and returns a result with extended range. It returns a list of three numbers: the value, the error, and the scaling exponent.
These routines compute the confluent hypergeometric function U(m, n, x) for integer parameters m, n.
This routine computes the confluent hypergeometric function U(m, n, x) for integer parameters m, n and returns a result with extended range. It returns a list of three numbers: the value, the error, and the scaling exponent.
These routines compute the Gauss hypergeometric function ₂F₁(a, b, c, x).
sub F21-conj(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> Num) is export(:hyperg)
sub F21-conj-e(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> List) is export(:hyperg)
These routines compute the Gauss hypergeometric function ₂F₁(aᵣ + iaᵢ, aᵣ − iaᵢ, c, x).
sub F21-renorm(Num(Cool) $a, Num(Cool) $b, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> Num) is export(:hyperg)
sub F21-renorm-e(Num(Cool) $a, Num(Cool) $b, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> List) is export(:hyperg)
These routines compute the renormalized Gauss hypergeometric function ₂F₁(a, b, c, x)/Γ(c).
sub F21-conj-renorm(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> Num) is export(:hyperg)
sub F21-conj-renorm-e(Num(Cool) $aR, Num(Cool) $aI, Num(Cool) $c, Num(Cool) $x where -1 < * < 1 --> List) is export(:hyperg)
These routines compute the renormalized Gauss hypergeometric function ₂F₁(aᵣ + iaᵢ, aᵣ − iaᵢ, c, x)/Γ(c).
These routines compute the hypergeometric function ₂F₀(a, b, x).
These routines evaluate the generalized Laguerre polynomials L₁a(x), L₂a(x), L₃a(x) using explicit representations.
These routines evaluate the generalized Laguerre polynomials Lₙa(x).
These compute the principal branch of the Lambert W function, W₀(x).
These compute the principal branch of the Lambert W function, W₋₁(x).
These functions evaluate the Legendre polynomials Pₗ(x) using explicit representations for l = 1, 2, 3.
These functions evaluate the Legendre polynomial Pₗ(x) for a specific value of l, x.
sub legendre-Pl-deriv-array(UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre)
These functions compute arrays of Legendre polynomials Pₗ(x) and derivatives dPₗ(x)/dx for l = 0 … lmax.
These routines compute the Legendre function Q₀(x).
These routines compute the Legendre function Q₁(x).
These routines compute the Legendre function Qₗ(x).
This function returns the index into the result array, corresponding to Pⁿₗ(x), P’ⁿₗ, or P”ⁿₗ(x).
sub legendre-array(Int $norm, size_t $lmax where * ≤ 150, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre)
sub legendre-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1, Num(Cool) $csphase where * == 1|-1 --> List) is export(:legendre)
These functions calculate all normalized associated Legendre polynomials. The parameter norm specifies the normalization to be used.
sub legendre-deriv-array(Int $norm, size_t $lmax where * ≤ 150, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre)
sub legendre-deriv-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1, Num(Cool) $csphase where * == 1|-1 --> List) is export(:legendre)
These functions calculate all normalized associated Legendre functions and their first derivatives up to degree lmax. The parameter norm specifies the normalization to be used. They return a List of Pairs (that can be read as a Hash):
-
:out array of Pⁿₗ(x) values
-
:derout array of dPⁿₗ(x)/dx values
sub legendre-deriv-alt-array(Int $norm, size_t $lmax where * ≤ 150, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre)
sub legendre-deriv-alt-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1, Num(Cool) $csphase where * == 1|-1 --> List) is export(:legendre)
These functions calculate all normalized associated Legendre functions and their (alternate) first derivatives up to degree lmax. The parameter norm specifies the normalization to be used. To include or exclude the Condon-Shortley phase factor of (−1)ⁿ, set the parameter csphase to either −1 or 1 respectively. They return a List of Pairs (that can be read as a Hash):
-
:out array of Pⁿₗ(x) values
-
:derout array of dPⁿₗ(x)/dx values
sub legendre-deriv2-array(Int $norm, size_t $lmax where * ≤ 150, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre)
sub legendre-deriv2-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1, Num(Cool) $csphase where * == 1|-1 --> List) is export(:legendre)
These functions calculate all normalized associated Legendre functions and their first and second derivatives up to degree lmax. The parameter norm specifies the normalization to be used. They return a List of Pairs (that can be read as a Hash):
-
:out array of Pⁿₗ(x) values
-
:derout array of dPⁿₗ(x)/dx values
-
:derout2 array of d²Pⁿₗ(x)/d²x values
sub legendre-deriv2-alt-array(Int $norm, size_t $lmax where * ≤ 150, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre)
sub legendre-deriv2-alt-array-e(Int $norm, UInt $lmax, Num(Cool) $x where -1 ≤ * ≤ 1, Num(Cool) $csphase where * == 1|-1 --> List) is export(:legendre)
These functions calculate all normalized associated Legendre functions and their (alternate) first and second derivatives up to degree lmax. The parameter norm specifies the normalization to be used. To include or exclude the Condon-Shortley phase factor of (−1)ⁿ, set the parameter csphase to either −1 or 1 respectively. They return a List of Pairs (that can be read as a Hash):
-
:out array of normalized Pⁿₗ(x) values
-
:derout array of dPⁿₗ(cos(θ))/dθ values
-
:derout2 array of d²Pⁿₗ(cos(θ))/d²θ values
These routines compute the associated Legendre polynomial Pⁿₗ(x).
sub legendre-sphPlm-e(UInt $l, UInt $m, Num(Cool) $x where -1 ≤ * ≤ 1 --> List) is export(:legendre)
These routines compute the normalized associated Legendre polynomial.
These routines compute the irregular Spherical Conical Function.
These routines compute the regular Spherical Conical Function.
These routines compute the conical function P⁰.
These routines compute the conical function P¹.
sub conicalP-sph-reg(Int $l where * ≥ -1, Num(Cool) $lambda, Num(Cool) $x where * > -1 --> Num) is export(:legendre)
sub conicalP-sph-reg-e(Int $l where * ≥ -1, Num(Cool) $lambda, Num(Cool) $x where * > -1 --> List) is export(:legendre)
These routines compute the Regular Spherical Conical Function.
sub conicalP-cyl-reg(Int $m where * ≥ -1, Num(Cool) $lambda, Num(Cool) $x where * > -1 --> Num) is export(:legendre)
sub conicalP-cyl-reg-e(Int $m where * ≥ -1, Num(Cool) $lambda, Num(Cool) $x where * > -1 --> List) is export(:legendre)
These routines compute the Regular Cylindrical Conical Function.
These routines compute the zeroth radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space.
These routines compute the first radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space.
sub legendre-H3d(UInt $l, Num(Cool) $lambda, Num(Cool) $eta where * ≥ 0 --> Num) is export(:legendre)
sub legendre-H3d-e(UInt $l, Num(Cool) $lambda, Num(Cool) $eta where * ≥ 0 --> List) is export(:legendre)
These routines compute the l-th radial eigenfunction of the Laplacian on the 3-dimensional hyperbolic space.
sub legendre-H3d-array(UInt $lmax, Num(Cool) $lambda, Num(Cool) $eta where * ≥ 0 --> List) is export(:legendre)
This function computes an array of radial eigenfunctions.
These routines compute the logarithm of x.
These routines compute the logarithm of the magnitude of x.
This routine computes the complex logarithm of z = zᵣ + izᵢ. The returned parameters are the radial part, its error, θ in the range [−π, π], and its error.
These routines compute log(1 + x).
These routines compute log(1 + x) − x.
These routines compute the characteristic values aₙ(q), bₙ(q) of the Mathieu functions ceₙ(q, x) and seₙ(q, x), respectively.
These routines compute a series of Mathieu characteristic values aₙ(q), bₙ(q) for n from order_min to order_max inclusive.
These routines compute the angular Mathieu functions ceₙ(q, x) and seₙ(q, x), respectively.
sub mathieu-ce-array(Int $order-min, Int $order-max, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)
sub mathieu-se-array(Int $order-min, Int $order-max, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)
These routines compute a series of the angular Mathieu functions ceₙ(q, x) and seₙ(q, x) of order n from nmin to nmax inclusive.
sub mathieu-Mc(Int $j where * == 1|2, Int $n, Num(Cool) $q, Num(Cool) $x --> Num) is export(:mathieu)
sub mathieu-Mc-e(Int $j where * == 1|2, Int $n, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)
sub mathieu-Ms(Int $j where * == 1|2, Int $n, Num(Cool) $q, Num(Cool) $x --> Num) is export(:mathieu)
sub mathieu-Ms-e(Int $j where * == 1|2, Int $n, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)
These routines compute the radial j-th kind Mathieu functions Mcₙ(q, x) and Msₙ(q, x) of order n.
sub mathieu-Mc-array(Int $j where * == 1|2, Int $nmin, Int $nmax, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)
sub mathieu-Ms-array(Int $j where * == 1|2, Int $nmin, Int $nmax, Num(Cool) $q, Num(Cool) $x --> List) is export(:mathieu)
These routines compute a series of the radial Mathieu functions of kind j, with order from nmin to nmax inclusive.
These routines compute the power xⁿ for integer n.
These routines compute the Digamma function ψ(n) for positive integer n.
These routines compute the Digamma function ψ(x) for general x.
These routines compute the real part of the Digamma function on the line 1 + iy.
These routines compute the Trigamma function ψ’(n) for positive integer n.
These routines compute the Trigamma function ψ’(x) for general x.
These routines compute the polygamma function ψ⁽ⁿ⁾(x).
These routines compute the first synchrotron function.
These routines compute the second synchrotron function.
These routines compute the transport function J(2, x).
These routines compute the transport function J(3, x).
These routines compute the transport function J(4, x).
These routines compute the transport function J(5, x).
These routines compute the sine function sin(x).
These routines compute the cosine function cos(x).
These routines compute the hypotenuse function.
These routines compute sinc(x) = sin(πx)/(πx).
This function computes the complex sine.
This function computes the complex cosine.
This function computes the logarithm of the complex sine.
These routines compute log(sinh(x)).
These routines compute log(cosinh(x)).
This function converts the polar coordinates (r, θ) to rectilinear coordinates (x, y).
This function converts the rectilinear coordinates (x, y) to polar coordinates (r, θ).
These routines force the angle θ to lie in the range (−π, π].
These routines force the angle θ to lie in the range [0, 2π).
This routine computes the sine of an angle x with an associated absolute error dx, sin(x ± dx).
This routine computes the cosine of an angle x with an associated absolute error dx, cosin(x ± dx).
These routines compute the Riemann zeta function ζ(n).
These routines compute the Riemann zeta function ζ(s) for arbitrary s.
These routines compute ζ(n) − 1 for integer n.
These routines compute ζ(s) − 1 for arbitrary s.
These routines compute the Hurwitz zeta function ζ(t, q).
These routines compute the eta function η(n) for integer n.
These routines compute the eta function η(s) for arbitrary s.
For more details on libgsl see https://www.gnu.org/software/gsl/. The excellent C Library manual is available here https://www.gnu.org/software/gsl/doc/html/index.html, or here https://www.gnu.org/software/gsl/doc/latex/gsl-ref.pdf in PDF format.
This module requires the libgsl library to be installed. Please follow the instructions below based on your platform:
sudo apt install libgsl23 libgsl-dev libgslcblas0
That command will install libgslcblas0 as well, since it's used by the GSL.
libgsl23 and libgslcblas0 have a missing symbol on Ubuntu 18.04. I solved the issue installing the Debian Buster version of those three libraries:
-
http://http.us.debian.org/debian/pool/main/g/gsl/libgslcblas0_2.5+dfsg-6_amd64.deb
-
http://http.us.debian.org/debian/pool/main/g/gsl/libgsl23_2.5+dfsg-6_amd64.deb
-
http://http.us.debian.org/debian/pool/main/g/gsl/libgsl-dev_2.5+dfsg-6_amd64.deb
To install it using zef (a module management tool):
$ zef install Math::Libgsl::Function
Fernando Santagata nando.santagata@gmail.com
Copyright 2020 Fernando Santagata
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.