Method atlas

The algorithms behind the answers.

This is not a general encyclopedia of numerical analysis. It is a map of the methods that belong to the book and its companion software, with room for demonstrations where seeing the method work is better than another paragraph.

8 domains75 methods80 R functions

CMNA Laboratory

Some algorithms should be watched, not merely read.

The laboratory pages turn selected methods into experiments. Change a tolerance, choose a function, walk through individual iterations, and compare the path different algorithms take toward the same answer.

Live lab

Bisection, one interval at a time

Watch the bracket contract, inspect every midpoint, and scrub backward and forward through the iterations.

Open the bisection laboratory →
Guide

Method finder

Start with the computational problem and walk toward the CMNA methods that fit the information you actually have.

Open the method finder →
Integration

Simpson's rule, panel by panel

Give R your own integrand and watch the quadratic panels accumulate into a numerical integral.

Open the Simpson laboratory →
Linear algebra

Watch a system converge

Paste your own matrix and compare Jacobi with Gauss-Seidel as their residuals shrink—or fail to.

Open the iterative solver lab →
Differential equations

Four slopes make a step

Supply an arbitrary R ODE and compare Euler, midpoint, and RK4 while playing through RK4's internal stages.

Open the IVP laboratory →
Optimization

Follow the gradient downhill

Define your own two-dimensional objective and gradient in R, then watch every descent step cross the sampled landscape.

Open the gradient descent lab →
Worked problems

Visit the Numerical Zoo

Wilkinson, Hilbert, Runge, Himmelblau, cancellation, unstable stepping, and other examples kept around because they expose numerical assumptions.

Open the Numerical Zoo →

Error and elementary computation

Small algorithms that expose evaluation order, accumulated error, and the difference between a formula and a numerically sensible implementation.

Naive polynomial evaluationnaivepoly
Cached polynomial evaluationbetterpoly
Horner's methodhornerrhorner
Naive summationnaivesum
Kahan summationkahansum
Naive divisionnaivediv
Long divisionlongdiv
Primality testisPrime
Nth rootnthroot
Quadratic formulaquadraticquadratic2
Fibonacci sequencefibonacci
Wilkinson's polynomialwilkinson
Himmelblau functionhimmelblau

Linear algebra

Row operations, matrix reduction, decompositions, and iterative methods implemented close enough to the mathematics to inspect.

Row replacementreplacerow
Row scalingscalerow
Row swappingswaprows
Vector normvecnorm
Determinantdetmatrix
Matrix inverseinvmatrix
Row-echelon formrefmatrix
Reduced row-echelon formrrefmatrix
Solve by row reductionsolvematrix
Cholesky decompositioncholeskymatrix
LU decompositionlumatrix
Conjugate gradientcgmmatrix
Gauss-Seidel iterationLABgaussseidelJacobi iterationLABjacobi
Tridiagonal matrix solvertridiagmatrix

Interpolation and extrapolation

Polynomial interpolation, splines, Bézier curves, multidimensional interpolators, and an image-resizing application.

Linear interpolationlinterp
Polynomial interpolationLABpolyinterpPiecewise linear interpolationLABpwiselinterpCubic splineLABcubicspline
Quadratic Bézier curveqbezier
Cubic Bézier curvecbezier
Bilinear interpolationbilinear
Nearest neighbornn
Nearest-neighbor image resizingresizeImageNN
Bilinear image resizingresizeImageBL

Differentiation

Finite-difference formulas for first and second derivatives.

Numerical integration

Newton-Cotes rules, Gaussian quadrature, adaptive integration, Romberg integration, Monte Carlo methods, and applications.

Midpoint rulemidpt
Trapezoid ruletrap
Simpson's ruleLABsimp
Simpson's 3/8 rulesimp38
Gaussian integration driverLABgaussint
Gauss-Hermite quadraturegauss.hermite
Gauss-Laguerre quadraturegauss.laguerre
Gauss-Legendre quadratureLABgauss.legendre
Recursive adaptive integrationadaptint
Romberg integrationromberg
Monte Carlo integration, 1DLABmcint
Monte Carlo integration, 2Dmcint2
Shell method for volumeshellmethod
Disc method for volumediscmethod
Gini coefficientginiquintile

Root finding

Three classic approaches that make assumptions, robustness, and convergence behavior especially easy to compare.

Compare methods →

Optimization

Continuous and discrete searches, from golden-section and gradient methods through simulated annealing.

Golden-section maximumLABgoldsectmaxGolden-section minimumLABgoldsectminGradient descentLABgdgdlsgraddsc
Gradient ascentgradasc
Hill climbinghillclimbing
Simulated annealingLABsa
Traveling salesperson by simulated annealingtspsa

Differential equations

Initial-value methods, systems, elementary PDE examples, and boundary-value applications.

Euler methodeuler
Midpoint method for IVPsmidptivp
Fourth-order Runge-KuttaLABrungekutta4
Adams-Bashforthadamsbashforth
Euler method for systemseulersys
Heat equation, 1DLABheatWave equation, 1DLABwave
Boundary-value examplesbvpexamplebvpexample10