Mathematics: Numerical Methods

Polynomial approximations to functions. The polynomials are constructed using minimax algorithms.
Minimax polynomial approximations for sin(x) for x in [-pi/2,pi/2] and for odd degrees 3 through 11. Range reduction for x outside [-pi/2,pi/2] is obtained using periodicity and trigonometric identities.
Minimax polynomial approximations for cos(x) for x in [-pi/2,pi/2] and for even degrees 2 through 10. Range reduction for x outside [-pi/2,pi/2] is obtained using periodicity and trigonometric identities.
Minimax polynomial approximations for tan(x) for x in [-pi/4,pi/4] and for odd degrees 3 through 13. Range reduction for x outside [-pi/4,pi/4] but inside (-pi/2,pi/2) is obtained using the identity tan(z + pi/4) = (1 + tan(z))/(1 - tan(z)).
Minimax approximations for asin(x) of the form f(x) = pi/2 - sqrt(1-x)*p(x) for x in [0,1] and for polynomials of degrees 1 through 8.
Minimax approximations for acos(x) of the form f(x) = sqrt(1-x)*p(x) for x in [0,1] and for polynomials of degrees 1 through 8.
Minimax polynomial approximations for atan(x) for x in [-1,1] and for odd degrees 3 through 13. Range reduction for x outside [-1,1] is obtained by atan(x) = pi/2 - atan(1/x) for x > 0 and atan(x) = -pi/2 - atan(1/x) for x < 0.
Minimax polynomial approximations for sqrt(x) for x in [1,2] and for degrees 1 through 8. Range reduction is used for x outside [1,2] to obtain approximations to sqrt(x) for x >= 0.
Minimax polynomial approximations for 1/sqrt(x) for x in [1,2] and for degrees 1 through 8. Range reduction is used for x outside [1,2] to obtain approximations to 1/sqrt(x) for x > 0.
Minimax polynomial approximations for exp2(x) = 2^x for x in [0,1] and for degrees 1 through 7. Range reduction is used for x outside [0,1] to obtain approximations to exp2(x) for any x >= 0. Multiplication of the polynomial coefficients by a constant produces approximations for exp(x) = e^x for x >= 0.
Minimax polynomial approximations for log2(x), the logarithm base 2 of x, for x in [1,2] and for degrees 1 through 8. Range reduction is used for x outside [1,2] to obtain approximations to log2(x) for any x > 0. Multiplication of the polynomial coefficients by a constant produces approximations for log(x), the logarithm base e of x, for x > 0.
Estimates of sin(t*angle)/sin(angle) to be used in SLERP computations. The comments in the ChebyshevRatio class are extensive.
Gaussian elimination for use in solving linear systems and for computing matrix inverses and determinants. Linear system solvers for small N (2, 3, 4), for tridiagonal systems, and for symmetric matrix systems using the conjugate gradient method. Banded system solvers are found in class BandedMatrix (see the Mathematics Algebra page).
Root finding, including bisection and Brent's method (for any type of continuous function) and polynomial root finders (using recursion in dimension to bound roots). The files with suffix QR are root finders using QR iteration with Francis QR step. The RootsBisection class is deprecated, replaced by RootsBisection1. The RootsBisection2 class is for functions of 2 independent variables. The RootsQuadratic class is designed for robust estimation of quadratic polynomial roots. The class RootsPolynomial is now deprecated. The general root finder of that class is replaced by class RootsGeneralPolynomial.
Minimization of functions of one variable using minimum bounding and parabolic interpolation (Minimize1). Minimization of functions of multiple variables using Powell's direction set method, where each 1-dimensional search uses the minimization algorithm for a function of one variable (MinimizeN). An implementation of the Gauss-Newton minimization algorithm and an implementation of the Levenberg-Marquardt minimization algorithm for nonlinear least-squares problems.
Numerical integration using the trapezoid rule, Romberg integration, or Gaussian quadrature.
Numerical solvers for ordinary differential equations. The abstract base class is OdeSolver.
Iterative algorithm for computing the eigenvalues and eigenvectors of symmetric matrices. The code is based on the algorithms presented in Matrix Computations, 2nd edition by G. H. Golub and C. F. Van Loan. The code has been tested for matrices as large as 2048x2048 to verify that the relative error bounds guaranteed by the theory are satisfied. Special-case code is also available for 2x2 and 3x3 matrices. The unsymmetric eigensolver is also based on the aforementioned book and uses QR iteration with Francis QR step.
Iterative algorithm for computing the singular value decomposition of an m-by-n matrix with m ≥ n. The code is based on the algorithms presented in Matrix Computations, 2nd edition by G. H. Golub and C. F. Van Loan. The code has been tested for matrices as large as 2048x2048 to verify that the relative error bounds guaranteed by the theory are satisfied.
An implementation of a solver for the Linear Complementarity Problem (LCP). This is a new implementation different from the one that shipped with Wild Magic 5. The code supports exact rational arithmetic (as well as floating-point types) to provide an error-free solution. This code will be used for algorithms in GTEngine that involve convex quadratic programming. The solver uses the Lemke Methods and perturbs the q-vector terms to polynomials to avoid degeneracies (i.e. when a q-term is zero and leads to cycling in the algorithm).
An implementation of the Cholesky decomposition and an implementation of the Block Cholesky decomposition for positive definite matrices.
An implementation of the LDLT decomposition and an implementation of the Block LDLT decomposition for positive definite matrices.
An implementation of the Remez algorithm for computing the coefficients of minimax polynomials that approximate functions.
Minimax polynomial approximations to functions that appear in the formulas for rotation matrices and derivatives of rotation matrices. Code for computing approximate rotation and rotation-derivative matrices.