Next: Coordinate Transformations, Previous: Sums and Products, Up: Arithmetic

— Loadable Function: [`j`, `ierr`] = **besselj** (`alpha, x, opt`)

— Loadable Function: [`y`, `ierr`] = **bessely** (`alpha, x, opt`)

— Loadable Function: [`i`, `ierr`] = **besseli** (`alpha, x, opt`)

— Loadable Function: [`k`, `ierr`] = **besselk** (`alpha, x, opt`)

— Loadable Function: [`h`, `ierr`] = **besselh** (`alpha, k, x, opt`)

— Loadable Function: [

— Loadable Function: [

— Loadable Function: [

— Loadable Function: [

Compute Bessel or Hankel functions of various kinds:

`besselj`

- Bessel functions of the first kind.
`bessely`

- Bessel functions of the second kind.
`besseli`

- Modified Bessel functions of the first kind.
`besselk`

- Modified Bessel functions of the second kind.
`besselh`

- Compute Hankel functions of the first (
k= 1) or second (k= 2) kind.If the argument

optis supplied, the result is scaled by the`exp (-I*`

x`)`

fork= 1 or`exp (I*`

x`)`

fork= 2.If

alphais a scalar, the result is the same size asx. Ifxis a scalar, the result is the same size asalpha. Ifalphais a row vector andxis a column vector, the result is a matrix with`length (`

x`)`

rows and`length (`

alpha`)`

columns. Otherwise,alphaandxmust conform and the result will be the same size.The value of

alphamust be real. The value ofxmay be complex.If requested,

ierrcontains the following status information and is the same size as the result.

- Normal return.
- Input error, return
`NaN`

.- Overflow, return
`Inf`

.- Loss of significance by argument reduction results in less than half of machine accuracy.
- Complete loss of significance by argument reduction, return
`NaN`

.- Error—no computation, algorithm termination condition not met, return
`NaN`

.

— Loadable Function: [`a`, `ierr`] = **airy** (`k, z, opt`)

Compute Airy functions of the first and second kind, and their derivatives.

K Function Scale factor (if a third argument is supplied) --- -------- ---------------------------------------------- 0 Ai (Z) exp ((2/3) * Z * sqrt (Z)) 1 dAi(Z)/dZ exp ((2/3) * Z * sqrt (Z)) 2 Bi (Z) exp (-abs (real ((2/3) * Z *sqrt (Z)))) 3 dBi(Z)/dZ exp (-abs (real ((2/3) * Z *sqrt (Z))))The function call

`airy (`

z`)`

is equivalent to`airy (0,`

z`)`

.The result is the same size as

z.If requested,

ierrcontains the following status information and is the same size as the result.

- Normal return.
- Input error, return
`NaN`

.- Overflow, return
`Inf`

.- Loss of significance by argument reduction results in less than half of machine accuracy.
- Complete loss of significance by argument reduction, return
`NaN`

.- Error—no computation, algorithm termination condition not met, return
`NaN`

— Mapping Function: **beta** (`a, b`)

Return the Beta function,

beta (a, b) = gamma (a) * gamma (b) / gamma (a + b).

— Mapping Function: **betainc** (`x, a, b`)

Return the incomplete Beta function,

x / betainc (x, a, b) = beta (a, b)^(-1) | t^(a-1) (1-t)^(b-1) dt. / t=0If x has more than one component, both

aandbmust be scalars. Ifxis a scalar,aandbmust be of compatible dimensions.

— Mapping Function: **bincoeff** (`n, k`)

Return the binomial coefficient of

nandk, defined as/ \ | n | n (n-1) (n-2) ... (n-k+1) | | = ------------------------- | k | k! \ /For example,

bincoeff (5, 2) => 10

— Mapping Function: **erf** (`z`)

Computes the error function,

z / erf (z) = (2/sqrt (pi)) | e^(-t^2) dt / t=0

— Mapping Function: **gamma** (`z`)

Computes the Gamma function,

infinity / gamma (z) = | t^(z-1) exp (-t) dt. / t=0

— Mapping Function: **gammainc** (`x, a`)

Compute the normalized incomplete gamma function,

x 1 / gammainc (x, a) = --------- | exp (-t) t^(a-1) dt gamma (a) / t=0with the limiting value of 1 as

xapproaches infinity. The standard notation is P(a,x), e.g. Abramowitz and Stegun (6.5.1).If

ais scalar, then`gammainc (`

x`,`

a`)`

is returned for each element ofxand vice versa.If neither

xnorais scalar, the sizes ofxandamust agree, andgammaincis applied element-by-element.

— Mapping Function: **lgamma** (`x`)

— Mapping Function:**gammaln** (`x`)

— Mapping Function:

Return the natural logarithm of the gamma function.

— Function File: **cross** (`x, y, dim`)

Computes the vector cross product of the two 3-dimensional vectors

xandy.cross ([1,1,0], [0,1,1]) => [ 1; -1; 1 ]If

xandyare matrices, the cross product is applied along the first dimension with 3 elements. The optional argumentdimis used to force the cross product to be calculated along the dimension defiend bydim.

— Function File: **commutation_matrix** (`m, n`)

Return the commutation matrix K(m,n) which is the unique

m*nbym*nmatrix such that K(m,n) * vec(A) = vec(A') for all m by n matrices A.If only one argument

mis given, K(m,m) is returned.See Magnus and Neudecker (1988), Matrix differential calculus with applications in statistics and econometrics.