#############################################################################
#
#   SETL2 Native Package Specification of the procedures in 
#
#         "Numerical Recipes in C"
#
#############################################################################
#
# Package Name:
libnr
	--#############################################################################
	--#
	--#      C H A P T E R   2   -  Solution of Linear Algebraic Equations
	--#
	--#############################################################################
	-- 
	-- ******* Matrix inversion and decomposition routines ******* 
	-- 
gaussj:rw,fmatA(n;n)|rw,fmatB(n;m):fmatA->p,n,fmatB->p,m
	-- Gauss-Jordan solution of Ax = b for square A; replaces A by its inverse, and B by the solution 
ludcmp:rw,fmatA(n;n)|w,ivectB(n)|w,floatD:fmatA->p,n,ivectB->p,&floatD
	-- LUP decomposition. The matrix A is replaced by its LU decomposition, with (implicits) 1's in the diagonal of
	-- L, and the integer vector B (which must be suppied as an input) returned as the permutation needed
	-- in the factorization; D (which must be suppied) is the sign of this permutation. 
mprove:r,fmatA(n;n)|r,fmatALUD(n;n)|r,ivectINDX(n)|r,fvectB(n)|rw,fvectX(n):fmatA->p,fmatALUD->p,n,ivectINDX->p,fvectB->p,fvectX->p
	-- improves the accuracy  of the solution of a linear equation  obtained by the LU method
lubksb:r,fmatA(n;n)|r,ivectB(n)|w,fvectD(n):fmatA->p,n,ivectB->p,fvectD->p
	-- solution-by backsubstitution routine. Here fmatA and ivectB should be the matrix and vector returned 
	-- by the ludcmp routine. The vector fvectD is converted into the solution of Ax = D, where A is the
	-- original square matrix.
tridag:r,fvectA(n)|r,fvectB(n)|r,fvectC(n)|r,fvectR(n)|w,fvectU(n):fvectA->p,fvectB->p,fvectC->p,fvectR->p,fvectU->p,n
	-- solution of tridiagonal system. A, B, and C are the subdiagonal, diagonal, and superdiagonal respectively.
	-- r is the right-hand side; U, which must be supplied as an input, is the output. The first component of 
	-- A and the last component of C must be suppied, but are ignored.
banmul:r,fmatA(n;m)|r,integerM1|r,integerM2|r,fvectX(n)|w,fvectB(n):fmatA->p,n,integerM1,integerM2,fvectX->p,fvectB->p
	-- multiplies a pair of matrices stored in band diagonal form.
bandec:rw,fmatA(n;m)|r,integerM1|r,integerM2|w,fmatAL(n;integerM1)|w,ulvectINDX(n)|rw,floatD:fmatA->p,n,integerM1,integerM2,fmatAL->p,ulvectINDX->p,&floatD
	-- calculates lup factorization of a band-diagonal matrix.
banbks:r,fmatA(n;m)|r,integerM1|r,integerM2|r,fmatAL(n;integerM1)|r,ulvectINDX(n)|rw,fvectB(n):fmatA->p,n,integerM1,integerM2,fmatAL->p,ulvectINDX->p,fvectB->p
	-- backsubstitution routine for matrices stored in band diagonal form.
svdcmp:rw,fmatA(m;n)|w,fvectW(n)|w,fmatV(n;n):fmatA->p,m,n,fvectW->p,fmatV->p
	-- singular value decomposition of the matrix A, which must be an m by n matrix with a larger number m of rows
	-- than n of columns. The matrix is factored into the prodcut of an orthogonal matrix U of the same dimensions,
	-- which replaces 
dsvdcmp:rw,dmatA(m;n)|w,dvectW(n)|w,dmatV(n;n):dmatA->p,m,n,dvectW->p,dmatV->p
	-- double  precision singular value decomposition of a matrix. See the comment to 'svdcmp'
svbksb:r,fmatU(m;n)|r,fvectW(n)|r,fmatV(n;n)|r,fvectB(m)|w,fvectX(n):fmatU->p,fvectW->p,fmatV->p,m,n,fvectB->p,fvectX->p
	-- solution-by backsubstitution routine which solves Ax = B using the matrices U, V, and W procuced by svdcmp.
	-- the vector X, which must be  
dsvbksb:r,dmatU(m;n)|r,dvectW(n)|r,dmatV(n;n)|r,dvectB(m)|w,dvectX(n):dmatU->p,dvectW->p,dmatV->p,m,n,dvectB->p,dvectX->p
	-- double precision backsubstitution routine. See the comment to 'svbksb'
cyclic:r,fvectA(n)|r,fvectB(n)|r,fvectC(n)|r,floatALPHA|r,floatBETA|r,fvectR(n)|w,fvectX(n):fvectA->p,fvectB->p,fvectC->p,floatALPHA,floatBETA,fvectR->p,fvectX->p,n
	-- 
	-- ******* Sparse matrix routines ******* 
	-- 
sprsin:r,fmatA(n;n)|r,floatTHRESH|rw,fvectSA(m)|rw,ulvectIJA(m):fmatA->p,n,floatTHRESH,m,fvectSA->p,ulvectIJA->p
		-- converts a square matrix A into row-indexed sparse form. THRESH is the cutoff value for nonzero elements.
		-- SA is the packed array of retained elements; IJA is an integer array that indicates the matrix position
		-- of these elements. The (rather complex) storage rule used is as follows:
sprsax:r,fvectSA(m)|r,ulvectIJA(m)|r,fvectX(n)|w,fvectB(n):fvectSA->p,ulvectIJA->p,fvectX->p,fvectB->p,n
		-- multiplies standard vector by sparse matrix
dsprsax:r,dvectSA(m)|r,ulvectIJA(m)|r,dvectX(n)|w,dvectB(n):dvectSA->p,ulvectIJA->p,dvectX->p,dvectB->p,n
		-- multiplies standard vector by sparse matrix, double precision
sprstx:r,fvectSA(m)|r,ulvectIJA(m)|r,fvectX(n)|w,fvectB(n):fvectSA->p,ulvectIJA->p,fvectX->p,fvectB->p,n
		-- multiplies standard vector by transpose of sparse matrix
dsprstx:r,dvectSA(m)|r,ulvectIJA(m)|r,dvectX(n)|w,dvectB(n):dvectSA->p,ulvectIJA->p,dvectX->p,dvectB->p,n
		-- multiples standard vector by transpose of sparse matrix, double precision
sprstp:r,fvectSA(m)|r,ulvectIJA(m)|w,fvectSB(m)|rw,ulvectIJB(m):fvectSA->p,ulvectIJA->p,fvectSB->p,ulvectIJB->p
		-- construct the transpose of a sparse matrix
sprspm:r,fvectSA(m)|r,ulvectIJA(m)|r,fvectSB(m)|r,ulvectIJB(m)|w,fvectSC(m)|rw,ulvectIJC(m):fvectSA->p,ulvectIJA->p,fvectSB->p,ulvectIJB->p,fvectSC->p,ulvectIJC->p
		-- forms product of two sparse matrices
sprstm:r,fvectSA(m)|r,ulvectIJA(m)|r,fvectSB(m)|r,ulvectIJB(m)|r,floatTHRESH|w,fvectSC(m)|rw,ulvectIJC(m):fvectSA->p,ulvectIJA->p,fvectSB->p,ulvectIJB->p,floatTHRESH,m,fvectSC->p,ulvectIJC->p
		-- multiply sparse matrix SA by the transpose of sparse matrix SB, returning the result as SC
	-- 
	-- ******* Routines for specialized matrices ******* 
	-- 
nrlinbcg:r,dvectB(n)|rw,dvectX(n)|r,integerITOL|r,doubleTOL|r,integerITMAX|w,integerITER|w,doubleERR|r,vfuncASOLVE(i;d[];&d[];i)|r,vfuncATIMES(i;d[];&d[];i):n,dvectB->p,dvectX->p,integerITOL,doubleTOL,integerITMAX,&integerITER,&doubleERR,vfuncASOLVE,vfuncATIMES
		-- solution of Ax = b by conjugate gradient method.
#.....atimes:w,dvectX(n)|r,dvectR(n)|r,integerITRNSP:n,dvectX->p,dvectR->p,integerITRNSP
		-- subroutine for linbcg, which mimics multiplication by a sparse matrix, not explicitly given
#.....asolve:r,dvectB(n)|w,dvectX(n)|r,integerITRNSP:n,dvectB->p,dvectX->p,integerITRNSP
		-- subroutine for linbcg, which mimics multiplication by inverse of a preconditioner matrix, 
		-- not explicitly given
d*snrm:r,dvectSX(n)|r,integerITOL:n,dvectSX->p,integerITOL
		-- compute l2 or max morm of vector SX, signallled by ITOL <= 3
vander:r,dvectX(n)|w,dvectW(n)|r,dvectQ(n):dvectX->p,dvectW->p,dvectQ->p,n
		-- solution of Vandermonde linear system
toeplz:r,fvectR(m)|w,fvectX(n)|r,fvectY(n):fvectR->p,fvectX->p,fvectY->p,n
		-- solution of Toeplitz linear system 
choldc:rw,fmatA(n;n)|w,fvectP(n):fmatA->p,n,fvectP->p
		-- Cholesky decomposition of matrix
cholsl:r,fmatA(n;n)|r,fvectP(n)|r,fvectB(n)|w,fvectX(n):fmatA->p,n,fvectP->p,fvectB->p,fvectX->p
		-- solution of linear system using Cholesky decomposition
qrdcmp:rw,fmatA(n;n)|w,fvectC(n)|w,fvectD(n)|w,integerSIGN:fmatA->p,n,fvectC->p,fvectD->p,&integerSIGN
		-- QR decomposition of matrix
rsolv:r,fmatA(n;n)|r,fvectD(n)|rw,fvectB(n):fmatA->p,n,fvectD->p,fvectB->p
		-- solution of upper triangular linear system
qrsolv:r,fmatA(n;n)|r,fvectC(n)|r,fvectD(n)|rw,fvectB(n):fmatA->p,n,fvectC->p,fvectD->p,fvectB->p
		-- solution of linear system using QR decomposition
qrupdt:r,fmatR(n;n)|rw,fmatQT|rw,fvectU(n)|r,fvectV(n):fmatR->p,fmatQT->p,n,fvectU->p,fvectV->p
		-- update QR decomposition after additon of 1-D vector
rotate:rw,fmatR(n;n)|rw,fmatQT|r,integerI|r,floatA|r,floatB:fmatR->p,fmatQT->p,n,integerI,floatA,floatB
		-- subroutine for qrupdt: apply specified Jacobi ratation to a pair of matrices
	--#############################################################################
	--#
	--#      C H A P T E R   3   -  Interpolation and Extrapolation
	--#
	--#############################################################################
polint:r,fvectXA(n)|r,fvectYA(n)|r,floatX|w,floatY|w,floatDY:fvectXA->p,fvectYA->p,n,floatX,&floatY,&floatDY
	-- polynomial interpolation of vector of values
ratint:r,fvectXA(n)|r,fvectYA(n)|r,floatX|w,floatY|w,floatDY:fvectXA->p,fvectYA->p,n,floatX,&floatY,&floatDY
	-- rational interpolation of vector of values
spline:r,fvectX(n)|r,fvectY(n)|r,floatYP1|r,floatYPN|w,fvectY2(n):fvectX->p,fvectY->p,n,floatYP1,floatYPN,fvectY2->p
	-- compute second derivatives of cubic spline thru given points
splint:r,fvectXA(n)|r,fvectYA(n)|r,fvectY2A(n)|r,floatX|w,floatY:fvectXA->p,fvectYA->p,fvectY2A->p,n,floatX,&floatY
	-- spline interpolation of vector of values, using output of 'spline'
locate:r,fvectXX(n)|r,floatX|w,ulongJ:fvectXX->p,n,floatX,&ulongJ
	-- binary search in real array
hunt:r,fvectXX(n)|r,floatX|w,ulongJLO:fvectXX->p,n,floatX,&ulongJLO
	-- binary search in real array, using estimated target position
polcoe:r,fvectX(n)|r,fvectY(n)|w,fvectCOF(n):fvectX->0p,fvectY->0p,n-1,fvectCOF->0p
	-- solves Vandermonde equation for coefficients of interpolating polynomial given values at enough points
polcof:r,fvectXA(n)|r,fvectYA(n)|w,fvectCOF(n):fvectXA->0p,fvectYA->0p,n-1,fvectCOF->0p
	-- variant, slightly mopre stable, solution of  Vandermonde equation for coefficients 
	-- of interpolating polynomial given values at enough points
polin2:r,fvectX1A(m)|r,fvectX2A(n)|r,fmatYA(m;n)|r,floatX1|r,floatX2|w,floatY|w,floatDY:fvectX1A->p,fvectX2A->p,fmatYA->p,m,n,floatX1,floatX2,&floatY,&floatDY
	-- intepolates 2-variable polynomial given values on rectangular array of points
bcucof:r,fvectY(n)|r,fvectY1(n)|r,fvectY2(n)|r,fvectY12(n)|r,floatD1|r,floatD2|rw,fmatC(n;n):fvectY->p,fvectY1->p,fvectY2->p,fvectY12->p,floatD1,floatD2,fmatC->p
	-- (n must be 4) calculates coefficients of bicubic spline interpolation on a single grid square (subroutine for splie2 and splin2)
bcuint:r,fvectY(n)|r,fvectY1(n)|r,fvectY2(n)|r,fvectY12(n)|r,floatX1L|r,floatX1U|r,floatX2L|r,floatX2U|r,floatX1|r,floatX2|w,floatANSY|w,floatANSY1|w,floatANSY2:fvectY->p,fvectY1->p,fvectY2->p,fvectY12->p,floatX1L,floatX1U,floatX2L,floatX2U,floatX1,floatX2,&floatANSY,&floatANSY1,&floatANSY2
	-- interpolates bicubic spline on a single grid square (subroutine for splie2 and splin2)
splie2:r,fvectX1A(m)|r,fvectX2A(n)|r,fmatYA(m;n)|w,fmatY2A(m;n):fvectX1A->p,fvectX2A->p,fmatYA->p,m,n,fmatY2A->p
	-- computes second-derivative table for 2-D bicubic spline
splin2:r,fvectX1A(m)|r,fvectX2A(n)|r,fmatYA(m;n)|r,fmatY2A(m;n)|r,floatX1|r,floatX2|w,floatY:fvectX1A->p,fvectX2A->p,fmatYA->p,fmatY2A->p,m,n,floatX1,floatX2,&floatY
	-- computes 2-D bicubic spline interpolation using second-derivative table produced by 'splie2'
	--#############################################################################
	--#
	--#      C H A P T E R   4   -  Integration of Functions
	--#
	--#############################################################################
f*trapzd:r,ffuncF(f)|r,floatA|r,floatB|r,integerN:ffuncF,floatA,floatB,integerN
	-- computes successive refinements for extended trapezoidal rule; subroutine for 'qtrap'
f*qtrap:r,ffuncF(f)|r,floatA|r,floatB:ffuncF,floatA,floatB
	-- numerical 1-D function integration by trapezoidal rule
f*qsimp:r,ffuncF(f)|r,floatA|r,floatB:ffuncF,floatA,floatB
	-- numerical 1-D function integration by Simpson's rule
f*qromb:r,ffuncF(f)|r,floatA|r,floatB:ffuncF,floatA,floatB
	-- numerical 1-D function Romberg integration
f*midpnt:r,ffuncF(f)|r,floatA|r,floatB|r,integerN:ffuncF,floatA,floatB,integerN
	-- computes sucessive stages of refinement for extended midpoint rule open interval integration (subroutine for 'qromo')
#.....f*qromo:r,ffuncF(f)|r,floatA|r,floatB,ffuncCHOOSE(float (*)(float), float, float, int):
	-- Romberg integration adapted to use with improper integrals over open interval
f*midinf:r,ffuncF(f)|r,floatA|r,floatB|r,integerN:ffuncF,floatA,floatB,integerN
	-- computes sucessive stages of refinement for extended midpoint rule open interval integration in 1/x
	-- (subroutine for 'qromo')
f*midsql:r,ffuncF(f)|r,floatA|r,floatB|r,integerN:ffuncF,floatA,floatB,integerN
	-- variant of 'midpt' allowing for sqrt singlarity at lower limit of integration range (subroutine for 'qromo')
f*midsqu:r,ffuncF(f)|r,floatA|r,floatB|r,integerN:ffuncF,floatA,floatB,integerN
	--  variant of 'midpt' allowing for sqrt singlarity at upper limit of integration range (subroutine for 'qromo')
f*midexp:r,ffuncF(f)|r,floatA|r,floatB|r,integerN:ffuncF,floatA,floatB,integerN
	-- variant of 'midpt' allowing for infinite upper limit of integration (subroutine for 'qromo')
f*qgaus:r,ffuncF(f)|r,floatA|r,floatB:ffuncF,floatA,floatB
	-- numerical 1-D function integration by Gauss points-and-weights method
gauher:rw,fvectX(n)|w,fvectW(n)|r,n:fvectX->p,fvectW->p,n
	-- get Hermite polynomial points-and-weights 
gaucof:rw,fvectA(n)|r,fvectB(n)|r,floatAMU0|w,fvectX(n)|w,fvectW(n):n,fvectA->p,fvectB->p,floatAMU0,fvectX->p,fvectW->p
	-- computes recurrence coeffients for polynomials orthogonal in a weight with given moment,
	-- given coeffients defining recurrence coeffients for an auxiliary set of orthonal polynomials  
gaujac:rw,fvectX(n)|w,fvectW(n)|r,n|r,floatALF|r,floatBET:fvectX->p,fvectW->p,n,floatALF,floatBET
	-- get Jacobi polynomial points-and-weights 
gaulag:rw,fvectX(n)|w,fvectW(n)|r,n|r,floatALF:fvectX->p,fvectW->p,n,floatALF
	-- get Laguerre polynomial points-and-weights 
gauleg:r,floatX1|r,floatX2|rw,fvectX(n)|w,fvectW(n)|r,n:floatX1,floatX2,fvectX->p,fvectW->p,n
	-- get Legendre polynomial points-and-weights 
orthog:r,fvectANU(n)|r,fvectALPHA(n)|r,fvectBETA(n)|rw,fvectA(n)|rw,fvectB(n):n,fvectANU->p,fvectALPHA->p,fvectBETA->p,fvectA->p,fvectB->p
	-- calculates recurrence coefficients for general orthogonal polynomials, given moments
#d*quad3d:r,ffuncFUNC(f,f,f)|r,floatX1|r,floatX2:ffuncFUNC,floatX1,floatX2
	-- integration of function over 3-D region with curved boundaries gy recursive use of Gauss method
f*pythag:r,floatA|r,floatB:floatA,floatB
	-- sqrt(a**2 + b**2) 
d*dpythag:r,doubleA|r,doubleB:doubleA,doubleB
	-- sqrt(a**2 + b**2), double precision
	--#############################################################################
	--#
	--#      C H A P T E R   5   -  Evaluation of Functions
	--#
	--#############################################################################
f*chebev:r,floatA|r,floatB|r,fvectC(n)|r,floatX:floatA,floatB,fvectC->0p,n-1,floatX
	-- evaluates Chebyshev polynomial representation, given its coefficients
chebft:r,floatA|r,floatB|rw,fvectC(n)|r,ffuncFUNC(f):floatA,floatB,fvectC->0p,n-1,ffuncFUNC
	-- fits Chebyshev approximation with specified number of terms to specified function
chder:r,floatA|r,floatB|r,fvectC(n)|w,fvectCDER(n):floatA,floatB,fvectC->0p,fvectCDER->0p,n-1
	-- computes coefficients of differentiated Chebyshev approximation
chint:r,floatA|r,floatB|r,fvectC(n)|w,fvectCINT(n):floatA,floatB,fvectC->0p,fvectCINT->0p,n-1
	-- computes coefficients of integrated Chebyshev approximation
chebpc:r,fvectC(n)|w,fvectD(n):fvectC->0p,fvectD->0p,n-1
	-- convert Chebyshev polynomial sum to ordinary polynomial
pcshft:r,floatA|r,floatB|rw,fvectD(n):floatA,floatB,fvectD->0p,n-1
	-- map polynomial to a translated interval
pccheb:r,fvectD(n)|rw,fvectC(n):fvectD->0p,fvectC->0p,n-1
	-- convert polynomial to Chebyshev polynomial sum   
pade:rw,dvectCOF(n)|w,floatRESID:dvectCOF->0p,n/2,&floatRESID
	-- converts polynomial approximation to function into coeffients of Pade rational approximation
ratlsq:r,dfuncFUNC(d)|r,doubleA|r,doubleB|r,integerKK|r,dvectCOF(n)|w,doubleDEV:dfuncFUNC,doubleA,doubleB,n-integerKK-1,integerKK,dvectCOF->0p,&doubleDEV
	-- find Chebyshev polynomia-basedl rational approximation to given function
eulsum:rw,floatSUM|r,floatTERM|r,integerJTERM|rw,fvectWKSP(n):&floatSUM,floatTERM,integerJTERM,fvectWKSP->p                                                     
	-- accelerates series convergence by Euler differencing technique. Should be called repeatedly
	-- with successive terms of series.
ddpoly:r,fvectC(n)|r,doubleX|w,fvectPD(n):fvectC->0p,n-1,doubleX,fvectPD->0p,n-1
	-- evaluates poolynomial, with specifed number of derivatives, given coeffients
poldiv:r,fvectU(n)|r,fvectV(m)|w,fvectQ(n)|w,fvectR(n):fvectU->0p,n-1,fvectV->0p,m-1,fvectQ->0p,fvectR->0p
	-- polynomial division routine for polys with real coefficients
f*dfridr:r,ffuncFUNC(f)|r,floatX|r,floatH|w,floatERR:ffuncFUNC,floatX,floatH,&floatERR
	-- numerical approximation of derivative by Ridder extrapoloation method
	--#############################################################################
	--#
	--#      C H A P T E R   6   -  Special Functions
	--#
	--#############################################################################
beschb:r,doubleX|w,doubleGAM1|w,doubleGAM2|w,doubleGAMpl|w,doubleGAMmi:doubleX,&doubleGAM1,&doubleGAM2,&doubleGAMpl,&doubleGAMmi
		-- auxiliary gamma function calculation for bessjy
f*bessi0:r,floatX:floatX
		-- modified Bessel function I0
f*bessk0:r,floatX:floatX
		-- modified Bessel function K0
f*bessi1:r,floatX:floatX
		-- modified Bessel function I1
f*bessk1:r,floatX:floatX
		-- modified Bessel function K1
f*bessi:r,integerN|r,floatX:integerN,floatX
		-- modified Bessel function In
f*bessk:r,integerN|r,floatX:integerN,floatX
		-- modified Bessel function Kn
bessik:r,floatX|r,floatXNU|w,floatRI|w,floatRK|w,floatRIP|w,floatRKP:floatX,floatXNU,&floatRI,&floatRK,&floatRIP,&floatRKP
		-- modified Bessel functions of fractional order
f*bessj0:r,floatX:floatX
		-- Bessel function J0
f*bessy0:r,floatX:floatX
		-- Bessel function Y0
f*bessj1:r,floatX:floatX
		-- Bessel function J1
f*bessy1:r,floatX:floatX
		-- Bessel function Y1
f*bessj:r,integerN|r,floatX:integerN,floatX
		-- Bessel function Jn
f*bessy:r,integerN|r,floatX:integerN,floatX
		-- Bessel function Yn
bessjy:r,floatX|r,floatXNU|w,floatRJ|w,floatRY|w,floatRJp|w,floatRYp:floatX,floatXNU,&floatRJ,&floatRY,&floatRJp,&floatRYp
		-- Bessel functions of fractional order
f*betai:r,floatA|r,floatB|r,floatX:floatA,floatB,floatX
		-- incomplete beta function
f*betacf:r,floatA|r,floatB|r,floatX:floatA,floatB,floatX
		-- incomplete beta function continued fraction subroutine
f*bico:r,integerN|r,integerK:integerN,integerK
		-- binomial coefficent in floating-point form
f*dawson:r,floatX:floatX
		--Dawson's exponential integral
f*ei:r,floatX:floatX
		-- exponential integral for n = 1
f*ellf:r,floatPHI|r,floatAK:floatPHI,floatAK
		--Legendre elliptic integral of the first kind
f*elle:r,floatPHI|r,floatAK:floatPHI,floatAK
		--Legendre elliptic integral of the second kind
f*ellpi:r,floatPHI|r,floatEN|r,floatAK:floatPHI,floatEN,floatAK
		--Legendre elliptic integral of the third kind
f*erff:r,floatX:floatX
		-- error function (integral of gaussian distribution)
f*erffc:r,floatX:floatX
		-- complementary error function 
f*erfcc:r,floatX:floatX
		-- high precision complementary error function 
f*expint:r,integerNR|r,floatX:integerNR,floatX
		-- exponential integral 
f*factrl:r,integerN:integerN
		-- factorial function
f*factln:r,integerN:integerN
		-- log of factorial function
f*beta:r,floatZ|r,floatW:floatZ,floatW
		-- beta function
f*gammp:r,floatA|r,floatX:floatA,floatX
		-- incomplete gamma function
f*gammq:r,floatA|r,floatX:floatA,floatX
		-- complementary incomplete gamma function
f*gammln:r,floatXX:floatXX
		-- log of gamma function
gser:w,floatGAMSER|r,floatA|r,floatX|w,floatGLN:&floatGAMSER,floatA,floatX,&floatGLN
		-- retuens incomplete gamma function and its logarithm, evaluated using series representation
gcf:w,floatGAMMCF|r,floatA|r,floatX|w,floatGLN:&floatGAMMCF,floatA,floatX,&floatGLN
		-- incomplete gamma function from continued fraction representation
f*rf:r,floatX|r,floatY|r,floatZ:floatX,floatY,floatZ
		-- Carlson's elliptic integral of the first kind
#.....f*rd:r,floatX|r,floatY|r,floatZ:floatX,floatY,floatZ
		-- Carlson's elliptic integral of the second kind
f*rj:r,floatX|r,floatY|r,floatZ|r,floatP:floatX,floatY,floatZ,floatP
		-- Carlson's elliptic integral of the third kind
f*rc:r,floatX|r,floatY:floatX,floatY
		-- degenerate Carlson's elliptic integral
#new##########################################
airy:r,floatX|w,floatAI|w,floatBI|w,floatAIP|w,floatBIP:floatX,&floatAI,&floatBI,&floatAIP,&floatBIP
	-- Airy integral
cisi:r,floatX|w,floatCI|w,floatSI:floatX,&floatCI,&floatSI
	-- sine and cosine integrals
f*plgndr:r,integerL|r,integerM|r,floatX:integerL,integerM,floatX
	-- Legendre polynomials Plm(x)
sphbes:r,integerN|r,floatX|w,floatSJ|w,floatSY|w,floatSJP|w,floatSYP:integerN,floatX,&floatSJ,&floatSY,&floatSJP,&floatSYP
		-- spherical Bessel functions Jn, Yn, and their derivatives
frenel:r,floatX|w,floatS|w,floatC:floatX,&floatS,&floatC
	-- Fresnel integrals S aand C
sncndn:r,floatUU|r,floatEMMC|w,floatSN|w,floatCN|w,floatDN:floatUU,floatEMMC,&floatSN,&floatCN,&floatDN
#.....hypdrv:r,float s|float yy[]|float dyyds[]:
#.....hypser:r,fcomplex a|fcomplex b|fcomplex c|fcomplex z|fcomplex *series|fcomplex *deriv:
#.....fcomplex hypgeo:fcomplex a|fcomplex b|fcomplex c|fcomplex z:
	--#############################################################################
	--#
	--#      C H A P T E R   7   -  Random Numbers
	--#
	--#############################################################################
d*ran0:rw,longIDUM:&longIDUM
	-- first random number generator (Park-Miller method)
d*ran1:rw,longIDUM:&longIDUM
	-- second random number generator (Park-Miller method with shuffle)
d*ran2:rw,longIDUM:&longIDUM
	-- third random number generator (l'Ecuyer long-period method with shuffle)
d*ran3:rw,longIDUM:&longIDUM
	-- fourth random number generator (Knuth subtractive method)
d*ran4:rw,longIDUM:&longIDUM
	-- fifth random number generator (Park-Miller method)
d*expdev:rw,longIDUM:&longIDUM
	-- exponentially distributed random numbers, averaging 1
d*gasdev:rw,longIDUM:&longIDUM
	-- Gaussian random numbers with zero mean, deviation 1
d*gamdev:r,integerIA|rw,longIDUM:integerIA,&longIDUM
	-- gamma distributed random numbers, averaging 1
d*poidev:r,floatXM|rw,longIDUM:floatXM,&longIDUM
	-- poisson distributed random numbers (integers as floats), averaging 1
d*bnldev:r,floatPP|r,integerN|rw,longIDUM:floatPP,integerN,&longIDUM
	-- binomial-distributed random numbers
i*irbit1:rw,ulongISEED:&ulongISEED
	-- random bit generator
i*irbit2:rw,ulongISEED:&ulongISEED
	--  random bit generator, second version
psdes:rw,ulongILWORD|rw,ulongIRWORD:&ulongILWORD,&ulongIRWORD
	-- random number generator based on DES encryption scheme
ranpt:rw,fvectPT(n)|r,fvectREGN(m):fvectPT->p,fvectREGN->p,n
	-- returns uniformly random point in specified rectangular region
rebin:r,floatRC|r,fvectR(n)|rw,fvectXIN(n)|rw,fvectXI(n):floatRC,n,fvectR->p,fvectXIN->p,fvectXI->p
	-- rebins a vector of densities into specified new set of bins (subroutine of 'vegas')
nrsobseq:rw,integerN|rw,fvectX(m):&integerN,fvectX->p
	-- generated N-dimensional Sobol random subsequence
vegas:r,fvectREGN(n)|r,ffuncFXN(f[];f)|r,integerINIT|r,ulongNCALL|r,integerITMX|r,integerNPRN|w,floatTGRAL|w,floatSD|w,floatCHI2A:fvectREGN->p,n/2,ffuncFXN,integerINIT,ulongNCALL,integerITMX,integerNPRN,&floatTGRAL,&floatSD,&floatCHI2A
	-- Monte_Carlo integration of function of several variables in rectangular domain by vegas adaptive method
miser:r,ffuncFUNC(f[])|r,fvectREGN(n)|r,ulongNPTS|r,floatDITH|w,floatAVE|w,floatVAR:ffuncFUNC,fvectREGN->p,n/2,ulongNPTS,floatDITH,&floatAVE,&floatVAR
	-- Monte_Carlo integration of function of several variables in rectangular domain by recursive stratified sampling
	--#############################################################################
	--#
	--#      C H A P T E R   8   -  Sorting
	--#
	--#############################################################################
piksrt:rw,fvectARR(n):n,fvectARR->p
	-- simple extraction sort
piksr2:rw,fvectARR(n)|rw,fvectBRR(n):n,fvectARR->p,fvectBRR->p
	-- simple extraction sort, rearraanging second vector
shell:rw,fvectA(n):n,fvectA->p
	-- shell sort
sort:rw,fvectARR(n):n,fvectARR->p
	-- quicksort
sort2:rw,fvectARR(n)|rw,fvectBRR(n):n,fvectARR->p,fvectBRR->p
	-- quicksort, rearranging second vector
sort3:rw,fvectRA(n)|rw,fvectRB(n)|rw,fvectRC(n):n,fvectRA->p,fvectRB->p,fvectRC->p
	-- rearranges tow additional sequence using sort-permutation of first
hpsort:rw,fvectRA(n):n,fvectRA->p
	-- heapsort
indexx:rw,fvectARR(n)|rw,ulvectINDX(n):n,fvectARR->p,ulvectINDX->p
	-- calculates sorted-position index for an array
rank:r,ulvectINDX(n)|w,ulvectIRANK(n):n,ulvectINDX->p,ulvectIRANK->p
	-- -- calculates sorted-ranks for array elements
d*nselect:r,integerK|rw,fvectARR(n):integerK,n,fvectARR->p
	-- puts k-th largest element in poition k of an array 
d*selip:r,integerK|rw,fvectARR(n):integerK,n,fvectARR->p
	-- returns k-th largest element of an array
hpsel:rw,fvectARR(n)|rw,fvectHEAP(m):m,n,fvectARR->p,fvectHEAP->p
	-- puts m-th largest elements of array into a subarray
eclass:rw,ivectNF(n)|rw,ivectLISTA(m)|rw,ivectLISTB(m):ivectNF->p,n,ivectLISTA->p,ivectLISTB->p,m
	-- determines element equivalence class from list of equivalences
eclazz:rw,ivectNF(n)|r,ifuncEQUIV(i;i):ivectNF->p,n,ifuncEQUIV
	-- determines element equivalence class from pairwise equivalence-testing function
	--#############################################################################
	--#
	--#      C H A P T E R   9   -  Root Finding and Nonlinear Sets of Equations
	--#
	--#############################################################################
zbrac:r,ffuncF(f)|rw,floatX1|rw,floatX2:ffuncF,&floatX1,&floatX2
	-- root bracketing by progressive expansion of interval
d*rtbis:r,ffuncF(f)|r,floatX1|r,floatX2|r,floatXACC:ffuncF,floatX1,floatX2,floatXACC
	-- root finding by bisection of interval known to contain root
d*rtflsp:r,ffuncF(f)|r,floatX1|r,floatX2|r,floatXACC:ffuncF,floatX1,floatX2,floatXACC
	-- root finding by method of false position
d*rtsec:r,ffuncF(f)|r,floatX1|r,floatX2|r,floatXACC:ffuncF,floatX1,floatX2,floatXACC
	-- root finding by secant method; secant serves as approximation for the true derivative
d*zriddr:r,ffuncF(f)|r,floatX1|r,floatX2|r,floatXACC:ffuncF,floatX1,floatX2,floatXACC
	-- root finding by Ridder method
d*zbrent:r,ffuncF(f)|r,floatX1|r,floatX2|r,floatTOL:ffuncF,floatX1,floatX2,floatTOL
	-- root finding by Brent high-speed method
zrhqr:r,fvectP(n)|w,fvectR(n-1)|w,fvectI(n-1):fvectP->0p,n-1,fvectR->p,fvectI->p
	-- polynomial root finding by associated matrix computation. fvectR and fvectI are real and imaginary
	-- parts of roots
zbrak:r,ffuncF(f)|r,floatX1|r,floatX2|r,fvectXB1(n)|r,fvectXB2(n)|rw,integerNB:ffuncF,floatX1,floatX2,n,fvectXB1->p,fvectXB2->p,&integerNB
	-- preliminary to root finding; decomposes interval containing roots into specified number of parts,
	-- returns lists of stats, ends of intervas containing reversals
qroot:r,fvectP(n)|rw,floatB|rw,floatC|r,floatEPS:fvectP->0p,n-1,&floatB,&floatC,floatEPS
	-- improves accuracy of trial quadratic factor of polynomial
nrmnewt:r,integerNTRIAL|rw,fvectX(n)|r,floatTOLX|r,floatTOLF|r,vfuncUSRFUN(f[];i;&f[];&f[]):integerNTRIAL,fvectX->p,n,floatTOLX,floatTOLF,vfuncUSRFUN
	-- multidimensional root finding/improvement by Newton method; requires predefined user function
	-- which supplies values ad Jacobian of vector function to be zeroed.
#.....d*nrfmin:r,fvectX(n):fvectX->p
	-- utility vector norm
d*nrtnewt:r,vfuncD(f;&f[])|r,floatX1|r,floatX2|r,floatXACC:vfuncD,floatX1,floatX2,floatXACC
	-- 1-D root finding by Newton method; initial guess is middle of inteval given
d*nrtsafe:r,vfuncD(f;&f[])|r,floatX1|r,floatX2|r,floatXACC:vfuncD,floatX1,floatX2,floatXACC
	-- 1-D root finding by safe variant of Newton method, using bisection technique where 
	-- Newton techniqe gives smaller reduction of interval. Initial guess is middle of inteval given
lnsrch:r,fvectXOLD(n)|r,floatFOLD|r,fvectG(n)|r,fvectP(n)|w,fvectX(n)|w,floatF|r,floatSTPMAX|w,integerCHECK|r,ffuncFUNC(f[]):n,fvectXOLD->p,floatFOLD,fvectG->p,fvectP->p,fvectX->p,&floatF,floatSTPMAX,&integerCHECK,ffuncFUNC(f[])
	-- multidimensional root finding by modified Newton method, constrained to take steps that 
	-- actually reduce the norm of the target multidimensional function
newt:rw,fvectX(n)|w,integerCHECK|r,vfuncVECFUNC(i;f[];&f[]):fvectX->p,n,&integerCHECK,vfuncVECFUNC
	-- multidimensional root finding by globally convergent variant of Newton method (uses lnsrch)
fdjac:r,fvectX(n)|r,fvectFVEC(n)|w,fmatDF(n;n)|r,vfuncVECFUNC(i;f[];&f[]):n,fvectX->p,fvectFVEC->p,fmatDF->p,vfuncVECFUNC
	-- coarse numerical estimate of function Jacobian from function values
broydn:rw,fvectX(n)|w,integerCHECKk|r,vfuncVECFUNC(i;f[];&f[]):fvectX->p,n,&integerCHECKk,vfuncVECFUNC
	-- multidimensional root finding by Broyden method; uses secant constrain and additional heuristic to
	-- approximate a multidimensional Newton-like step
#.....laguer:rw,xvectA(m)|r2,complexX|w,integerITS:xvectA->0p,m-1,complexX,integerITS
	-- iterative convergence of initial X to a root value of A
#.....zroots:rw,xvectA(m)|m|w,xvectROOTS(m)|r,integerPOLISH:xvectA->0p,m-1,,xvectROOTS->p
	-- finds all roota of a polynomial A
	--#############################################################################
	--#
	--#      C H A P T E R   10   -  Minimization and Maximization of Functions
	--#
	--#############################################################################
mnbrak:rw,floatAX|rw,floatBX|rw,floatCX|rw,floatFA|rw,floatFB|rw,floatFC|r,ffuncF(f):&floatAX,&floatBX,&floatCX,&floatFA,&floatFB,&floatFC,ffuncF
	-- downhill search for three points which bracket a minimum
d*golden:rw,floatAX|rw,floatBX|rw,floatCX|r,ffuncF(f)|r,floatTOL|w,floatXMIN:floatAX,floatBX,floatCX,ffuncF,floatTOL,&floatXMIN
	-- golden-section subdivison search for a function minimum
f*brent:rw,floatAX|rw,floatBX|rw,floatCX|r,ffuncF(f)|r,floatTOL|w,floatXMIN:floatAX,floatBX,floatCX,ffuncF,floatTOL,&floatXMIN
	-- Brent parabolic-interpolation search for function minimum
f*dbrent:rw,floatAX|rw,floatBX|rw,floatCX|r,ffuncF(f)|r,ffuncDF(f)|r,floatTOL|w,floatXMIN:floatAX,floatBX,floatCX,ffuncF,ffuncDF,floatTOL,&floatXMIN
	-- Brent parabolic-interpolation search for function minimum, using derivatives
simplx:r,fmatA(m;n)|r,integerM1|r,integerM2|r,integerM3|w,integerICASE|w,ivectIZROV(n)|w,ivectIPOSV(m):fmatA->p,m-2,n-1,integerM1,integerM2,integerM3,&integerICASE,ivectIZROV->p,ivectIPOSV->p
	-- simplex method for linear programming. A is the input linear-programming tableau. 
	-- This is a matrix with rows consisting of:
	-- (i) coefficients of the linear form to be minimized (constant term always first)
	-- (ii) coefficients of the linear forms which must be positive
	-- (iii) coefficients of the linear forms which must be negative
	-- (iv) coefficients of the linear forms which must be zero
	-- 		The integers M1,M2, and M3 are
	-- (i) number of linear forms which must be positive
	-- (ii) number of linear forms which must be negative
	-- (iii) number of linear forms which must be zero
	-- The number of rows of A must be M + 2 = 1 + M1 + M2 + M3 + 1 (one spare row is used as workspace)
	-- The number of columns of A must be 1 + (N = number of variables)
	-- The ICASE integer returned is 0 if a amx was found, 1 if the mx is infinite, -1 if the contraints 
	-- are unsatisfiable.
	-- Aside from this, the output is returned in A, in a permuted form represented by two integer matrices:
	-- TZROV contains M integers, with A(1)(1) = the max; A(j + 1)(1) = value at maximum of variable number
	-- TZROV(j), provided that TZROV(j) <= N; otherwise it is the val of the TZROV(j) - N +1st slack variable.
	-- Similarly A(1)(j + 1)  = value at maximum of variable number IZROV(j), provided that IZROV(j) <= N; 
	-- otherwise it is the val of the IZROV(j) - N +1st slack variable
simp1:r,fmatA(m;n)|r,ivectLL(k)|r,integerIABF|w,integerKP|w,floatBMAX:fmatA->p,m-1,ivectLL->p,k,integerIABF,&integerKP,&floatBMAX
	-- subroutine for 'simplx'. determines maximum, or maximum absolute value, of A matrix elements listed in LL
simp2:r,fmatA(m;n)|rw,ivectL2(k)|w,integerIP|r,integerKP|w,floatQ1:fmatA->p,n,ivectL2->p,k,&integerIP,integerKP,&floatQ1
	--  subroutine for 'simplx'. locates a pivot element in the matrix A
simp3:r,fmatA(m;n)|r,integerI1|r,integerK1|r,integerIP|r,integerKP:fmatA->p,integerI1,integerK1,integerIP,integerKP
	--  subroutine for 'simplx'. exchange of right and left-hand tableaux elements
linmin:r,fvectP(n)|r,fvectXI(n)|w,floatFRET|r,ffuncFUNC(f[]):fvectP->p,fvectXI->p,n,&floatFRET,ffuncFUNC
	-- multidimensional function minimization by downhill line search
dlinmin:r,fvectP(n)|r,fvectXI(n)|w,floatFRET|r,ffuncFUNC(f[])|r,vfuncDFUNC(f[];&f[]):fvectP->p,fvectXI->p,n,&floatFRET,ffuncFUNC,vfuncDFUNC
	-- multidimensional function minimization by downhill line search using derivatives
f*f1dim:r,floatX:floatX
	-- subroutine for 'linmin'; represents linear section of fucntion being minimized
f*df1dim:r,floatX:floatX
	-- subroutine for 'dlinmin'; represents linear section of fucntion being minimized
i*metrop:r,floatDE|r,floatT:floatDE,floatT
amoeba:rw,fmatP(n;m)|rw,fvectY(n)|r,floatFTOL|r,ffuncFUNK(f[])|w,integerNFUNK:fmatP->p,fvectY->p,n-1,floatFTOL,ffuncFUNK,&integerNFUNK
	-- downhill simplex method for multidimensional function minimization
f*amotry:rw,fmatP(n;n-1)|rw,fvectY(n)|w,fvectPSUM(n)|r,ffuncFUNK(f[])|r,integerIHI|r,floatFAC:fmatP->p,fvectY->p,fvectPSUM->p,n,ffuncFUNK,integerIHI,floatFAC
	-- extrapolates function through simplex face (subroutine for 'amoeba')
powell:r,fvectP(n)|r,fmatXI(n;n)|r,floatTOL|w,integerITER|w,floatFRET|r,ffuncFUNC(f[]):fvectP->p,fmatXI->p,n,floatTOL,&integerITER,&floatFRET,ffuncFUNC
	-- Powell quadratically convergent conjugate-direction method for multidimensional function minimization
frprmn:rw,fvectP(n)|r,floatFTOL|w,integerITER|w,floatFRET|r,ffuncFUNC(f[])|r,vfuncDFUNC(f[];&f[]):fvectP->p,n,floatFTOL,&integerITER,&floatFRET,ffuncFUNC,vfuncDFUNC
	-- conjugate-direction downhill search method for multidimensional function minimization
dfpmin:rw,fvectP(n)|r,floatGTOL|w,integerITER|w,floatFRET|r,ffuncFUNC(f[])|r,vfuncDFUNC(f[];&f[]):fvectP->p,n,floatGTOL,&integerITER,&floatFRET,ffuncFUNC,vfuncDFUNC
	-- variable-metric conjugate-direction downhill search method for multidimensional function minimization
amebsa:rw,fmatP(n;n-1)|rw,fvectY(n)|r,fvectPB(n)|w,floatYB|r,floatFTOL|r,ffuncFUNK(f[])|w,integerITER|r,floatTEMPTR:fmatP->p,fvectY->p,n,fvectPB->p,&floatYB,floatFTOL,ffuncFUNK,&integerITER,floatTEMPTR
	-- multidimensional function minimization by simuated annealing combined with downhill simplex method
f*amotsa:rw,fmatP(n;m)|rw,fvectY(n)|r,fvectPSUM(n)|r,fvectPB(n)|w,floatYB|r,ffuncFUNK(f[])|r,integerIHI|w,floatYHI|r,floatFAC:fmatP->p,fvectY->p,fvectPSUM->p,n-1,fvectPB->p,&floatYB,ffuncFUNK,integerIHI,&floatYHI,floatFAC
	-- function extrapolation through designated face of simplex (subroutine for 'amebsa')
anneal:r,fvectX(n)|r,fvectY(n)|w,ivectIORDER(n):fvectX->p,fvectY->p,ivectIORDER->p,n
	-- approximate solution of traveling salesman problem by simulated annealing
f*revcst:r,fvectX(n)|r,fvectY(n)|r,ivectIORDER(n)|r,ivectN():fvectX->p,fvectY->p,ivectIORDER->p,n,ivectN->p
	-- returns cost function for proposed path reversal (subroutine for 'anneal')
reverse:rw,ivectIORDER(n)|r,ivectN():ivectIORDER->p,n,ivectN->p
	-- performs path reversal (subroutine for 'anneal')
f*trncst:r,fvectX(n)|r,fvectY(n)|r,ivectIORDER(n)|w,ivectN(k):fvectX->p,fvectY->p,ivectIORDER->p,n,ivectN->p
	-- (k is 6) calculates cost function for proposed traveling salesman path segment (subroutine for 'anneal')
trnspt:rw,ivectIORDER(n)|r,ivectN(k):ivectIORDER->p,n,ivectN->p
	-- (k is 6) determines reconfiguration acceptability in traveling salesman problem (subroutine for 'anneal')
	--#############################################################################
	--#
	--#      C H A P T E R   11   -  Eigensystems
	--#
	--#############################################################################
jacobi:rw,fmatA(n;n)|w,fvectD(n)|w,fmatV(n;n)|w,integerNROT:fmatA->p,n,fvectD->p,fmatV->p,&integerNROT
		-- eigenvectors and eigenvalues of real symmetric matrix by Jacobi method
tred2:rw,fmatA(n;n)|w,fvectD(n)|w,fvectE(n):fmatA->p,n,fvectD->p,fvectE->p
		-- reduce real symmetric matrix to tridiagonal form by Householder method
tqli:rw,fvectD(n)|rw,fvectE(n)|rw,fmatZ(n;n):fvectD->p,fvectE->p,n,fmatZ->p
		-- eigenvectors and eigenvalues of real symmetric tridiagonal matrix by Jacobi method
balanc:rw,fmatA(n;n):fmatA->p,n
		-- replace A by 'balanced' matrix with the same eigenvalues
elmhes:rw,fmatA(n;n):fmatA->p,n
		-- reduce real matrix to Hessenberg form
hqr:rw,fmatA(n;n)|w,fvectR(n)|w,fvectI(n):fmatA->p,n,fvectR->p,fvectI->p
		-- eigenvalues of real Hessenberg matrix by QR reduction method
eigsrt:rw,fvectD(n)|rw,fmatV(n;n):fvectD->p,fmatV->p,n
		-- sort eigenvectors and eigenvalues into descending order of eigenvalues
	--#############################################################################
	--#
	--#      C H A P T E R   12   -  Fast Fourier Transform
	--#
	--#############################################################################
four1:rw,fvectD(n)|r,integerISIGN:fvectD->p,n/2,integerISIGN
				-- vector fast Fourier transform and inverse.
				-- put ISIGN = 1 for direct transform; -1 for #fvectD/2 times inverse transform.
				-- dimension of fvectD must be a power of 2
dfour1:rw,dvectD(n)|r,integerISIGN:dvectD->p,n/2,integerISIGN
				-- double precision vector fast Fourier transform and inverse.
				-- put ISIGN = 1 for direct transform; -1 for #fvectD/2 times inverse transform.
				-- dimension of fvectD must be a power of 2
twofft:r,fvectD1(n)|r,fvectD2(n)|rw,fvectF1(m)|w,fvectF2(m):fvectD1->p,fvectD2->p,fvectF1->p,fvectF2->p,n/2
				-- fast Fourier transform and inverse, pair of real vectors
realft:rw,fvectD(n)|r,integerISIGN:fvectD->p,n,integerISIGN
				-- fast Fourier transform of a real vector 
drealft:rw,dvectD(n)|r,integerISIGN:dvectD->p,n,integerISIGN
				-- double precision fast Fourier transform of a real vector
sinft:rw,fvectD(n):fvectD->p,n
				-- fast sine transform of real vector. This is self inverse, if divided by #fvectD/2
				-- the first component of fvectD must be 0
cosft1:rw,fvectD(n):fvectD->p,n-1
				-- fast cosine transform of real vector. This is self inverse, if divided by #fvectD/2
cosft2:rw,fvectD(n)|r,integerISIGN:fvectD->p,n,integerISIGN
				-- second form of fast cosine transform of real vector.
fourn:rw,fvectD(n)|r,ulvectNN(m)|r,integerISIGN:fvectD->p,ulvectNN->p,m,integerISIGN
				-- multidimensional fast Fourier transform and inverse.
rlft3:rw,ftensD(n;m;q)|w,fmatSPEQ(n;2*m)|r,integerISIGN:ftensD->p,fmatSPEQ->p,n,m,q,integerISIGN
				-- 3-dimensional fast Fourier transform for a real tensor or array.
#.....fourfs:FILE *file[5]|w,unsigned long nn[]|w,integerNDIM|w,integerISIGN:
	-- 1-D or multidimensional FFT of large vector stored on external media
#.....fourew:FILE *file[5]|w,integerNA|w,integerNB|w,integerNC|w,integerND:
	-- rewinds and renumbers the files used by 'fourfs'
	--#############################################################################
	--#
	--#      C H A P T E R   13   -  Fourier And Spectral Applications
	--#
	--#############################################################################
convlv:r,fvectDATA(n)|r,fvectRESPNS(n)|r,ulongM|r,integerISIGN|rw,fvectANS(2*n):fvectDATA->p,n,fvectRESPNS->p,ulongM,integerISIGN,fvectANS->p
				-- convolution of a pair of vectors; the RESPNS function must be heled in wrap-around order in the
				-- first m elements of the n-long RESPNS vector, ANS must be twice as long 
correl:r,fvectDATA1(n)|r,fvectDATA2(n)|rw,fvectANS(m):fvectDATA1->p,fvectDATA2->p,n,fvectANS->p
				-- correlation of a pair of vectors, with result returned in ANS, which must be twice as long  
#.....spctrm:FILE *fp|r,fvectP(m)|r,integerK|r,integerOVRLAP:fp->p,fvectP->p,m,integerK,integerOVRLAP
				-- FFT-baased power spectrum estimation
wt1:rw,fvectA(n)|r,integerISIGN|r,vfuncWTSTEP(f[];i;i):fvectA->p,n,integerISIGN,vfuncWTSTEP
				-- driver for 1-D wavelet calculation
wtn:rw,fvectA(k)|r,ulvectNN(n)|r,integerISIGN|r,vfuncWTSTEP(f[];i;i):fvectA->p,ulvectNN->p,n,integerISIGN,vfuncWTSTEP
				-- driver for n-dimensional wavelet calculation; k is the product of all the components of NN
spread:r,floatY|rw,fvectYY(n)|r,floatX|r,integerM:floatY,fvectYY->p,n,floatX,integerM
				-- auxiliary routine for 'fasper'
dftcor:r,floatW|r,floatDELTA|r,floatA|r,floatB|r,fvectENDPTS()|w,floatCORRE|w,floatCORIM|w,floatCORFAC:floatW,floatDELTA,floatA,floatB,fvectENDPTS->p,&floatCORRE,&floatCORIM,&floatCORFAC
				-- calculate correction to Fourier estimate of integral
dftint:r,ffuncFUNC(f)|r,floatA|r,floatB|r,floatW|w,floatCOSINT|w,floatSININT:ffuncFUNC,floatA,floatB,floatW,&floatCOSINT,&floatSININT
				-- sample integration routine illustrating the use of 'dftcor'
pwtset:r,integerN:integerN
				-- coefficient initializing routine for pwt
$daub4
				-- gets pointer to native daub4 routine
daub4:r,fvectA(n)|r,integerISIGN:fvectA->p,n,integerISIGN
				-- Daubechies 4-point wavelet filter
pwt:r,fvectA(n)|r,integerISIGN:fvectA->p,n,integerISIGN
				-- partial wavelet subroutine for 'wt1' aand 'wtn'
predic:r,fvectDATA(n)|r,fvectD(m)|rw,fvectFUTURE(k):fvectDATA->p,n,fvectD->p,m,fvectFUTURE->p,k
				-- predicts data points using linear prediction coefficients
d*evlmem:r,floatFDT|r,fvectD(m)|r,floatXMS:floatFDT,fvectD->p,m,floatXMS
				-- generates power-spectrum estimate from 'memcof' output
period:r,fvectX(n)|r,fvectY(n)|r,floatOFAC|r,floatHIFAC|rw,fvectPX(m)|w,fvectPY(m)|w,integerNOUT|w,integerJMAX|w,floatPROB:fvectX->p,fvectY->p,n,floatOFAC,floatHIFAC,fvectPX->p,fvectPY->p,m,&integerNOUT,&integerJMAX,&floatPROB
				-- calculates Lomb normalized periodogram
fasper:r,fvectX(n)|r,fvectY(n)|r,floatOFAC|r,floatHIFAC|rw,fvectWK1(k)|w,fvectWK2(k)|w,ulongNOUT|w,ulongJMAX|w,floatPROB:fvectX->p,fvectY->p,n,floatOFAC,floatHIFAC,fvectWK1->p,fvectWK2->p,k,&ulongNOUT,&ulongJMAX,&floatPROB
				-- calculates Lomb normalized periodogram by fast method
memcof:r,fvectDATA(n)|w,floatXMS|rw,fvectD(m):fvectDATA->p,n,m,&floatXMS,fvectD->p
				-- estimates linear prediction coefficients from given data
fixrts:rw,fvectD(m):fvectD->p,m
				-- given linear prediction coefficients, finds all roots of the characteristic polynomial
	--#############################################################################
	--#
	--#      C H A P T E R   14   -  Statistical Description of Data
	--#
	--#############################################################################
moment:r,fvectDATA(n)|w,floatAVE|w,floatADEV|w,floatSDEV|w,floatVAR|w,floatSKEW|w,floatCURT:fvectDATA->p,n,&floatAVE,&floatADEV,&floatSDEV,&floatVAR,&floatSKEW,&floatCURT
			-- calculate moments of data vector
ttest:r,fvectDATA1(n)|r,fvectDATA2(m)|w,floatT|w,floatPROB:fvectDATA1->p,n,fvectDATA2->p,m,&floatT,&floatPROB
			-- Student test for significance of difference of means
tutest:r,fvectDATA1(n)|r,fvectDATA2(m)|w,floatT|w,floatPROB:fvectDATA1->p,n,fvectDATA2->p,m,&floatT,&floatPROB
			-- Student test for significance of difference of means if variances differ
avevar:r,fvectDATA(n)|w,floatAVE|w,floatVAR:fvectDATA->p,n,&floatAVE,&floatVAR
			-- 
tptest:r,fvectDATA1(n)|r,fvectDATA2(n)|w,floatT|w,floatPROB:fvectDATA1->p,fvectDATA2->p,n,&floatT,&floatPROB
			-- Student test for significance of difference of means in paired samples
ftest:r,fvectDATA1(n)|r,fvectDATA2(m)|w,floatF|w,floatPROB:fvectDATA1->p,n,fvectDATA2->p,m,&floatF,&floatPROB
			-- F test for significance of difference of variances
chsone:r,fvectBINS(n)|r,fvectEBINS(n)|r,integerKNSTRN|w,floatDF|w,floatCHSQ|w,floatPROB:fvectBINS->p,fvectEBINS->p,n,integerKNSTRN,&floatDF,&floatCHSQ,&floatPROB
			-- chisquare test for significance of difference of distribution, binned data
chstwo:r,fvectBINS1(n)|r,fvectBINS2(n)|r,integerKNSTRN|w,floatDF|w,floatCHSQ|w,floatPROB:fvectBINS1->p,fvectBINS2->p,n,integerKNSTRN,&floatDF,&floatCHSQ,&floatPROB
			-- chisquare test for significance of difference of distribution, binned data, generalized case
ksone:r,fvectDATA(n)|r,ffuncFUNC(f)|w,floatD|w,floatPROB:fvectDATA->p,n,ffuncFUNC,&floatD,&floatPROB
			-- Kolmogrov-Smirnov test for significance of difference of distribution from assumed model, unbinned data
kstwo:r,fvectDATA1(n)|r,fvectDATA2(m)|w,floatD|w,floatPROB:fvectDATA1->p,n,fvectDATA2->p,m,&floatD,&floatPROB
			-- Kolmogrov-Smirnov test for significance of difference of distribution in two data sets, unbinned data
d*probks:r,floatALAM:floatALAM
			-- Kolmogrov-Smirnov probability function subroutine
cntab1:r,imatNN(n;m)|w,floatCHISQ|w,floatDF|w,floatPROB|w,floatCRAMRV|w,floatCCC:imatNN->p,n,m,&floatCHISQ,&floatDF,&floatPROB,&floatCRAMRV,&floatCCC
			-- contingency table analysis for 2-D contingency table
cntab2:r,imatNN(n;m)|w,floatH|w,floatHX|w,floatHY|w,floatHYGX|w,floatHXGY|w,floatUYGX|w,floatUXGY|w,floatUXY:imatNN->p,n,m,&floatH,&floatHX,&floatHY,&floatHYGX,&floatHXGY,&floatUYGX,&floatUXGY,&floatUXY
			-- entropy-based contingency table analysis for 2-D contingency table
pearsn:r,fvectX(n)|r,fvectY(n)|w,floatR|w,floatPROB|w,floatZ:fvectX->p,fvectY->p,n,&floatR,&floatPROB,&floatZ
			-- Pearson analysis for linear dependence of two associated data sets
spear:r,fvectDATA1(n)|r,fvectDATA2(n)|w,floatD|w,floatZD|w,floatPROBD|w,floatRS|w,floatPROBRS:fvectDATA1->p,fvectDATA2->p,n,&floatD,&floatZD,&floatPROBD,&floatRS,&floatPROBRS
			-- Spearman rank-order correlation coefficient
crank:r,fvectW(n)|w,floatS:n,fvectW->p,&floatS
			-- ranking subroutine for Spearman rank-order correlation
kendl1:r,fvectDATA1(n)|r,fvectDATA2(n)|w,floatTAU|w,floatZ|w,floatPROB:fvectDATA1->p,fvectDATA2->p,n,&floatTAU,&floatZ,&floatPROB
			-- Kendall rank-order tau coefficient
kendl2:r,fmatTAB(i;j)|w,floatTAU|w,floatZ|w,floatPROB:fmatTAB->p,i,j,&floatTAU,&floatZ,&floatPROB
			-- contingency-table based variant of Kendall rank-order tau coefficient
nrks2d1s:r,fvectX1(n)|r,fvectY1(n)|r,vfuncQUADVL(f;f;&f[])|w,floatD1|w,floatPROB:fvectX1->p,fvectY1->p,n,vfuncQUADVL,&floatD1,&floatPROB
			-- Kolmogrov-Smirnov test for significance of difference of distribution from assumed model, 2-D case
ks2d2s:r,fvectX1(n)|r,fvectY1(n)|r,fvectX2(m)|r,fvectY2(m)|w,floatD|w,floatPROB:fvectX1->p,fvectY1->p,n,fvectX2->p,fvectY2->p,m,&floatD,&floatPROB
			-- Kolmogrov-Smirnov test for significance of difference of distribution of two samples, 2-D case
quadct:r,floatX|r,floatY|r,fvectXX(n)|r,fvectYY(n)|w,floatFA|w,floatFB|w,floatFC|w,floatFD:floatX,floatY,fvectXX->p,fvectYY->p,n,&floatFA,&floatFB,&floatFC,&floatFD
			-- cout of points in each of 4 quadrants
quadvl:r,floatX|r,floatY|w,floatFA|w,floatFB|w,floatFC|w,floatFD:floatX,floatY,&floatFA,&floatFB,&floatFC,&floatFD
			-- sample model for 'ks2ds': uniform distribution inside a square
savgol:rw,fvectY1(n)|r,integerNL|r,integerNR|r,integerLD|r,integerM:fvectY1->p,n,integerNL,integerNR,integerLD,integerM
			-- calculates Savitsky-Golay filter coefficents for stated nuber of filter points to be used
	--#############################################################################
	--#
	--#      C H A P T E R   15   -  Modeling of Data
	--#
	--#############################################################################
fit:r,fvectX(n)|r,fvectY(n)|r,fvectSIG(n)|r,integerMWT|w,floatA|w,floatB|w,floatSIGA|w,floatSIGB|w,floatCHI2|w,floatQ:fvectX->p,fvectY->p,n,fvectSIG->p,integerMWT,&floatA,&floatB,&floatSIGA,&floatSIGB,&floatCHI2,&floatQ
			-- computes maximum-likelihood fit to data with specified variances
fitexy:r,fvectX(n)|r,fvectY(n)|r,fvectSIGX(n)|r,fvectSIGY(n)|w,floatA|w,floatB|w,floatSIGA|w,floatSIGB|w,floatCHI2|w,floatQ:fvectX->p,fvectY->p,n,fvectSIGX->p,fvectSIGY->p,&floatA,&floatB,&floatSIGA,&floatSIGB,&floatCHI2,&floatQ
			-- computes maximum-likelihood fit to data with specified variances, and variablility in both x and y
d*chixy:r,doubleBANG:doubleBANG
			-- computes ch**2 coefficient as function of offset (subroutine of 'fitexy')
lfit:r,fvectX(n)|r,fvectY(n)|r,fvectSIG(n)|w,fvectA(m)|r,ivectIA(m)|w,fmatCOVAR(m;m)|w,floatCHISQ|r,vfuncFUNCS(f;&f[];i):fvectX->p,fvectY->p,fvectSIG->p,n,fvectA->p,ivectIA->p,m,fmatCOVAR->p,&floatCHISQ,vfuncFUNCS
			-- best least-squares fit to data with specified variances
covsrt:w,fmatCOVAR(n;n)|r,ivectIA(n)|r,integerMFIT:fmatCOVAR->p,n,ivectIA->p,integerMFIT
			-- spresad calcyulated covariance back into 'covar' matrix (subroutine of 'lfit')
svdfit:r,fvectX(n)|r,fvectY(n)|r,fvectSIG(n)|rw,fvectA(m)|rw,fmatU(n;m)|rw,fmatV(m;m)|w,fvectW(m)|w,floatCHISQ|r,vfuncFUNCS(f,f[],i):fvectX->p,fvectY->p,fvectSIG->p,n,fvectA->p,m,fmatU->p,fmatV->p,fvectW->p,&floatCHISQ,vfuncFUNCS
			-- fit a specified set of nolinear functions to given data using the singular value decomposition technique
svdvar:w,fmatV(m;m)|w,fvectW(m)|w,fmatCVM(m;m):fmatV->p,m,fvectW->p,fmatCVM->p
			-- evaluate the covarince of a fir of a model to data (subroutine of 'svdfit')
nrmrqmin:r,fvectX(n)|r,fvectY(n)|w,fvectSIG(n)|w,fvectA(m)|r,ivectIA(m)|w,fmatCOVAR(m;m)|w,fmatALPHA(m;m)|w,floatCHISQ|r,vfuncFUNCS(d;f[];&f[];f[];i)|rw,floatALAMDA:fvectX->p,fvectY->p,fvectSIG->p,n,fvectA->p,ivectIA->p,m,fmatCOVAR->p,fmatALPHA->p,&floatCHISQ,vfuncFUNCS,&floatALAMDA
			-- fit a specified set of nolinear functions to given data using the Levenberg-Marquardt method
nrmrqcof:r,fvectX(n)|r,fvectY(n)|w,fvectSIG(n)|w,fvectA(m)|r,ivectIA(m)|w,fmatALPHA(m;m)|w,fvectBETA(m)|w,floatCHISQ|r,vfuncFUNCS(d;f[];&f[];f[];i):fvectX->p,fvectY->p,fvectSIG->p,n,fvectA->p,ivectIA->p,m,fmatALPHA->p,fvectBETA->p,&floatCHISQ,vfuncFUNCS
			-- estimate parameters for "mrqmin'
medfit:r,fvectX(n)|r,fvectY(n)|w,floatA|w,floatB|w,floatABDEV:fvectX->p,fvectY->p,n,&floatA,&floatB,&floatABDEV
			-- fit a line to given data by minimizing absolute devaiton
d*rofunc:r,floatB:floatB
			-- estimate parameter for "medfit'
fgauss:r,floatX|r,fvectA(n)|w,floatY|w,fvectDYDA(n):floatX,fvectA->p,&floatY,fvectDYDA->p,n
			-- calculate sum of gaussians with given denters and deviations
fleg:r,floatX|rw,fvectPL(n):floatX,fvectPL->p,n
			-- evaluate a sum of Legendre polynomials (example for svdfit)
fpoly:r,floatX|rw,fvectP(n):floatX,fvectP->p,n
			-- evaluate a polynomial with given coefficients (example for svdfit)
	--#############################################################################
	--#
	--#      C H A P T E R   16   -  Integration of Ordinary Differential Equations
	--#
	--#############################################################################
rk4:r,fvectY(n)|r,fvectDYDX(n)|r,floatX|r,floatH|w,fvectYOUT(n)|r,vfuncDERIVS(f;&f[];&f[]):fvectY->p,fvectDYDX->p,n,floatX,floatH,fvectYOUT->p,vfuncDERIVS
			-- fourth order Runge-Kutta single step of advance; vfuncDERIVS returns the (vector) right-hand side 
			-- of the differential equation
rkdumb2:r,fvectVSTART(n)|r,floatX1|r,floatX2|r,vfuncDERIVS(f;&f[];&f[])|rw,fmatY(n;m)|rw,fvectXX(m):fvectVSTART->p,n,floatX1,floatX2,m-1,vfuncDERIVS,fmatY->p,fvectXX->p
			-- fourth order Runge-Kutta advance from X1 to X2 with fixed stepsize
rkqs:rw,fvectY(n)|r,fvectDYDX(n)|rw,floatX|r,floatHTRY|r,floatEPS|r,fvectYSCAL(n)|w,floatHDID|w,floatHNEXT|r,vfuncDERIVS(f;&f[];&f[]):fvectY->p,fvectDYDX->p,n,&floatX,floatHTRY,floatEPS,fvectYSCAL->p,&floatHDID,&floatHNEXT,vfuncDERIVS
			-- fifth order Runge-Kutta single step of advance
rkck:r,fvectY(n)|r,fvectDYDX(n)|r,floatX|r,floatH|w,fvectYOUT(n)|w,fvectYERR(n)|r,vfuncDERIVS(f;&f[];&f[]):fvectY->p,fvectDYDX->p,n,floatX,floatH,fvectYOUT->p,fvectYERR->p,vfuncDERIVS
			-- fifth order Runge-Kutta advance from X1 to X2 with adaptive stepsize
#odeint:r,fvectYSTART(nvar)|nvar|r,floatX1|r,floatX2|r,floatEPS|r,floatH1|r,floatHMIN|w,integerNOK|w,integerNBAD|r,vfuncDERIVS(f;&f[];&f[]),
#.....	void (*rkqs)(f[],f[],i,&f,d,d,f[],&f,&f,void (*)(d,f[],f[])):
#	-- general ODE Runge-Kutta driver routine, allowing specification of step algorithm 'rkqs' to be used
ode_solve:r,fvectYSTART(n)|r,floatX1|r,floatX2|r,floatEPS|r,floatH1|r,floatHMIN|w,integerNOK|w,integerNBAD|r,vfuncDERIVS(f;&f[];&f[])|w,integerKOUNT|r,floatDXSAV|rw,fvectXP(k)|w,fmatYP(n;k):fvectYSTART->p,n,floatX1,floatX2,floatEPS,floatH1,floatHMIN,&integerNOK,&integerNBAD,vfuncDERIVS,k,&integerKOUNT,floatDXSAV,fvectXP->p,fmatYP->p
			-- top-level ODE solution driver using rkck as individual step. solution is constructed from 
			-- X1 to X2 with accuracy eps. H1 is guessed first sstepsize, HMIN is smallest acceptable stepsize.
			-- NOK is number of good steps taken, NBAD is number of retried steps. 
ode_solve_bs:r,fvectYSTART(n)|r,floatX1|r,floatX2|r,floatEPS|r,floatH1|r,floatHMIN|w,integerNOK|w,integerNBAD|r,vfuncDERIVS(f;&f[];&f[])|w,integerKOUNT|r,floatDXSAV|rw,fvectXP(k)|w,fmatYP(n;k):fvectYSTART->p,n,floatX1,floatX2,floatEPS,floatH1,floatHMIN,&integerNOK,&integerNBAD,vfuncDERIVS,k,&integerKOUNT,floatDXSAV,fvectXP->p,fmatYP->p
			-- top-level ODE solution driver using bsstep as individual step. 
ode_solve_stiff_bs:r,fvectYSTART(n)|r,floatX1|r,floatX2|r,floatEPS|r,floatH1|r,floatHMIN|w,integerNOK|w,integerNBAD|r,vfuncDERIVS(f;&f[];&f[])|w,integerKOUNT|r,floatDXSAV|rw,fvectXP(k)|w,fmatYP(n;k)|r,vfuncJACOBN(f;f[];&f[];&f[];i):fvectYSTART->p,n,floatX1,floatX2,floatEPS,floatH1,floatHMIN,&integerNOK,&integerNBAD,vfuncDERIVS,k,&integerKOUNT,floatDXSAV,fvectXP->p,fmatYP->p,vfuncJACOBN
			-- top-level ODE solution driver using stifbs as individual step.
ode_solve_stiff:r,fvectYSTART(n)|r,floatX1|r,floatX2|r,floatEPS|r,floatH1|r,floatHMIN|w,integerNOK|w,integerNBAD|r,vfuncDERIVS(f;&f[];&f[])|w,integerKOUNT|r,floatDXSAV|rw,fvectXP(k)|w,fmatYP(n;k)|r,vfuncJACOBN(f;f[];&f[];&f[];i):fvectYSTART->p,n,floatX1,floatX2,floatEPS,floatH1,floatHMIN,&integerNOK,&integerNBAD,vfuncDERIVS,k,&integerKOUNT,floatDXSAV,fvectXP->p,fmatYP->p,vfuncJACOBN
			-- top-level ODE solution driver using stiff as individual step.
mmid:r,fvectY(n)|r,fvectDYDX(n)|r,floatXS|r,floatHTOT|r,integerNSTEP|w,fvectYOUT(n)|r,vfuncDERIVS(f;&f[];&f[]):fvectY->p,fvectDYDX->p,n,floatXS,floatHTOT,integerNSTEP,fvectYOUT->p,vfuncDERIVS
			-- single step of modified midpoint method for ODEs
bsstep:rw,fvectY(n)|r,fvectDYDX(n)|rw,floatXX|r,floatHTRY|r,floatEPS|r,fvectSCAL(n)|w,floatHDID|w,floatHNEXT|r,vfuncDERIVS(f;&f[];&f[]):fvectY->p,fvectDYDX->p,n,&floatXX,floatHTRY,floatEPS,fvectSCAL->p,&floatHDID,&floatHNEXT,vfuncDERIVS
			-- single Burlisch-Stoer step for Romberg method for ODEs
pzextr:r,integerIEST|r,floatXEST|r,fvectYEST(n)|w,fvectYZ(n)|w,fvectDY(n):integerIEST,floatXEST,fvectYEST->p,fvectYZ->p,fvectDY->p,n
			-- polynomial extrapolation routine for Romberg method for ODEs
rzextr:r,integerIEST|r,floatXEST|r,fvectYEST(n)|w,fvectYZ(n)|w,fvectDY(n):integerIEST,floatXEST,fvectYEST->p,fvectYZ->p,fvectDY->p,n
			-- rational extrapolation routine for Romberg method for ODEs
stoerm:r,fvectY(n)|r,fvectD2Y(n)|r,floatXS|r,floatHTOT|r,integerNSTEP|w,fvectYOUT(n)|r,vfuncDERIVS(f;&f[];&f[]):fvectY->p,fvectD2Y->p,n,floatXS,floatHTOT,integerNSTEP,fvectYOUT->p,vfuncDERIVS
			-- Stoerm method for second order ODEs
stiff:rw,fvectY(n)|r,fvectDYDX(n)|rw,floatX|r,floatHTRY|r,floatEPS|w,fvectYSCAL(n)|w,floatHDID|w,floatHNEXT|r,vfuncDERIVS(f;&f[];&f[]):fvectY->p,fvectDYDX->p,n,&floatX,floatHTRY,floatEPS,fvectYSCAL->p,&floatHDID,&floatHNEXT,vfuncDERIVS
			-- fourth order Roesenbrock step for stiff  ODEs
jacobn:r,floatX|r,fvectY(n)|r,fvectDYDX(n)|rw,fmatDFDY(m;m):floatX,fvectY->p,fvectDYDX->p,fmatDFDY->p,n
			-- sample Jacobian matrix routine for 'stiff'
simpr:r,fvectY(n)|r,fvectDYDX(n)|r,fvectDFDX(n)|r,fmatDFDY(n;n)|r,floatXS|r,floatHTOT|r,integerNSTEP|w,fvectYOUT(n)|r,vfuncDERIVS(f;&f[];&f[]):fvectY->p,fvectDYDX->p,fvectDFDX->p,fmatDFDY->p,n,floatXS,floatHTOT,integerNSTEP,fvectYOUT->p,vfuncDERIVS
			-- fourth order Roesenbrock step for stiff  ODEs
stifbs:rw,fvectY(n)|r,fvectDYDX(n)|rw,floatXX,|r,floatHTRY|r,floatEPSR|r,fvectYSCAL(n)|w,floatHDID|w,floatHNEXT|r,vfuncDERIVS(f;&f[];&f[]):fvectY->p,fvectDYDX->p,n,&floatXX,floatHTRY,floatEPSR,fvectYSCAL->p,&floatHDID,&floatHNEXT,vfuncDERIVS
			-- semi-implicit exrapolation for integrating stiff systems of differential equations
	--#############################################################################
	--#
	--#      C H A P T E R   17   -  Two point boundary value problems
	--#
	--#############################################################################
setshoot:r,vfuncLOAD(f;f[];&f[])|r,vfuncSCORE(f;f[];&f[])|r,vfuncDERIVS(f;f[];&f[]):vfuncLOAD,vfuncSCORE,vfuncDERIVS
			-- Initialization function for SHOOT
setshootf:r,vfuncLOAD1(f;f[];&f[])|r,vfuncLOAD2(f;f[];&f[])|r,vfuncSCORE(f;f[];&f[])|r,vfuncDERIVS(f;f[];&f[])|r,integerNN2|r,integerNVAR|r,floatX1|r,floatX2|r,floatXF:vfuncLOAD1,vfuncLOAD2,vfuncSCORE,vfuncDERIVS,integerNN2,integerNVAR,floatX1,floatX2,floatXF
			-- Initialization function for SHOOTF
$shoot
shoot:r,fvectV(n)|w,fvectF(n):n,fvectV->p,fvectF->p
			-- solution of two-point boundary value problem by 'shooting' method
$shootf
shootf:r,fvectV(n)|w,fvectF(n):n,fvectV->p,fvectF->p
			-- solve 2-point boundary value problem by the 'shooting to a fitting point' method
solvde:r,integerITMAX|r,floatCONV|r,floatSLOWC|r,fvectSCALV(n)|r,ivectINDEXV(n)|r,integerNB|rw,fmatY(n;m)|rw,ftensC(n;n;n)|rw,fmatS(n;n):integerITMAX,floatCONV,floatSLOWC,fvectSCALV->p,ivectINDEXV->p,n,integerNB,m,fmatY->p,ftensC->p,fmatS->p
			-- top level routine for solution of 2-point boundary value problem by relaxation method 
pinvs:r,integerIE1|r,integerIE2|r,integerJE1|r,integerJSF|r,integerJC1|r,integerK|rw,ftensC(n;n;n)|rw,fmatS(n;n):integerIE1,integerIE2,integerJE1,integerJSF,integerJC1,integerK,ftensC->p,fmatS->p
			-- diagonalize square subsection of S matrix (subroutine for 'solvde')
red:r,integerIZ1|r,integerIZ2|r,integerJZ1|r,integerJZ2|r,integerJM1|r,integerJM2|r,integerJMF|r,integerIC1|r,integerJC1|r,integerJCF|r,integerKC|rw,ftensC(n;n;n)|w,fmatS(n;n):integerIZ1,integerIZ2,integerJZ1,integerJZ2,integerJM1,integerJM2,integerJMF,integerIC1,integerJC1,integerJCF,integerKC,ftensC->p,fmatS->p
			-- reduce columns of the S matrix using data stored in the C matrix (subroutine for 'solvde')
#difeq:r,integerK|r,integerK1|r,integerK2|r,integerJSF|r,integerIS1|r,integerISF|r,ivectINDEXV(n)|rw,fmatS(n;n)|w,fmatY(n;n):integerK,integerK1,integerK2,integerJSF,integerIS1,integerISF,ivectINDEXV->p,n,fmatS->p,fmatY->p
			-- compute S matrix for 'solvde'
bksub:r,integerNE|r,integerNB|r,integerJF|r,integerK1|r,integerK2|rw,ftensC(n;n;n):integerNE,integerNB,integerJF,integerK1,integerK2,ftensC->p
			-- backsubstitution routine for 'solvde'
	--#############################################################################
	--#
	--#      C H A P T E R   18   -  Integral Equations and Inverse Theory
	--#
	--#############################################################################
wwghts:rw,fvectWGHTS(n)|r,floatH|r,vfunctKERMOM(f[];f;i):fvectWGHTS->p,n,floatH,vfunctKERMOM
			-- computes wights for n-point equal-integral quadrature for specified function whose moments are returned by 'kermom'
kermom:rw,dvectWGHTS(m)|r,floatY:dvectWGHTS->p,floatY,m
			-- computes moments of diagonally singular kernel
quadmx:rw,fmatA(n;n):fmatA->p,n
			-- constructs quadrature matrix for sample Fredholm equation of the second kind with singular kernel 
fred2:r,floatA|r,floatB|rw,fvectT(n)|w,fvectF(n)|w,fvectW(n)|r,ffuncG(f)|r,ffuncAK(f;f):n,floatA,floatB,fvectT->p,fvectF->p,fvectW->p,ffuncG,ffuncAK
			-- solution of linear Fredholm equation of the second kind
f*fredin:r,floatX|r,floatA|r,floatB|r,fvectT(n)|r,fvectF(n)|r,fvectW(n)|r,ffuncG(f)|r,ffuncAK(f;f):floatX,n,floatA,floatB,fvectT->p,fvectF->p,fvectW->p,ffuncG,ffuncAK
			-- solution value for linear Fredholm equation of the second kind using 'fred2' output and Nystrom interpolation
voltra:r,floatT0|r,floatH|rw,fvectT(n)|rw,fmatF(m;n)|r,ffuncG(i;f)|r,ffuncAK(i;i;f;f):n,m,floatT0,floatH,fvectT->p,fmatF->p,ffuncG,ffuncAK
			-- solution of system of linear Fredholm equations  of the second kind
	--#############################################################################
	--#
	--#      C H A P T E R   19   -  Partial Differential Equations
	--#
	--#############################################################################
sor:r,dmatA(j;j)|r,dmatB(j;j)|r,dmatC(j;j)|r,dmatD(j;j)|r,dmatE(j;j)|r,dmatF(j;j)|rw,dmatU(j;j)|r,doubleRJAC:dmatA->p,dmatB->p,dmatC->p,dmatD->p,dmatE->p,dmatF->p,dmatU->p,j,doubleRJAC
			-- sucessive over-relaxation solution of boundary value problem
mglin:rw,dmatU(n;n)|r,integerNCYCLE:dmatU->p,n,integerNCYCLE
			-- multigrid solution of linear elliptic partial differential equations
rstrct:r,dmatUC(n;n)|rw,dmatUF(m;m):dmatUC->p,dmatUF->p,n
			-- transfers developing PDE solution from fine grid to coarse grid (subroutine for 'mglin')
#.....interp:rw,dmatUF(n;n)|r,dmatUC(m;m):dmatUC->p,dmatUF->p,n
			-- coarse-to fine solution by bilinear interpolation (subroutine for 'mglin')
addint:rw,dmatUF(n;n)|r,dmatUC(m;m)|w,dmatRES(n;n):dmatUC->p,dmatUF->p,dmatRES->p,n
			-- coarse-to fine solution by bilinear interpolation, with transfer to fine grid (subroutine for 'mglin')
d*anorm2:r,dmatA(n;n):dmatA->p,n
			-- calculates Euclidean norm of matrix
relax:rw,dmatU(n;n)|r,dmatRHS(n;n):dmatU->p,dmatRHS->p,n
			-- red-black Gauss-Seidel relaxation step (subroutine for 'mglin')
resid:w,dmatRES(n;n)|r,dmatU(n;n)|r,dmatRHS(n;n):dmatRES->p,dmatU->p,dmatRHS->p,n
			-- calcuates residual for use in 'mglin' example (subroutine for 'mglin')
copy:w,dmatAOUT(n;n)|r,dmatAIN(n;n):dmatAOUT->p,dmatAIN->p,n
			-- copies matrix to matrix (subroutine for 'mglin')
fill0:rw,dmatU(n;n):dmatU->p,n
			-- fills matrix with zeroes (subroutine for 'mglin')
mgfas:rw,dmatU(n;n)|r,integerMAXCYC:dmatU->p,n,integerMAXCYC
			-- multigrid solution of nonlinear elliptic partial differential equations
relax2:rw,dmatU(n;n)|r,dmatRHS(n;n):dmatU->p,dmatRHS->p,n
			-- red-black nonlinear Gauss-Seidel relaxation step (subroutine for 'mgfas')
matadd:r,dmatA(n;n)|r,dmatB(n;n)|w,dmatC(n;n):dmatA->p,dmatB->p,dmatC->p,n
			-- adds two square matrices
matsub:r,dmatA(n;n)|r,dmatB(n;n)|w,dmatC(n;n):dmatA->p,dmatB->p,dmatC->p,n
			-- subtracts two square matrices
lop:w,dmatOUT(n;n)|r,dmatU(n;n):dmatOUT->p,dmatU->p,n
			-- calculates numerical approximation for left-hand side of nonlinear PDE (subroutine for 'mgfas')
slvsm2:rw,dmatU(n;n)|w,dmatRHS(n;n):dmatU->p,dmatRHS->p
			-- solves nonlinear PDE on coarsest grid (n = 3; subroutine for 'mgfas) 
	--#############################################################################
	--#
	--#      C H A P T E R   20   -  Less-Numerical Algorithms
	--#
	--#############################################################################
machar:w,integerIBETA|w,integerIT|w,integerIRND|w,integerNGRD|w,integerMACHEP|w,integerNEGEP|w,integerIEXP|w,integerMINEXP|w,integerMAXEXP|w,floatEPS|w,floatEPSNEG|w,floatXMIN|w,floatXMAX:&integerIBETA,&integerIT,&integerIRND,&integerNGRD,&integerMACHEP,&integerNEGEP,&integerIEXP,&integerMINEXP,&integerMAXEXP,&floatEPS,&floatEPSNEG,&floatXMIN,&floatXMAX
			-- determine machine float parameters: radix, mantissa size, smallest positive nonzero float, 
			-- float precision, smallest negative nonzero float, etc.
#.....hufapp:r,uvectINDEX(n)|r,uvectNPROB(i):uvectINDEX->p,uvectNPROB->p,n,i
			-- heap-maintenance subroutine for 'hufmak'
#.....hufdec:w,ulongICH|unsigned char *code|unsigned long lcode|unsigned long *nb|huffcode *hcode:
			-- decode string from Huffman code using Huffman decoding table
#.....hufenc:r,ulongICH|cmatCODEP(;)|w,ulongLCODE|w,ulongNB|huffcode *hcode:
			-- encode string into Huffman code using Huffman encoding table 
#.....hufmak:r,uvectNFREQ(n)|n|w,ulongILONG|w,ulongNLONG|huffcode *hcode:
			-- constrict Huffman encoding table from character frequency table
#.....arcmak:r,uvectNFREQ(n)|n|r,ulongNRADD|arithcode *acode:uvectNFREQ->p,n,ulongNRADD,acodeACODE->p
			-- initialize frquency tables for arithmetic coding of strings using input symbol frequency table
#.....arcode:w,ulongICH|cmatCODEP(;)|w,ulongLCODE|w,ulongLCD|integerISIGN|arithcode *acode:
			-- compress/decompress single character into/from arithmetic code
#.....arcsum:r,uvectIIN[]|uvectIOUT[]|unsigned long ja|int nwk|unsigned long nrad|unsigned long nc:
			-- addition of short integer to multiprecision integer (subroutine for 'arcode')
l*igray:r,ulongN|r,integerIS:ulongN,integerIS
			-- return the Gray code of the integer n
#.....i*icrc:r,ushortCRC|r,ivectBUFPTR(n)|r,integerJINIT|r,integerJREV:ushortCRC,ivectBUFPTR->p,n,integerJINIT,integerJREV
			-- compute 16-bit circular redundancy check for an array of integers
i*icrc1:r,ushortCRC|r,ushortONEC:ushortCRC,ushortONEC
			-- compute 16-bit circular redundancy check for one more item added to previously checked array
#.....i*decchk:r,cvectSTRING(n)|w,charCH:cvectSTRING->p,n,&charCH
			-- compute and verify check character for an array of characters 
mpadd:rw,cvectW(n)|r,cvectU(n)|r,cvectV(n):cvectW->p,cvectU->p,cvectV->p,n-1
			-- multiprecision integer add 
mpsub:w,integerIS|rw,cvectW(n)|r,cvectU(n)|r,cvectV(n):&integerIS,cvectW->p,cvectU->p,cvectV->p,n
			-- multiprecision integer subtract 
mpsad:rw,cvectW(n)|r,cvectU(n)|r,integerIV:cvectW->p,cvectU->p,n,integerIV
			-- add short integer to multiprecision integer  
mpsmu:rw,cvectW(n)|r,cvectU(n)|r,integerIV:cvectW->p,cvectU->p,n,integerIV
			-- multiply multiprecision integer by short integer 
mpneg:rw,cvectU(n):cvectU->p,n
			-- multiprecision integer 1-s complement negate 
mpmov:rw,cvectU(n)|r,cvectV(n):cvectU->p,cvectV->p,n
			-- multiprecision integer copy 
mplsh:rw,cvectU(n):cvectU->p,n-1
			-- multiprecision integer 1-byte shift 
mpmul:rw,cvectW(k)|rw,cvectU(n)|rw,cvectV(m):cvectW->p,cvectU->p,cvectV->p,n,m
			-- multiprecision integer multiply using FFT; k must be m + n 
mpinv:rw,cvectU(n)|rw,cvectV(m):cvectU->p,cvectV->p,n,m
			-- multiprecision reciprocal, producing more output bytes than input bytes
			-- lead input byte represents integer part of denominator
mpdiv:rw,cvectQ(k)|rw,cvectR(m)|r,cvectU(n)|r,cvectV(m):cvectQ->p,cvectR->p,cvectU->p,cvectV->p,n,m
	-- multiprecision integer division; length k of quotient must be (length num) - (length denom) + 1
mpsdv:rw,cvectW(n)|r,cvectU(n)|r,integerIV|w,integerIR:cvectW->p,cvectU->p,n-1,integerIV,&integerIR
			-- division of multiprecision integer by 1-byte intteger 
mpsqrt:rw,cvectW(n)|rw,cvectU(n)|rw,cvectV(m):cvectW->p,cvectU->p,cvectV->p,n,m
			-- multiprecision integer square root and reciprocal of square root
mp2dfr:rw,cvectA(n)|rw,cvectS(m)|w,integerDIGITS:cvectA->p,cvectS->p,n,&integerDIGITS
			-- conversion of mutiprecision quantity to decimal format; decimal lenth is 2.408
			-- times original length
#.....mppi:int n:
			-- calculates first n bytes of pi 
caldat:r,ulongJULIAN|w,integerMM|w,integerID|w,integerIYYY:ulongJULIAN,&integerMM,&integerID,&integerIYYY
			-- convert Julian day number to calendar date
flmoon:r,integerN|r,integerNPH|w,longJD|w,floatFRAC:integerN,integerNPH,&longJD,&floatFRAC
			-- numerical date of n-th full moon since 1900
l*julday:r,integerMM|r,integerID|r,integerIYYY:integerMM,integerID,integerIYYY
			-- convert calendar date to Julian day number
