specfun_module Module

Computation of special functions

Shanjie Zhang and Jianming Jin

Copyrighted but permission granted to use code in programs. Buy their book "Computation of Special Functions", 1996, John Wiley & Sons, Inc.

Scipy changes:

  • Compiled into a single source file and changed REAL To DBLE throughout.
  • Changed according to ERRATA.
  • Changed GAMMA to GAMMA2 and PSI to PSI_SPEC to avoid potential conflicts.
  • Made functions return sf_error codes in ISFER variables instead of printing warnings. The codes are:

    • SF_ERROR_OK = 0 : no error
    • SF_ERROR_SINGULAR = 1 : singularity encountered
    • SF_ERROR_UNDERFLOW = 2 : floating point underflow
    • SF_ERROR_OVERFLOW = 3 : floating point overflow
    • SF_ERROR_SLOW = 4 : too many iterations required
    • SF_ERROR_LOSS = 5 : loss of precision
    • SF_ERROR_NO_RESULT = 6 : no result obtained
    • SF_ERROR_DOMAIN = 7 : out of domain
    • SF_ERROR_ARG = 8 : invalid input parameter
    • SF_ERROR_OTHER = 9 : unclassified error

Uses

  • module~~specfun_module~~UsesGraph module~specfun_module specfun_module iso_fortran_env iso_fortran_env module~specfun_module->iso_fortran_env

Variables

Type Visibility Attributes Name Initial
integer, private, parameter :: wp = real64

Real working precision if not specified [8 bytes]

integer, public, parameter :: specfun_wp = wp

Working precision

real(kind=wp), private, parameter :: pi = acos(-1.0_wp)
real(kind=wp), private, parameter :: sqrtpi = sqrt(pi)
real(kind=wp), private, parameter :: halfpi = 0.5_wp*pi
real(kind=wp), private, parameter :: twopi = 2.0_wp*pi
real(kind=wp), private, parameter :: sq2 = sqrt(2.0_wp)
real(kind=wp), public, parameter :: gamma = 0.57721566490153286060651209008240243104215933593992_wp

Euler's constant to 50 decimal places. .5772156649015329D0 in the original code


Functions

public function dnan()

Arguments

None

Return Value real(kind=wp)

public function dinf()

Arguments

None

Return Value real(kind=wp)

public function msta1(x, Mp) result(nn)

Determine the starting point for backward recurrence such that the magnitude of Jn(x) at that point is about 10^(-MP)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Argument of Jn(x)

integer, intent(in) :: Mp

Value of magnitude

Return Value integer

Starting point

public function msta2(x, n, Mp) result(nn)

Determine the starting point for backward recurrence such that all Jn(x) has MP significant digits

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Argument of Jn(x)

integer, intent(in) :: n

Order of Jn(x)

integer, intent(in) :: Mp

Significant digit

Return Value integer

Starting point

public function envj(n, x)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real(kind=wp), intent(in) :: x

Return Value real(kind=wp)


Subroutines

public subroutine cpdsa(n, z, Cdn)

Compute complex parabolic cylinder function Dn(z) for small argument

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Order of D(z) (n = 0,-1,-2,...)

complex(kind=wp), intent(in) :: z

complex argument of D(z)

complex(kind=wp), intent(out) :: Cdn

Dn(z)

public subroutine cfs(z, Zf, Zd)

Compute complex Fresnel Integral S(z) and S'(z)

Arguments

Type IntentOptional Attributes Name
complex(kind=wp), intent(in) :: z

Argument of S(z)

complex(kind=wp), intent(out) :: Zf

S(z)

complex(kind=wp), intent(out) :: Zd

S'(z)

public subroutine lqmn(mm, m, n, x, Qm, Qd)

Compute the associated Legendre functions of the second kind, Qmn(x) and Qmn'(x)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: mm

Physical dimension of QM and QD

integer, intent(in) :: m

Order of Qmn(x) ( m = 0,1,2,… )

integer, intent(in) :: n

Degree of Qmn(x) ( n = 0,1,2,… )

real(kind=wp), intent(in) :: x

Argument of Qmn(x)

real(kind=wp), intent(out) :: Qm(0:Mm,0:n)

Qmn(x)

real(kind=wp), intent(out) :: Qd(0:Mm,0:n)

Qmn'(x)

public subroutine clpmn(mm, m, n, x, y, ntype, Cpm, Cpd)

Compute the associated Legendre functions Pmn(z) and their derivatives Pmn'(z) for a complex argument

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: mm

Physical dimension of CPM and CPD

integer, intent(in) :: m

Order of Pmn(z), m = 0,1,2,...,n

integer, intent(in) :: n

Degree of Pmn(z), n = 0,1,2,...,N

real(kind=wp), intent(in) :: x

Real part of z

real(kind=wp), intent(in) :: y

Imaginary part of z

integer, intent(in) :: ntype

type of cut, either 2 or 3

complex(kind=wp), intent(out) :: Cpm(0:Mm,0:n)

Pmn(z)

complex(kind=wp), intent(out) :: Cpd(0:Mm,0:n)

Pmn'(z)

public subroutine vvsa(Va, x, Pv)

Compute parabolic cylinder function Vv(x) for small argument

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: Va

Order

real(kind=wp), intent(in) :: x

Argument

real(kind=wp), intent(out) :: Pv

Vv(x)

public subroutine jdzo(Nt, n, m, p, Zo)

Compute the zeros of Bessel functions Jn(x) and Jn'(x), and arrange them in the order of their magnitudes

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Nt

Number of total zeros ( NT ≤ 1200 )

integer, intent(out) :: n(1400)

n, order of Jn(x) or Jn'(x) associated with the L-th zero

integer, intent(out) :: m(1400)

m, serial number of the zeros of Jn(x) or Jn'(x) associated with the L-th zero ( L is the serial number of all the zeros of Jn(x) and Jn'(x) )

integer, intent(out) :: p(1400)

0 (TM) or 1 (TE), a code for designating the zeros of Jn(x) or Jn'(x). In the waveguide applications, the zeros of Jn(x) correspond to TM modes and those of Jn'(x) correspond to TE modes

real(kind=wp), intent(out) :: Zo(0:1400)

Value of the L-th zero of Jn(x) and Jn'(x)

public subroutine cbk(m, n, c, Cv, Qt, Ck, Bk)

Compute coefficient Bk's for oblate radial functions with a small argument

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: m
integer, intent(in) :: n
real(kind=wp), intent(in) :: c
real(kind=wp), intent(in) :: Cv
real(kind=wp), intent(in) :: Qt
real(kind=wp), intent(in) :: Ck(200)
real(kind=wp), intent(out) :: Bk(200)

public subroutine rmn2sp(m, n, c, x, Cv, Df, Kd, R2f, R2d)

Compute prolate spheroidal radial function of the second kind with a small argument

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: m
integer, intent(in) :: n
real(kind=wp) :: c
real(kind=wp) :: x
real(kind=wp) :: Cv
real(kind=wp) :: Df(200)
integer :: Kd
real(kind=wp), intent(out) :: R2f
real(kind=wp), intent(out) :: R2d

public subroutine bernob(n, Bn)

Compute Bernoulli number Bn

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Serial number

real(kind=wp), intent(out) :: Bn(0:n)

Bn

public subroutine bernoa(n, Bn)

Compute Bernoulli number Bn

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Serial number

real(kind=wp), intent(out) :: Bn(0:n)

Bn

public subroutine qstar(m, n, c, Ck, Ck1, Qs, Qt)

Compute Q*mn(-ic) for oblate radial functions with a small argument

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: m
integer, intent(in) :: n
real(kind=wp), intent(in) :: c
real(kind=wp), intent(in) :: Ck(200)
real(kind=wp), intent(in) :: Ck1
real(kind=wp), intent(out) :: Qs
real(kind=wp), intent(out) :: Qt

public subroutine cv0(Kd, m, q, a0)

Compute the initial characteristic value of Mathieu functions for m ≤ 12 or q ≤ 300 or q ≥ m*m

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Kd
integer, intent(in) :: m

Order of Mathieu functions

real(kind=wp), intent(in) :: q

Parameter of Mathieu functions

real(kind=wp), intent(out) :: a0

Characteristic value

public subroutine cvqm(m, q, a0)

Compute the characteristic value of Mathieu functions for q ≤ m*m

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: m

Order of Mathieu functions

real(kind=wp), intent(in) :: q

Parameter of Mathieu functions

real(kind=wp), intent(out) :: a0

Initial characteristic value

public subroutine cvql(Kd, m, q, a0)

Compute the characteristic value of Mathieu functions for q ≥ 3m

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Kd
integer, intent(in) :: m

Order of Mathieu functions

real(kind=wp), intent(in) :: q

Parameter of Mathieu functions

real(kind=wp), intent(out) :: a0

Initial characteristic value

public subroutine ittjyb(x, Ttj, Tty)

Integrate [1-J0(t)]/t with respect to t from 0 to x, and Y0(t)/t with respect to t from x to ∞

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Variable in the limits ( x ≥ 0 )

real(kind=wp), intent(out) :: Ttj

Integration of [1-J0(t)]/t from 0 to x

real(kind=wp), intent(out) :: Tty

Integration of Y0(t)/t from x to ∞

public subroutine ittjya(x, Ttj, Tty)

Integrate [1-J0(t)]/t with respect to t from 0 to x, and Y0(t)/t with respect to t from x to ∞

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Variable in the limits ( x ≥ 0 )

real(kind=wp), intent(out) :: Ttj

Integration of [1-J0(t)]/t from 0 to x

real(kind=wp), intent(out) :: Tty

Integration of Y0(t)/t from x to ∞

public subroutine cjylv(v, z, Cbjv, Cdjv, Cbyv, Cdyv)

Compute Bessel functions Jv(z) and Yv(z) and their derivatives with a complex argument and a large order

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: v

Order of Jv(z) and Yv(z)

complex(kind=wp), intent(in) :: z

Complex argument

real(kind=wp), intent(out) :: Cbjv

Jv(z)

real(kind=wp), intent(out) :: Cdjv

Jv'(z)

real(kind=wp), intent(out) :: Cbyv

Yv(z)

real(kind=wp), intent(out) :: Cdyv

Yv'(z)

public subroutine rmn2l(m, n, c, x, Df, Kd, R2f, R2d, Id)

Compute prolate and oblate spheroidal radial functions of the second kind for given m, n, c and a large cx

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
real(kind=wp) :: x
real(kind=wp), dimension(200) :: Df
integer :: Kd
real(kind=wp) :: R2f
real(kind=wp) :: R2d
integer :: Id

public subroutine psi_spec(x, Ps)

Compute Psi function

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Argument of psi(x)

real(kind=wp), intent(out) :: Ps

psi(x)

public subroutine cva2(Kd, m, q, a)

Calculate a specific characteristic value of Mathieu functions

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Kd

Case code:

Read more…
integer, intent(in) :: m

Order of Mathieu functions

real(kind=wp), intent(in) :: q

Parameter of Mathieu functions

real(kind=wp), intent(out) :: a

Characteristic value

public subroutine lpmns(m, n, x, Pm, Pd)

Compute associated Legendre functions Pmn(x) and Pmn'(x) for a given order

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: m

Order of Pmn(x), m = 0,1,2,...,n

integer, intent(in) :: n

Degree of Pmn(x), n = 0,1,2,...,N

real(kind=wp), intent(in) :: x

Argument of Pmn(x)

real(kind=wp), intent(out) :: Pm(0:n)

Pmn(x)

real(kind=wp), intent(out) :: Pd(0:n)

Pmn'(x)

public subroutine cerf(z, Cer, Cder)

Compute complex Error function erf(z) & erf'(z)

Arguments

Type IntentOptional Attributes Name
complex(kind=wp), intent(in) :: z

Complex argument of erf(z)

complex(kind=wp), intent(out) :: Cer

erf(z)

complex(kind=wp), intent(out) :: Cder

erf'(z)

public subroutine rswfp(m, n, c, x, cv, Kf, R1f, R1d, R2f, R2d)

Compute prolate spheriodal radial functions of the first and second kinds, and their derivatives

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: m

Mode parameter, m = 0,1,2,...

integer, intent(in) :: n

Mode parameter, n = m,m+1,m+2,...

real(kind=wp), intent(in) :: c

Spheroidal parameter

real(kind=wp), intent(in) :: x

Argument of radial function ( x > 1.0 )

real(kind=wp), intent(in) :: cv

Characteristic value

integer, intent(in) :: Kf

Function code: * KF=1 for the first kind * KF=2 for the second kind * KF=3 for both the first and second kinds

real(kind=wp), intent(out) :: R1f

Radial function of the first kind

real(kind=wp), intent(out) :: R1d

Derivative of the radial function of the first kind

real(kind=wp), intent(out) :: R2f

Radial function of the second kind

real(kind=wp), intent(out) :: R2d

Derivative of the radial function of the second kind

public subroutine jyndd(n, x, Bjn, Djn, Fjn, Byn, Dyn, Fyn)

Compute Bessel functions Jn(x) and Yn(x), and their first and second derivatives

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Order of Jn(x) and Yn(x)

real(kind=wp), intent(in) :: x

Argument of Jn(x) and Yn(x) ( x > 0 )

real(kind=wp), intent(out) :: Bjn

Jn(x)

real(kind=wp), intent(out) :: Djn

Jn'(x)

real(kind=wp), intent(out) :: Fjn

Jn"(x)

real(kind=wp), intent(out) :: Byn

Yn(x)

real(kind=wp), intent(out) :: Dyn

Yn'(x)

real(kind=wp), intent(out) :: Fyn

Yn"(x)

public subroutine gam0(x, Ga)

Compute gamma function Г(x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Argument of Г(x) ( |x| ≤ 1 )

real(kind=wp), intent(out) :: Ga

Г(x)

public subroutine cisib(x, Ci, Si)

Compute cosine and sine integrals Si(x) and Ci(x) ( x ≥ 0 )

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Argument of Ci(x) and Si(x)

real(kind=wp), intent(out) :: Ci

Ci(x)

real(kind=wp), intent(out) :: Si

Si(x)

public subroutine eulera(n, En)

Compute Euler number En

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Serial number

real(kind=wp), intent(out) :: En(0:n)

En

public subroutine refine(Kd, m, q, a)

calculate the accurate characteristic value by the secant method

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Kd
integer, intent(in) :: m

Order of Mathieu functions

real(kind=wp), intent(in) :: q

Parameter of Mathieu functions

real(kind=wp), intent(inout) :: a

Parameter of Mathieu functions

public subroutine cisia(x, Ci, Si)

Compute cosine and sine integrals Si(x) and Ci(x) ( x ≥ 0 )

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Argument of Ci(x) and Si(x)

real(kind=wp), intent(out) :: Ci

Ci(x)

real(kind=wp), intent(out) :: Si

Si(x)

public subroutine itsl0(x, Tl0)

Evaluate the integral of modified Struve function L0(t) with respect to t from 0 to x

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Upper limit ( x ≥ 0 )

real(kind=wp), intent(out) :: Tl0

Integration of L0(t) from 0 to x

public subroutine clqn(n, x, y, Cqn, Cqd)

Compute the Legendre functions Qn(z) and their derivatives Qn'(z) for a complex argument

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Degree of Qn(z), n = 0,1,2,...

real(kind=wp), intent(in) :: x

Real part of z

real(kind=wp), intent(in) :: y

Imaginary part of z

complex(kind=wp), intent(out) :: Cqn(0:n)

Cqn

complex(kind=wp), intent(out) :: Cqd(0:n)

Cqd

public subroutine airyzo(Nt, Kf, Xa, Xb, Xc, Xd)

Compute the first NT zeros of Airy functions Ai(x) and Ai'(x), a and a', and the associated values of Ai(a') and Ai'(a); and the first NT zeros of Airy functions Bi(x) and Bi'(x), b and b', and the associated values of Bi(b') and Bi'(b)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Nt

Total number of zeros

integer, intent(in) :: Kf

Function code:

Read more…
real(kind=wp), intent(out) :: Xa(Nt)

a, the m-th zero of Ai(x) or b, the m-th zero of Bi(x)

real(kind=wp), intent(out) :: Xb(Nt)

a', the m-th zero of Ai'(x) or b', the m-th zero of Bi'(x)

real(kind=wp), intent(out) :: Xc(Nt)

Ai(a') or Bi(b')

real(kind=wp), intent(out) :: Xd(Nt)

Ai'(a) or Bi'(b) ( The index is the serial number of zeros )

public subroutine error(x, Err)

Compute error function erf(x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Argument of erf(x)

real(kind=wp), intent(out) :: Err

erf(x)

public subroutine cerror(z, Cer)

Compute error function erf(z) for a complex argument (z=x+iy)

Arguments

Type IntentOptional Attributes Name
complex(kind=wp), intent(in) :: z

Complex argument

complex(kind=wp), intent(out) :: Cer

erf(z)

public subroutine eulerb(n, En)

Compute Euler number En

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Serial number

real(kind=wp), intent(out) :: En(0:n)

En

public subroutine cva1(Kd, m, q, Cv)

Compute a sequence of characteristic values of Mathieu functions

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Kd

Case code:

Read more…
integer, intent(in) :: m

Maximum order of Mathieu functions

real(kind=wp), intent(in) :: q

Parameter of Mathieu functions

real(kind=wp), intent(out) :: Cv(200)

CV(I) --- Characteristic values; I = 1,2,3,...

Read more…

public subroutine ittikb(x, Tti, Ttk)

Integrate [I0(t)-1]/t with respect to t from 0 to x, and K0(t)/t with respect to t from x to ∞

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Variable in the limits ( x ≥ 0 )

real(kind=wp), intent(out) :: Tti

Integration of [I0(t)-1]/t from 0 to x

real(kind=wp), intent(out) :: Ttk

Integration of K0(t)/t from x to ∞

public subroutine lqnb(n, x, Qn, Qd)

Compute Legendre functions Qn(x) & Qn'(x)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Degree of Qn(x) ( n = 0,1,2,…)

real(kind=wp), intent(in) :: x

Argument of Qn(x)

real(kind=wp), intent(out) :: Qn(0:n)

Qn(x)

real(kind=wp), intent(out) :: Qd(0:n)

Qn'(x)

public subroutine cjk(Km, a)

Compute the expansion coefficients for the asymptotic expansion of Bessel functions with large orders

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: Km

Maximum k

real(kind=wp), intent(out), dimension(*) :: a

A(L) --- Cj(k) where j and k are related to L by L=j+1+[k*(k+1)]/2; j,k=0,1,...,Km

public subroutine ittika(x, Tti, Ttk)

Integrate [I0(t)-1]/t with respect to t from 0 to x, and K0(t)/t with respect to t from x to ∞

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: x

Variable in the limits ( x ≥ 0 )

real(kind=wp), intent(out) :: Tti

Integration of [I0(t)-1]/t from 0 to x

real(kind=wp), intent(out) :: Ttk

Integration of K0(t)/t from x to ∞

public subroutine lamv(v, xi, Vm, Vl, Dl)

Compute lambda function with arbitrary order v, and their derivative

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: v

Order of lambda function

real(kind=wp), intent(in) :: xi

Argument of lambda function

real(kind=wp), intent(out) :: Vm

Highest order computed

real(kind=wp), intent(out), dimension(0:*) :: Vl

Lambda function of order n+v0

real(kind=wp), intent(out), dimension(0:*) :: Dl

Derivative of lambda function

public subroutine chguit(a, b, x, Hu, Id)

Compute hypergeometric function U(a,b,x) by using Gaussian-Legendre integration (n=60)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: a

Parameter ( a > 0 )

real(kind=wp), intent(in) :: b

Parameter

real(kind=wp), intent(in) :: x

Argument ( x > 0 )

real(kind=wp), intent(out) :: Hu

U(a,b,z)

integer, intent(out) :: Id

Estimated number of significant digits

public subroutine kmn(m, n, c, Cv, Kd, Df, Dn, Ck1, Ck2)

Compute the expansion coefficients of the prolate and oblate spheroidal functions and joining factors

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
real(kind=wp) :: Cv
integer :: Kd
real(kind=wp), dimension(200) :: Df
real(kind=wp), dimension(200) :: Dn
real(kind=wp) :: Ck1
real(kind=wp) :: Ck2

public subroutine lagzo(n, x, w)

Compute the zeros of Laguerre polynomial Ln(x) in the interval [0,∞], and the corresponding weighting coefficients for Gauss-Laguerre integration

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n

Order of the Laguerre polynomial

real(kind=wp), intent(out), dimension(n) :: x

Zeros of the Laguerre polynomial

real(kind=wp), intent(out), dimension(n) :: w

Corresponding weighting coefficients

public subroutine vvla(Va, x, Pv)

Compute parabolic cylinder function Vv(x) for large argument

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: Va

Order

real(kind=wp), intent(in) :: x

Argument

real(kind=wp), intent(out) :: Pv

Vv(x)

public subroutine cjyva(v, z, Vm, Cbj, Cdj, Cby, Cdy)

Compute Bessel functions Jv(z), Yv(z) and their derivatives for a complex argument

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: v

Order of Jv(z) and Yv(z) ( v = n+v0, n = 0,1,2,..., 0 ≤ v0 < 1)

complex(kind=wp), intent(in) :: z

Complex argument

integer, intent(out) :: Vm

Highest order computed

complex(kind=wp), intent(out), dimension(0:*) :: Cbj

CBJ(n) --- Jn+v0(z)

complex(kind=wp), intent(out), dimension(0:*) :: Cdj

CDJ(n) --- Jn+v0'(z)

complex(kind=wp), intent(out), dimension(0:*) :: Cby

CBY(n) --- Yn+v0(z)

complex(kind=wp), intent(out), dimension(0:*) :: Cdy

CDY(n) --- Yn+v0'(z)

public subroutine cjyvb(v, z, Vm, Cbj, Cdj, Cby, Cdy)

Compute Bessel functions Jv(z), Yv(z) and their derivatives for a complex argument

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: v
complex(kind=wp) :: z
real(kind=wp) :: Vm
complex(kind=wp), dimension(0:*) :: Cbj
complex(kind=wp), dimension(0:*) :: Cdj
complex(kind=wp), dimension(0:*) :: Cby
complex(kind=wp), dimension(0:*) :: Cdy

public subroutine jy01a(x, Bj0, Dj0, Bj1, Dj1, By0, Dy0, By1, Dy1)

Compute Bessel functions J0(x), J1(x), Y0(x), Y1(x), and their derivatives

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Bj0
real(kind=wp) :: Dj0
real(kind=wp) :: Bj1
real(kind=wp) :: Dj1
real(kind=wp) :: By0
real(kind=wp) :: Dy0
real(kind=wp) :: By1
real(kind=wp) :: Dy1

public subroutine incog(a, x, Gin, Gim, Gip, Isfer)

Compute the incomplete gamma function r(a,x), Г(a,x) and P(a,x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a
real(kind=wp) :: x
real(kind=wp) :: Gin
real(kind=wp) :: Gim
real(kind=wp) :: Gip
integer :: Isfer

public subroutine itikb(x, Ti, Tk)

Integrate Bessel functions I0(t) and K0(t) with respect to t from 0 to x

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Ti
real(kind=wp) :: Tk

public subroutine itika(x, Ti, Tk)

Integrate modified Bessel functions I0(t) and K0(t) with respect to t from 0 to x

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Ti
real(kind=wp) :: Tk

public subroutine jyv(v, x, Vm, Bj, Dj, By, Dy)

Compute Bessel functions Jv(x) and Yv(x) and their derivatives

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: v
real(kind=wp) :: x
real(kind=wp) :: Vm
real(kind=wp), dimension(0:*) :: Bj
real(kind=wp), dimension(0:*) :: Dj
real(kind=wp), dimension(0:*) :: By
real(kind=wp), dimension(0:*) :: Dy

public subroutine jynb(n, x, Nm, Bj, Dj, By, Dy)

Compute Bessel functions Jn(x), Yn(x) and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n) :: Bj
real(kind=wp), dimension(0:n) :: Dj
real(kind=wp), dimension(0:n) :: By
real(kind=wp), dimension(0:n) :: Dy

public subroutine jynbh(n, Nmin, x, Nm, Bj, By)

Compute Bessel functions Jn(x), Yn(x)

Arguments

Type IntentOptional Attributes Name
integer :: n
integer :: Nmin
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n-nmin) :: Bj
real(kind=wp), dimension(0:n-nmin) :: By

public subroutine legzo(n, x, w)

Compute the zeros of Legendre polynomial Pn(x) in the interval [-1,1], and the corresponding weighting coefficients for Gauss-Legendre integration

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp), dimension(n) :: x
real(kind=wp), dimension(n) :: w

public subroutine aswfa(m, n, c, x, Kd, Cv, S1f, S1d)

Compute the prolate and oblate spheroidal angular functions of the first kind and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
real(kind=wp) :: x
integer :: Kd
real(kind=wp) :: Cv
real(kind=wp) :: S1f
real(kind=wp) :: S1d

public subroutine jyna(n, x, Nm, Bj, Dj, By, Dy)

Compute Bessel functions Jn(x) & Yn(x) and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n) :: Bj
real(kind=wp), dimension(0:n) :: Dj
real(kind=wp), dimension(0:n) :: By
real(kind=wp), dimension(0:n) :: Dy

public subroutine pbdv(v, x, Dv, Dp, Pdf, Pdd)

Compute parabolic cylinder functions Dv(x) and their derivatives

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: v
real(kind=wp) :: x
real(kind=wp), dimension(0:*) :: Dv
real(kind=wp), dimension(0:*) :: Dp
real(kind=wp) :: Pdf
real(kind=wp) :: Pdd

public subroutine itsh0(x, Th0)

Evaluate the integral of Struve function H0(t) with respect to t from 0 and x

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Th0

public subroutine cerzo(Nt, Zo)

Evaluate the complex zeros of error function erf(z) using the modified Newton's iteration method

Arguments

Type IntentOptional Attributes Name
integer :: Nt
complex(kind=wp), dimension(nt) :: Zo

public subroutine gamma2(x, Ga)

Compute gamma function Г(x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Ga

public subroutine chgu(a, b, x, Hu, Md, Isfer)

Compute the confluent hypergeometric function U(a,b,x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a
real(kind=wp) :: b
real(kind=wp) :: x
real(kind=wp) :: Hu
integer :: Md
integer :: Isfer

public subroutine lamn(n, x, Nm, Bl, Dl)

Compute lambda functions and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n) :: Bl
real(kind=wp), dimension(0:n) :: Dl

public subroutine comelp(Hk, Ck, Ce)

Compute complete elliptic integrals K(k) and E(k)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: Hk
real(kind=wp) :: Ck
real(kind=wp) :: Ce

public subroutine incob(a, b, x, Bix)

Compute the incomplete beta function Ix(a,b)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a
real(kind=wp) :: b
real(kind=wp) :: x
real(kind=wp) :: Bix

public subroutine cvf(Kd, m, q, a, Mj, f)

Compute the value of F for characteristic equation of Mathieu functions

Arguments

Type IntentOptional Attributes Name
integer :: Kd
integer :: m
real(kind=wp) :: q
real(kind=wp) :: a
integer :: Mj
real(kind=wp) :: f

public subroutine clpn(n, x, y, Cpn, Cpd)

Compute Legendre polynomials Pn(z) and their derivatives Pn'(z) for a complex argument

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
real(kind=wp) :: y
complex(kind=wp), dimension(0:n) :: Cpn
complex(kind=wp), dimension(0:n) :: Cpd

public subroutine lqmns(m, n, x, Qm, Qd)

Compute associated Legendre functions Qmn(x) and Qmn'(x) for a given order

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: x
real(kind=wp), dimension(0:n) :: Qm
real(kind=wp), dimension(0:n) :: Qd

public subroutine ciklv(v, z, Cbiv, Cdiv, Cbkv, Cdkv)

Compute modified Bessel functions Iv(z) and Kv(z) and their derivatives with a complex argument and a large order

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: v
complex(kind=wp) :: z
complex(kind=wp) :: Cbiv
complex(kind=wp) :: Cdiv
complex(kind=wp) :: Cbkv
complex(kind=wp) :: Cdkv

public subroutine elit(Hk, Phi, Fe, Ee)

Compute complete and incomplete elliptic integrals F(k,phi) and E(k,phi)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: Hk
real(kind=wp) :: Phi
real(kind=wp) :: Fe
real(kind=wp) :: Ee

public subroutine elit3(Phi, Hk, c, El3)

Compute the elliptic integral of the third kind using Gauss-Legendre quadrature

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: Phi
real(kind=wp) :: Hk
real(kind=wp) :: c
real(kind=wp) :: El3

public subroutine eix(x, Ei)

Compute exponential integral Ei(x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Ei

public subroutine eixz(z, Cei)

Compute exponential integral Ei(x)

Arguments

Type IntentOptional Attributes Name
complex(kind=wp) :: z
complex(kind=wp) :: Cei

public subroutine e1xb(x, e1)

Compute exponential integral E1(x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: e1

public subroutine chgm(a, b, x, Hg)

Compute confluent hypergeometric function M(a,b,x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a
real(kind=wp) :: b
real(kind=wp) :: x
real(kind=wp) :: Hg

public subroutine hygfx(a, b, c, x, Hf, Isfer)

Compute hypergeometric function F(a,b,c,x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a
real(kind=wp) :: b
real(kind=wp) :: c
real(kind=wp) :: x
real(kind=wp) :: Hf
integer :: Isfer

public subroutine cchg(a, b, z, Chg)

Compute confluent hypergeometric function M(a,b,z) with real parameters a, b and a complex argument z

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a
real(kind=wp) :: b
complex(kind=wp) :: z
complex(kind=wp) :: Chg

public subroutine hygfz(a, b, c, z, Zhf, Isfer)

Compute the hypergeometric function for a complex argument, F(a,b,c,z)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a
real(kind=wp) :: b
real(kind=wp) :: c
complex(kind=wp) :: z
complex(kind=wp) :: Zhf
integer :: Isfer

public subroutine itairy(x, Apt, Bpt, Ant, Bnt)

Compute the integrals of Airy fnctions with respect to t from 0 and x ( x ≥ 0 )

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Apt
real(kind=wp) :: Bpt
real(kind=wp) :: Ant
real(kind=wp) :: Bnt

public subroutine ikna(n, x, Nm, Bi, Di, Bk, Dk)

Compute modified Bessel functions In(x) and Kn(x), and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n) :: Bi
real(kind=wp), dimension(0:n) :: Di
real(kind=wp), dimension(0:n) :: Bk
real(kind=wp), dimension(0:n) :: Dk

public subroutine cjynb(n, z, Nm, Cbj, Cdj, Cby, Cdy)

Compute Bessel functions Jn(z), Yn(z) and their derivatives for a complex argument

Arguments

Type IntentOptional Attributes Name
integer :: n
complex(kind=wp) :: z
integer :: Nm
complex(kind=wp), dimension(0:n) :: Cbj
complex(kind=wp), dimension(0:n) :: Cdj
complex(kind=wp), dimension(0:n) :: Cby
complex(kind=wp), dimension(0:n) :: Cdy

public subroutine iknb(n, x, Nm, Bi, Di, Bk, Dk)

Compute modified Bessel functions In(x) and Kn(x), and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n) :: Bi
real(kind=wp), dimension(0:n) :: Di
real(kind=wp), dimension(0:n) :: Bk
real(kind=wp), dimension(0:n) :: Dk

public subroutine lpmn(Mm, m, n, x, Pm, Pd)

Compute the associated Legendre functions Pmn(x) and their derivatives Pmn'(x) for real argument

Arguments

Type IntentOptional Attributes Name
integer :: Mm
integer :: m
integer :: n
real(kind=wp) :: x
real(kind=wp), dimension(0:mm,0:n) :: Pm
real(kind=wp), dimension(0:mm,0:n) :: Pd

public subroutine mtu0(Kf, m, q, x, Csf, Csd)

Compute Mathieu functions cem(x,q) and sem(x,q) and their derivatives ( q ≥ 0 )

Arguments

Type IntentOptional Attributes Name
integer :: Kf
integer :: m
real(kind=wp) :: q
real(kind=wp) :: x
real(kind=wp) :: Csf
real(kind=wp) :: Csd

public subroutine cy01(Kf, z, Zf, Zd)

Compute complex Bessel functions Y0(z), Y1(z) and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: Kf
complex(kind=wp) :: z
complex(kind=wp) :: Zf
complex(kind=wp) :: Zd

public subroutine ffk(Ks, x, Fr, Fi, Fm, Fa, Gr, Gi, Gm, Ga)

Compute modified Fresnel integrals F±(x) and K±(x)

Arguments

Type IntentOptional Attributes Name
integer :: Ks
real(kind=wp) :: x
real(kind=wp) :: Fr
real(kind=wp) :: Fi
real(kind=wp) :: Fm
real(kind=wp) :: Fa
real(kind=wp) :: Gr
real(kind=wp) :: Gi
real(kind=wp) :: Gm
real(kind=wp) :: Ga

public subroutine airya(x, Ai, Bi, Ad, Bd)

Compute Airy functions and their derivatives

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Ai
real(kind=wp) :: Bi
real(kind=wp) :: Ad
real(kind=wp) :: Bd

public subroutine airyb(x, Ai, Bi, Ad, Bd)

Compute Airy functions and their derivatives

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Ai
real(kind=wp) :: Bi
real(kind=wp) :: Ad
real(kind=wp) :: Bd

public subroutine scka(m, n, c, Cv, Kd, Ck)

Compute the expansion coefficients of the prolate and oblate spheroidal functions, c2k

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
real(kind=wp) :: Cv
integer :: Kd
real(kind=wp), dimension(200) :: Ck

public subroutine sckb(m, n, c, Df, Ck)

Compute the expansion coefficients of the prolate and oblate spheroidal functions

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
real(kind=wp), dimension(200) :: Df
real(kind=wp), dimension(200) :: Ck

public subroutine cpdla(n, z, Cdn)

Compute complex parabolic cylinder function Dn(z) for large argument

Arguments

Type IntentOptional Attributes Name
integer :: n
complex(kind=wp) :: z
complex(kind=wp) :: Cdn

public subroutine fcszo(Kf, Nt, Zo)

Compute the complex zeros of Fresnel integral C(z) or S(z) using modified Newton's iteration method

Arguments

Type IntentOptional Attributes Name
integer :: Kf
integer :: Nt
complex(kind=wp), dimension(nt) :: Zo

public subroutine e1xa(x, e1)

Compute exponential integral E1(x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: e1

public subroutine lpmv0(v, m, x, Pmv)

Compute the associated Legendre function Pmv(x) with an integer order and an arbitrary nonnegative degree v

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: v
integer :: m
real(kind=wp) :: x
real(kind=wp) :: Pmv

public subroutine lpmv(v, m, x, Pmv)

Compute the associated Legendre function Pmv(x) with an integer order and an arbitrary degree v, using recursion for large degrees

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: v
integer :: m
real(kind=wp) :: x
real(kind=wp) :: Pmv

public subroutine cgama(x, y, Kf, Gr, Gi)

Compute the gamma function Г(z) or ln[Г(z)] for a complex argument

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: y
integer :: Kf
real(kind=wp) :: Gr
real(kind=wp) :: Gi

public subroutine aswfb(m, n, c, x, Kd, Cv, S1f, S1d)

Compute the prolate and oblate spheroidal angular functions of the first kind and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
real(kind=wp) :: x
integer :: Kd
real(kind=wp) :: Cv
real(kind=wp) :: S1f
real(kind=wp) :: S1d

public subroutine chgus(a, b, x, Hu, Id)

Compute confluent hypergeometric function U(a,b,x) for small argument x

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a
real(kind=wp) :: b
real(kind=wp) :: x
real(kind=wp) :: Hu
integer :: Id

public subroutine itth0(x, Tth)

Evaluate the integral H0(t)/t with respect to t from x to infinity

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Tth

public subroutine lgama(Kf, x, Gl)

Compute gamma function Г(x) or ln[Г(x)]

Arguments

Type IntentOptional Attributes Name
integer :: Kf
real(kind=wp) :: x
real(kind=wp) :: Gl

public subroutine lqna(n, x, Qn, Qd)

Compute Legendre functions Qn(x) and Qn'(x)

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
real(kind=wp), dimension(0:n) :: Qn
real(kind=wp), dimension(0:n) :: Qd

public subroutine dvla(Va, x, Pd)

Compute parabolic cylinder functions Dv(x) for large argument

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: Va
real(kind=wp) :: x
real(kind=wp) :: Pd

public subroutine ik01a(x, Bi0, Di0, Bi1, Di1, Bk0, Dk0, Bk1, Dk1)

Compute modified Bessel functions I0(x), I1(1), K0(x) and K1(x), and their derivatives

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Bi0
real(kind=wp) :: Di0
real(kind=wp) :: Bi1
real(kind=wp) :: Di1
real(kind=wp) :: Bk0
real(kind=wp) :: Dk0
real(kind=wp) :: Bk1
real(kind=wp) :: Dk1

public subroutine cpbdn(n, z, Cpb, Cpd)

Compute the parabolic cylinder functions Dn(z) and Dn'(z) for a complex argument

Arguments

Type IntentOptional Attributes Name
integer :: n
complex(kind=wp) :: z
complex(kind=wp), dimension(0:*) :: Cpb
complex(kind=wp), dimension(0:*) :: Cpd

public subroutine ik01b(x, Bi0, Di0, Bi1, Di1, Bk0, Dk0, Bk1, Dk1)

Compute modified Bessel functions I0(x), I1(1), K0(x) and K1(x), and their derivatives

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Bi0
real(kind=wp) :: Di0
real(kind=wp) :: Bi1
real(kind=wp) :: Di1
real(kind=wp) :: Bk0
real(kind=wp) :: Dk0
real(kind=wp) :: Bk1
real(kind=wp) :: Dk1

public subroutine beta(p, q, Bt)

Compute the beta function B(p,q)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: p
real(kind=wp) :: q
real(kind=wp) :: Bt

public subroutine lpn(n, x, Pn, Pd)

Compute Legendre polynomials Pn(x) and their derivatives Pn'(x)

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
real(kind=wp), dimension(0:n) :: Pn
real(kind=wp), dimension(0:n) :: Pd

public subroutine fcoef(Kd, m, q, a, Fc)

Compute expansion coefficients for Mathieu functions and modified Mathieu functions

Arguments

Type IntentOptional Attributes Name
integer :: Kd
integer :: m
real(kind=wp) :: q
real(kind=wp) :: a
real(kind=wp), dimension(251) :: Fc

public subroutine sphi(n, x, Nm, Si, Di)

Compute modified spherical Bessel functions of the first kind, in(x) and in'(x)

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n) :: Si
real(kind=wp), dimension(0:n) :: Di

public subroutine pbwa(a, x, W1f, W1d, W2f, W2d)

Compute parabolic cylinder functions W(a,±x) and their derivatives

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a
real(kind=wp) :: x
real(kind=wp) :: W1f
real(kind=wp) :: W1d
real(kind=wp) :: W2f
real(kind=wp) :: W2d

public subroutine rmn1(m, n, c, x, Df, Kd, R1f, R1d)

Compute prolate and oblate spheroidal radial functions of the first kind for given m, n, c and x

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
real(kind=wp) :: x
real(kind=wp), dimension(200) :: Df
integer :: Kd
real(kind=wp) :: R1f
real(kind=wp) :: R1d

public subroutine dvsa(Va, x, Pd)

Compute parabolic cylinder function Dv(x) for small argument

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: Va
real(kind=wp) :: x
real(kind=wp) :: Pd

public subroutine e1z(z, Ce1)

Compute complex exponential integral E1(z)

Arguments

Type IntentOptional Attributes Name
complex(kind=wp) :: z
complex(kind=wp) :: Ce1

public subroutine itjyb(x, Tj, Ty)

Integrate Bessel functions J0(t) and Y0(t) with respect to t from 0 to x ( x ≥ 0 )

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Tj
real(kind=wp) :: Ty

public subroutine chgul(a, b, x, Hu, Id)

Compute the confluent hypergeometric function U(a,b,x) for large argument x

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a
real(kind=wp) :: b
real(kind=wp) :: x
real(kind=wp) :: Hu
integer :: Id

public subroutine gmn(m, n, c, x, Bk, Gf, Gd)

Compute gmn(-ic,ix) and its derivative for oblate radial functions with a small argument

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
real(kind=wp) :: x
real(kind=wp), dimension(200) :: Bk
real(kind=wp) :: Gf
real(kind=wp) :: Gd

public subroutine itjya(x, Tj, Ty)

Integrate Bessel functions J0(t) & Y0(t) with respect to t from 0 to x

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Tj
real(kind=wp) :: Ty

public subroutine rcty(n, x, Nm, Ry, Dy)

Compute Riccati-Bessel functions of the second kind and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n) :: Ry
real(kind=wp), dimension(0:n) :: Dy

public subroutine lpni(n, x, Pn, Pd, Pl)

Compute Legendre polynomials Pn(x), Pn'(x) and the integral of Pn(t) from 0 to x

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
real(kind=wp), dimension(0:n) :: Pn
real(kind=wp), dimension(0:n) :: Pd
real(kind=wp), dimension(0:n) :: Pl

public subroutine klvna(x, Ber, Bei, Ger, Gei, Der, Dei, Her, Hei)

Compute Kelvin functions ber x, bei x, ker x and kei x, and their derivatives ( x > 0 )

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Ber
real(kind=wp) :: Bei
real(kind=wp) :: Ger
real(kind=wp) :: Gei
real(kind=wp) :: Der
real(kind=wp) :: Dei
real(kind=wp) :: Her
real(kind=wp) :: Hei

public subroutine chgubi(a, b, x, Hu, Id)

Compute confluent hypergeometric function U(a,b,x) with integer b ( b = ±1,±2,... )

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: a
real(kind=wp) :: b
real(kind=wp) :: x
real(kind=wp) :: Hu
integer :: Id

public subroutine cyzo(Nt, Kf, Kc, Zo, Zv)

Compute the complex zeros of Y0(z), Y1(z) and Y1'(z), and their associated values at the zeros using the modified Newton's iteration method

Arguments

Type IntentOptional Attributes Name
integer :: Nt
integer :: Kf
integer :: Kc
complex(kind=wp), dimension(nt) :: Zo
complex(kind=wp), dimension(nt) :: Zv

public subroutine klvnb(x, Ber, Bei, Ger, Gei, Der, Dei, Her, Hei)

Compute Kelvin functions ber x, bei x, ker x and kei x, and their derivatives ( x > 0 )

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Ber
real(kind=wp) :: Bei
real(kind=wp) :: Ger
real(kind=wp) :: Gei
real(kind=wp) :: Der
real(kind=wp) :: Dei
real(kind=wp) :: Her
real(kind=wp) :: Hei

public subroutine rmn2so(m, n, c, x, Cv, Df, Kd, R2f, R2d)

Compute oblate radial functions of the second kind with a small argument, Rmn(-ic,ix) & Rmn'(-ic,ix)

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
real(kind=wp) :: x
real(kind=wp) :: Cv
real(kind=wp), dimension(200) :: Df
integer :: Kd
real(kind=wp) :: R2f
real(kind=wp) :: R2d

public subroutine bjndd(n, x, Bj, Dj, Fj)

Compute Bessel functions Jn(x) and their first and second derivatives ( n= 0,1,… )

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
real(kind=wp), dimension(101) :: Bj
real(kind=wp), dimension(101) :: Dj
real(kind=wp), dimension(101) :: Fj

public subroutine sphj(n, x, Nm, Sj, Dj)

Compute spherical Bessel functions jn(x) and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n) :: Sj
real(kind=wp), dimension(0:n) :: Dj

public subroutine othpl(Kf, n, x, Pl, Dpl)

Compute orthogonal polynomials: Tn(x) or Un(x), or Ln(x) or Hn(x), and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: Kf
integer :: n
real(kind=wp) :: x
real(kind=wp), dimension(0:n) :: Pl
real(kind=wp), dimension(0:n) :: Dpl

public subroutine klvnzo(Nt, Kd, Zo)

Compute the zeros of Kelvin functions

Arguments

Type IntentOptional Attributes Name
integer :: Nt
integer :: Kd
real(kind=wp), dimension(nt) :: Zo

public subroutine rswfo(m, n, c, x, Cv, Kf, R1f, R1d, R2f, R2d)

Compute oblate radial functions of the first and second kinds, and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
real(kind=wp) :: x
real(kind=wp) :: Cv
integer :: Kf
real(kind=wp) :: R1f
real(kind=wp) :: R1d
real(kind=wp) :: R2f
real(kind=wp) :: R2d

public subroutine ch12n(n, z, Nm, Chf1, Chd1, Chf2, Chd2)

Compute Hankel functions of the first and second kinds and their derivatives for a complex argument

Arguments

Type IntentOptional Attributes Name
integer :: n
complex(kind=wp) :: z
integer :: Nm
complex(kind=wp), dimension(0:n) :: Chf1
complex(kind=wp), dimension(0:n) :: Chd1
complex(kind=wp), dimension(0:n) :: Chf2
complex(kind=wp), dimension(0:n) :: Chd2

public subroutine jyzo(n, Nt, Rj0, Rj1, Ry0, Ry1)

Compute the zeros of Bessel functions Jn(x), Yn(x), and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: n
integer :: Nt
real(kind=wp), dimension(nt) :: Rj0
real(kind=wp), dimension(nt) :: Rj1
real(kind=wp), dimension(nt) :: Ry0
real(kind=wp), dimension(nt) :: Ry1

public subroutine ikv(v, x, Vm, Bi, Di, Bk, Dk)

Compute modified Bessel functions Iv(x) and Kv(x), and their derivatives

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: v
real(kind=wp) :: x
real(kind=wp) :: Vm
real(kind=wp), dimension(0:*) :: Bi
real(kind=wp), dimension(0:*) :: Di
real(kind=wp), dimension(0:*) :: Bk
real(kind=wp), dimension(0:*) :: Dk

public subroutine sdmn(m, n, c, Cv, Kd, Df)

Compute the expansion coefficients of the prolate and oblate spheroidal functions, dk

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
real(kind=wp) :: Cv
integer :: Kd
real(kind=wp), dimension(200) :: Df

public subroutine ajyik(x, Vj1, Vj2, Vy1, Vy2, Vi1, Vi2, Vk1, Vk2)

Compute Bessel functions Jv(x) and Yv(x), and modified Bessel functions Iv(x) and Kv(x), and their derivatives with v=1/3,2/3

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Vj1
real(kind=wp) :: Vj2
real(kind=wp) :: Vy1
real(kind=wp) :: Vy2
real(kind=wp) :: Vi1
real(kind=wp) :: Vi2
real(kind=wp) :: Vk1
real(kind=wp) :: Vk2

public subroutine cikvb(v, z, Vm, Cbi, Cdi, Cbk, Cdk)

Compute the modified Bessel functions Iv(z), Kv(z) and their derivatives for an arbitrary order and complex argument

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: v
complex(kind=wp) :: z
real(kind=wp) :: Vm
complex(kind=wp), dimension(0:*) :: Cbi
complex(kind=wp), dimension(0:*) :: Cdi
complex(kind=wp), dimension(0:*) :: Cbk
complex(kind=wp), dimension(0:*) :: Cdk

public subroutine cikva(v, z, Vm, Cbi, Cdi, Cbk, Cdk)

Compute the modified Bessel functions Iv(z), Kv(z) and their derivatives for an arbitrary order and complex argument

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: v
complex(kind=wp) :: z
real(kind=wp) :: Vm
complex(kind=wp), dimension(0:*) :: Cbi
complex(kind=wp), dimension(0:*) :: Cdi
complex(kind=wp), dimension(0:*) :: Cbk
complex(kind=wp), dimension(0:*) :: Cdk

public subroutine cfc(z, Zf, Zd)

Compute complex Fresnel integral C(z) and C'(z)

Arguments

Type IntentOptional Attributes Name
complex(kind=wp) :: z
complex(kind=wp) :: Zf
complex(kind=wp) :: Zd

public subroutine fcs(x, c, s)

Compute Fresnel integrals C(x) and S(x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: c
real(kind=wp) :: s

public subroutine rctj(n, x, Nm, Rj, Dj)

Compute Riccati-Bessel functions of the first kind and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n) :: Rj
real(kind=wp), dimension(0:n) :: Dj

public subroutine herzo(n, x, w)

Compute the zeros of Hermite polynomial Ln(x) in the interval [-∞,∞], and the corresponding weighting coefficients for Gauss-Hermite integration

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp), dimension(n) :: x
real(kind=wp), dimension(n) :: w

public subroutine jy01b(x, Bj0, Dj0, Bj1, Dj1, By0, Dy0, By1, Dy1)

Compute Bessel functions J0(x), J1(x), Y0(x), Y1(x), and their derivatives

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Bj0
real(kind=wp) :: Dj0
real(kind=wp) :: Bj1
real(kind=wp) :: Dj1
real(kind=wp) :: By0
real(kind=wp) :: Dy0
real(kind=wp) :: By1
real(kind=wp) :: Dy1

public subroutine enxb(n, x, En)

Compute exponential integral En(x)

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
real(kind=wp), dimension(0:n) :: En

public subroutine sphk(n, x, Nm, Sk, Dk)

Compute modified spherical Bessel functions of the second kind, kn(x) and kn'(x)

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n) :: Sk
real(kind=wp), dimension(0:n) :: Dk

public subroutine enxa(n, x, En)

Compute exponential integral En(x)

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
real(kind=wp), dimension(0:n) :: En

public subroutine gaih(x, Ga)

Compute gamma function Г(x)

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: Ga

public subroutine pbvv(v, x, Vv, Vp, Pvf, Pvd)

Compute parabolic cylinder functions Vv(x) and their derivatives

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: v
real(kind=wp) :: x
real(kind=wp), dimension(0:*) :: Vv
real(kind=wp), dimension(0:*) :: Vp
real(kind=wp) :: Pvf
real(kind=wp) :: Pvd

public subroutine clqmn(Mm, m, n, x, y, Cqm, Cqd)

Compute the associated Legendre functions of the second kind, Qmn(z) and Qmn'(z), for a complex argument

Arguments

Type IntentOptional Attributes Name
integer :: Mm
integer :: m
integer :: n
real(kind=wp) :: x
real(kind=wp) :: y
complex(kind=wp), dimension(0:mm,0:n) :: Cqm
complex(kind=wp), dimension(0:mm,0:n) :: Cqd

public subroutine segv(m, n, c, Kd, Cv, Eg)

Compute the characteristic values of spheroidal wave functions

Arguments

Type IntentOptional Attributes Name
integer :: m
integer :: n
real(kind=wp) :: c
integer :: Kd
real(kind=wp) :: Cv
real(kind=wp), dimension(200) :: Eg

public subroutine ciknb(n, z, Nm, Cbi, Cdi, Cbk, Cdk)

Compute modified Bessel functions In(z) and Kn(z), and their derivatives for a complex argument

Arguments

Type IntentOptional Attributes Name
integer :: n
complex(kind=wp) :: z
integer :: Nm
complex(kind=wp), dimension(0:n) :: Cbi
complex(kind=wp), dimension(0:n) :: Cdi
complex(kind=wp), dimension(0:n) :: Cbk
complex(kind=wp), dimension(0:n) :: Cdk

public subroutine cikna(n, z, Nm, Cbi, Cdi, Cbk, Cdk)

Compute modified Bessel functions In(z), Kn(x) and their derivatives for a complex argument

Arguments

Type IntentOptional Attributes Name
integer :: n
complex(kind=wp) :: z
integer :: Nm
complex(kind=wp), dimension(0:n) :: Cbi
complex(kind=wp), dimension(0:n) :: Cdi
complex(kind=wp), dimension(0:n) :: Cbk
complex(kind=wp), dimension(0:n) :: Cdk

public subroutine mtu12(Kf, Kc, m, q, x, F1r, D1r, F2r, D2r)

Compute modified Mathieu functions of the first and second kinds, Mcm(1)(2)(x,q) and Msm(1)(2)(x,q), and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: Kf
integer :: Kc
integer :: m
real(kind=wp) :: q
real(kind=wp) :: x
real(kind=wp) :: F1r
real(kind=wp) :: D1r
real(kind=wp) :: F2r
real(kind=wp) :: D2r

public subroutine cik01(z, Cbi0, Cdi0, Cbi1, Cdi1, Cbk0, Cdk0, Cbk1, Cdk1)

Compute modified Bessel functions I0(z), I1(z), K0(z), K1(z), and their derivatives for a complex argument

Arguments

Type IntentOptional Attributes Name
complex(kind=wp) :: z
complex(kind=wp) :: Cbi0
complex(kind=wp) :: Cdi0
complex(kind=wp) :: Cbi1
complex(kind=wp) :: Cdi1
complex(kind=wp) :: Cbk0
complex(kind=wp) :: Cdk0
complex(kind=wp) :: Cbk1
complex(kind=wp) :: Cdk1

public subroutine cpsi(x, y, Psr, Psi)

Compute the psi function for a complex argument

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: x
real(kind=wp) :: y
real(kind=wp) :: Psr
real(kind=wp) :: Psi

public subroutine sphy(n, x, Nm, Sy, Dy)

Compute spherical Bessel functions yn(x) and their derivatives

Arguments

Type IntentOptional Attributes Name
integer :: n
real(kind=wp) :: x
integer :: Nm
real(kind=wp), dimension(0:n) :: Sy
real(kind=wp), dimension(0:n) :: Dy

public subroutine jelp(u, Hk, Esn, Ecn, Edn, Eph)

Compute Jacobian elliptic functions sn u, cn u and dn u

Arguments

Type IntentOptional Attributes Name
real(kind=wp) :: u
real(kind=wp) :: Hk
real(kind=wp) :: Esn
real(kind=wp) :: Ecn
real(kind=wp) :: Edn
real(kind=wp) :: Eph