Miscellaneous TOMS (& CACM) algorithms
N.B. I have been asked to provide a link to the copyright
policy of the ACM. Loosely paraphrased, this allows use, and modification,
of the TOMS algorithms for most non-commercial purposes. It also emphasizes that
the ACM accepts no responsibility for the accuracy of the code.
Updated 19 November 2003
Calculate ordinates and weights for Gaussian integration.
Calculate 2-tailed probabilities from Student's t distribution.
calculates quantiles of the t-distribution. These are translations of
Geoff Hill's algol code; Geoff was acting chief of CSIRO Division of
Mathematical Statistics at one time. There is also a test program which may be
This is the classic Jenkins & Traub algorithm (CACM 419) for the solution
of complex polynomials.
q_cpoly.f90 is a
version in quadruple precision.
TOMS algorithm 493 for the solution of polynomial equations with real coefficients.
q_rpoly.f90 is a
version in quadruple precision.
In situ transpose of an MxN matrix.
Eigenvalues & vectors of real skew-symmetric matrices (i.e. a(i,j) =
-a(j,i) ), and of symmetric matrices with zero diagonal elements.
- toms533.zip A
simple package for the solution of sparse linear equations. It is even shorter
and simpler in Fortran 90 as the user does not supply work arrays. The zipped
file (use PKUNZIP or WinZip to access the contents) contains two demo
programs. The second of these contained an error in the F77 version, and the
solution vector was completely wrong.
Fitting linear regression models by minimizing the sum of absolute deviations.
i.e. using the L_1 norm. There are also, a short test program:
A data file for the test program:
and a file showing the output:
Integration from zero to infinity of oscillating functions. Includes driver
Fit a cubic spline to noisy data using generalized cross-validation. Data may
be unevenly spaced, and have different weights. Bayesian point error estimates
(TOMS 643) Fisher's exact test for two-way contingency tables. This is a
zipped file including a driver, data sets, and output. Use pkunzip or winzip
to unpack the files.
Bessel and Airy functions for complex arguments. This is a zipped file
including test programs. Use pkunzip or winzip to unpack the files.
The incomplete gamma function and its inverse. Test program: t_incgam.f90
Quadratic spline interpolation of a bivariate function defined by irregularly
Quadratic spline interpolation of a trivariate function defined by irregularly
IQPACK (Interpolation / Quadrature). Calculates nodes and weights for 8 types
of Gaussian quadrature (Legendre, Chebyshev, Hermite, rational polynomial,
Global minimization using a stochastic algorithm, with 37 test problems test667.f90.
Many of the test problems require hundreds of thousands of function
evaluations. See also global.f90 below in the miscellaneous code section.
The file for r_hyperg.f90 contains TOMS algorithm 668 for generating random
values from the hypergeometric distribution.
The exponential integral En(x) for complex argument x.
A package for the solution of systems of ordinary differential equations:
DY/DT = F(Y,T). There is also a test program:
Confluent hypergeometric function for complex arguments.
Special functions by W.J. Cody and others. Particularly Bessel functions,
but also the gamma, normal distribution, error, Dawson and psi functions.
Multivariate normal integrals for dimension up to 20.
Walter Gautschi's package for generating orthogonal polynomials and Gauss-type
quadrature rules. The zip file contains a double precision, and most of the
single precision code, plus the set of 11 test programs and Gautschi's output.
Renka's TRIPACK package for constrained 2D Delaunay triangulation, including
test program (with built-in data) and output files.
Code for computing some uncommon special functions, including Abramowitz
functions, Airy function variants, integrals of zero-order Bessel functions,
Debye functions, Struve functions, Synchrotron radiation and transport
functions, Lobachevski and Stromgen integrals, etc. A test program is
included. This is a zip file.
Bicubic interpolation from a rectangular grid of data. There is also a test
Code for computing Pade'-Hermite and simultaneous Pade' approximants, plus two
This subroutine solves bound-constrained optimization problems by using the
compact formula of the limited memory BFGS updates.
This contains both TOMS 739 (UNCMIN) for unconstrained minimization, and TOMS
768 (TENSOLVE) for the solution of sets of non-linear equations.
Cubic interpolation of scattered data in two dimensions with continuous second
This package is for the numerical inversion of Laplace transforms. The
original was in very poor Fortran 77 which used many non-standard features,
and it contained many bugs. Each compiler I tried gave different errors, and
then different results when the errors were corrected. This version is in
standard Fortran and gives reproducible results.
This package is for local minimization, with or without convex constraints. It
requires the user to supply first derivatives. This version is in standard
Fortran. It uses the so-called spectral projected gradient (SPG) method.
This is for the computation of the Airy functions Ai(z) and Bi(z) and their
derivatives for complex arguments.
Click here to return to my
main web site.