Numerical analysis designs algorithms that approximate mathematical answers while controlling cost and error. Its central question is how much of a computed answer can be trusted. Finding a zero of a function, evaluating an integral, solving a linear system, and evolving an ordinary differential equation all demand choices about accuracy, work, and the information available. MIT's numerical-methods course explicitly treats performance and accuracy as joint concerns.[ref]
Three questions organize error analysis. Truncation error measures the approximation introduced by an algorithm even in exact arithmetic; roundoff error comes from finite precision; the condition number measures sensitivity inherent in the problem. Numerical stability asks how the chosen algorithm propagates perturbations. These distinctions suggest different remedies: refine an approximation, change precision or arithmetic, or improve the accuracy of the input.
For example, the square root has relative condition number for : a small relative change in produces about half that relative change in . In contrast, has relative condition number . Changing to changes to about : an input change of about produces an output change of about . This sensitivity exists even with exact arithmetic. MIT's conditioning lecture separates the condition number from roundoff error in precisely this way.[ref]
A time-stepping method approximates the evolution of an ordinary differential equation by successive updates at discrete times. It can be applied after a spatial finite element method has converted a time-dependent partial differential equation into an ordinary differential equation system. The implicit time-stepping method is one class of such methods.
An implicit time-stepping method determines a new solution value through an equation involving that same value. A small-step contraction mapping argument often establishes local solvability when the vector field is Lipschitz continuous. Examples include the Backward Euler method, implicit Runge-Kutta methods and implicit linear multistep methods. Solvability of the update is a separate issue from stability of a numerical method.
Numerical differentiation estimates derivatives from finitely many function values, often by differentiating an interpolation polynomial or using a finite difference. Its error combines truncation error from the formula with errors already present in the sampled values and additional roundoff error. Decreasing the sample spacing can decrease truncation error while increasing the effect of uncertain values. This tradeoff is explained by the ill-posedness of numerical differentiation when only an absolute value-error bound is available.
Recovering a derivative from values controlled only in the uniform norm is an ill-posed problem: the differentiation map is not continuous in those norms. On , take . Then , while has uniform norm one for every . Arbitrarily small value perturbations can therefore conceal nonvanishing derivative changes.
Numerical differentiation can still be useful when additional smoothness bounds, a suitable sampling scale, or a regularization method control the admissible changes. The basic noise amplification by differentiation of a linear interpolant gives a finite-data version: endpoint uncertainty of size produces derivative uncertainty of order at spacing .
For linear interpolation at zero and , an error in the second sampled value, with the first exact, changes the linear interpolant by . On , its uniform norm is exactly , whereas the derivative change is the constant . With independent absolute bounds on both samples, the value change remains at most and the derivative change is at most , attained for opposite endpoint errors.
Thus bounded absolute sample noise can remain bounded under value interpolation while becoming unbounded under numerical differentiation as . Fixed nonzero sample noise also prevents exact convergence of the value approximation; stability against perturbations and convergence to exact data are different assertions. For a second-sample error with fixed , value convergence requires , while derivative convergence requires in little o notation, in addition to vanishing truncation error.
Replacing continuous space, time or fields by finite degrees of freedom permits a numerical forecast. Approximation and truncation errors depend on resolution, algorithms and unresolved scales; they are distinct from observation errors and from roundoff. Refinement reduces a consistent truncation error only when stability and the relevant smoothness assumptions permit convergence.
A method defining the next state through equations involving that unknown state. Solving these equations can be costly, while enlarged stability regions are useful for stiff problems.
A method whose next state is obtained from known stages without solving simultaneous equations involving the unknown next state. Stability may restrict its admissible step sizes.
A one-step method approximates an ordinary differential equation using the current approximate solution and evaluations within the next step. The function is its increment function. A Runge-Kutta method may use several intermediate stages while remaining a one-step method: it does not require additional previous solution values as a linear multistep method does. Its consistency error is the exact-start update defect divided by .
A Runge-Kutta method advances an initial value problem , , by sampling its vector field at several trial states within one time step. These samples are Runge-Kutta stages; a weighted combination of their slopes produces the next state. The construction improves on the single tangent line used by the Euler method while requiring evaluations of , rather than explicit higher derivatives of the solution. It applies to scalar equations and systems of ordinary differential equations alike. The coefficient choices distinguish methods such as Heun's method, the classical fourth-order Runge-Kutta method and implicit Runge-Kutta methods.
For stages, write for the stage matrix, for relative time nodes and for output weights. A time step of length computes
Here is a slope, with units of state per time; is a state increment. Another common convention writes , so its stage states are and its output is . These are equivalent conventions: including both inside and again in the output would count the time step twice. The textbook formulation uses the increment convention.[ref]
Usually the Butcher tableau obeys , called internal consistency. Stage then combines slopes over an effective time . The second-order conditions with independent Runge-Kutta abscissae explain what changes when time nodes are specified independently. A Runge-Kutta stage is generally an auxiliary approximation, not a separate accepted solution value at its node. Several stages can even have the same time node but different state arguments, as in the classical fourth-order Runge-Kutta method.
The useful idea is to approximate the integral without knowing the intermediate exact trajectory. Trial states provide places to sample , and Butcher order conditions make the resulting combination agree with the exact Taylor expansion. More stages alone do not guarantee a higher order of a numerical method: their coefficients must satisfy the appropriate conditions. Embedded Runge-Kutta pairs reuse these same samples for a second output and a practical local error estimator.
A Runge-Kutta stage consists of a trial state at the time node and the corresponding vector field evaluation . In the slope convention, . Stages belong to the construction of one Runge-Kutta method step; they need not have the same accuracy as its final output. Stage states can leave the physically allowed region even when the endpoint lies inside it, so must be defined at every stage used.
An explicit Runge-Kutta method has whenever . Its stage matrix is strictly lower triangular: compute each Runge-Kutta stage using already known slopes, starting with . In contrast, an implicit Runge-Kutta method requires solving coupled stage equations, whose existence is addressed by stage solvability of an implicit Runge-Kutta method.
Here Heun's method means the explicit endpoint-averaging Runge-Kutta method: take an Euler predictor , sample there, and average it with for the output. The second Runge-Kutta stage is evaluated at the predictor, not at the corrected endpoint. In particular it requires no implicit solve as the ODE trapezoidal rule does. Naming conventions vary between books; the formulas specify the method unambiguously.[ref]
For smooth , a Taylor expansion about gives , where is the state Jacobian matrix. Consequently the output is , matching the exact solution through degree two by the chain rule. This gives local truncation error and, with the usual bounded smoothness and Lipschitz continuity hypotheses on a fixed finite interval, global error . The Euler-Heun embedded pair compares this output with its Euler predictor.
Figure 1.
Euler-Heun stage geometry for y prime equals y: sample at the Euler predictor, then average slopes for the corrected endpoint
. Details.
For , and , the sampled slopes are and . Transporting the second slope to the starting point would end at ; the average slope instead ends at . The exact exponential function reaches . The magnified endpoint comparison separates the pair difference from the actual Heun local defect .
An -stage Runge-Kutta method has stability function , a rational function with numerator and denominator degrees at most . Order forces , so uniqueness of the diagonal Padé approximant identifies with . That approximant has no poles in the closed left half-plane and modulus at most one there. Hence every such maximal-order method is A-stable. Since the Padé approximant numerator and denominator are coprime and both have degree , the original stage determinant cannot have hidden canceled poles in that half-plane.
This one-step family interpolates between the Forward Euler method at , the trapezoidal rule at , and the Backward Euler method at . Its stability function is . It is first order except at one half, where it is second order. Applying it to spatial diffusion gives the theta diffusion stability criterion.
On an orthogonal diffusion eigenmode, the theta method has the displayed amplification with . The identity proves contraction at all nonnegative exactly when . For , contraction holds up to , with a positive denominator in that range. Orthogonality is what transfers these modal bounds to a full L2 norm estimate.
At , arbitrarily stiff heat modes approach amplification : the Crank-Nicolson method is contractive but does not rapidly damp unresolved rough components. The Backward Euler method instead has limit zero. Thus unconditional linear stability and strong stiff decay are different requirements. High smooth-data consistency order alone does not imply a uniform high-order estimate down to the initial instant for arbitrary L2 initial conditions.
A strong stability preserving Runge-Kutta method writes its stages as convex combinations of previously computed states and suitable Forward Euler method steps. It transfers any convex-functional nonincrease property of the forward step, such as a norm bound, under a proportionally scaled time-step restriction.
For example, if is nonexpansive in a norm, then and is also nonexpansive: the triangle inequality bounds the new difference by one half of the initial difference plus one half of the twice-advanced difference. Both are at most the initial difference. A Taylor expansion yields , so this is a second-order Runge-Kutta method. The forward-step hypothesis must hold on the stage states; preservation of one chosen convex bound is not the same as unconditional B-stability.
The classical four-stage explicit Runge-Kutta method uses
It satisfies the fourth-order conditions for a Runge-Kutta method. Its polynomial stability function excludes A-stability, while gives the imaginary-axis stability interval .
A Butcher tableau records a Runge-Kutta method's stage matrix , time nodes , and output weights in the block array
Read row above the line as the recipe for Runge-Kutta stage : the left entry gives , and the right entries give the coefficients in . Below the line, weights slope in the final update. Zeros on and above the diagonal identify an Explicit Runge-Kutta method. For the internally consistent convention, row sums of equal ; first-order consistency of a numerical method also requires . An embedded Runge-Kutta pair adds another weight row while retaining .
A Butcher order condition equates the coefficient assigned by a Runge-Kutta method to a rooted tree with the corresponding exact Taylor coefficient. Satisfying every condition through tree order is equivalent to Runge–Kutta order at least .
For a general nonautonomous Runge-Kutta method, Taylor expansion of stage gives . Matching the exact increment gives the three displayed conditions. When internal consistency is imposed, the last two coincide. Internal consistency is a usual tableau convention, but is not logically necessary for order two of a generalized tableau.
With and , a Runge-Kutta method has order at least four exactly when the eight Butcher order conditions
hold; powers of are componentwise. These conditions match the numerical and exact coefficients indexed by rooted trees through order four. Matching the scalar Dahlquist test equation alone is insufficient to check the nonlinear Butcher order conditions.
An implicit Runge-Kutta method defines one or more stages through equations involving those same stages.
For stages and with update , the method has order two for every fixed real . The third-order coefficient of is always , not , so no parameter gives third order on general nonlinear equations. The displayed stability function is bounded throughout the left half-plane only when , when it is the A-stable trapezoidal function . It is not L-stable.
For a vector field uniformly Lipschitz continuous in the state with constant , the stage fixed-point map of an implicit Runge-Kutta method is a contraction in the maximum stage norm if . The contraction mapping theorem then gives unique stages. This is a sufficient small-step condition; a dissipative vector field may permit solvability for larger steps. An algebraic stability or B-stability estimate compares existing stage solutions and should not be mistaken for an unqualified stage-existence theorem.
The implicit midpoint rule advances an autonomous ordinary differential equation by
It is a second-order, A-stable, time-symmetric numerical method.
The implicit midpoint rule is the midpoint method with . It is a one-stage implicit Runge-Kutta method.
For a uniformly Lipschitz continuous state field with constant , an implicit midpoint rule step is uniquely solvable when , by the contraction mapping theorem. Write its step map as , where . Subtracting the increment equations gives
Therefore , and the triangle inequality gives the bound for . Combining it with the implicit midpoint consistency bound yields
for . This follows by summing the geometric error recurrence with forcing . For and , , proving second-order global error with exact starting data. If , the direct bound is .
For an exact solution , define the normalized local truncation error of the implicit midpoint rule by
If , and the state Jacobian matrix of has operator norm at most on the intervening state segments, then the displayed bound holds uniformly on a fixed finite interval. To prove it, put . Symmetric Taylor expansions give
For the first bound, integrate the second-order remainder of over the symmetric step; for the second, average the second-order remainders of at the endpoints. The odd terms cancel. The Lipschitz condition for and finish the proof by the triangle inequality. The unnormalized step residual is .
The Crank--Nicolson method applies the trapezoidal rule to a semidiscrete evolution equation. For a linear system its update is
For symmetric negative semidefinite matrices , each factor has norm at most one, since its eigenvalues are with . The same holds for , so their ordered product is a contraction for every , whether or not commute. This proves unconditional discrete L2 norm stability of the split Crank-Nicolson method for directional diffusion. Its splitting error remains first order in general, because the product's quadratic defect is .
Given distinct nodes , a collocation Runge-Kutta method uses the Lagrange basis with and . Its stages enforce the differential equation at the collocation nodes.
For distinct nodes , the two-stage collocation Runge-Kutta method has stability function
The denominator has no zeros in the closed left half-plane. On the imaginary axis the denominator's squared modulus minus the numerator's is . Thus , equivalently , is necessary and sufficient for A-stability, using the maximum modulus principle and the bound at infinity.
For distinct collocation nodes, let . If for , and the next moment is nonzero, the associated interpolatory quadrature has order , and the collocation Runge-Kutta method has the same classical order for sufficiently smooth differential equations. Here . Equivalently, if the quadrature is exact through degree but not degree , the method has order . The generic order is at least , Gauss collocation methods reach , and Radau IIA methods reach .
For collocation nodes, the residual of the collocation polynomial vanishes at each node and contains the factor . Quadrature exactness through degree implies for every polynomial of degree at most . Expand the smooth vector-field interpolation error and the derivative of the exact flow in powers of the step. Every endpoint-error term of degree below has this vanishing weighted moment, so the endpoint local error is , although the interior stage accuracy is generally only . A step Lipschitz estimate and discrete Gronwall inequality then give global order . Gaussian nodes attain , while the first nonexact quadrature moment bounds the order from above.
For a collocation Runge-Kutta method, , where the Lagrange interpolation basis obeys . Hence each row sum is its collocation node. Failure of this identity disproves a claimed collocation tableau with those nodes. The identity alone is necessary rather than sufficient: the individual integrated basis coefficients must also agree.
A Lobatto IIIA method collocates at the Lobatto quadrature nodes, including both endpoints of the time interval. Its three-stage version has
The Butcher order conditions give order four. Its stability function is
which is A-stable but not L-stable. It is not algebraically stable: the first diagonal entry of the defining matrix is . This distinguishes linear A-stability from nonlinear algebraic stability.
The -stage Gauss--Legendre Runge--Kutta method collocates at the Gauss--Legendre quadrature nodes on . It is symmetric, A-stable, and has order .
Choose as the polynomial roots of in , and form the Lagrange interpolation polynomials . The Gauss collocation method has and . This gives explicit coefficient formulas after finding polynomial roots: if , these integrals are and . Gaussian quadrature gives order .
The two-stage Gauss--Legendre Runge-Kutta method uses nodes , weights and coefficients , , . The Butcher order conditions give order four. Its stability function is the displayed rational function, which is A-stable. The algebraic stability matrix is zero, so positive weights also give nonlinear contractivity for dissipative vector fields.
An -stage Radau IIA method collocates at the right-endpoint Radau nodes. It has order and is both algebraically stable and L-stable.
Suppose an -stage Runge-Kutta method has order , an invertible matrix , and . Its stability function is . The adjugate matrix formula gives a rational function with denominator degree and numerator degree at most ; its zero limit at infinity lowers the latter degree to at most . The order of a numerical method gives , identifying the Padé approximant. Uniqueness follows because the cross-multiplied difference of two candidates has degree at most but a zero of order at least , so is identically zero. The A-stability of near-diagonal exponential Padé approximants then proves A-stability, and the zero limit proves L-stability. These conditions identify the stability function; they do not alone claim uniqueness of all entries of the Runge-Kutta method tableau.
A Runge-Kutta method is algebraically stable when and the matrix with is positive semidefinite. Algebraic stability implies contractivity for dissipative differential equations.
For stage states and a vector field with , expansion of the new squared norm gives , where . Hence preserves the quadratic form exactly for every well-defined step. The same argument with a fixed symmetric matrix in the inner product preserves any quadratic invariant of the vector field. In particular it preserves the Euclidean norm for a skew-symmetric matrix differential equation.
An algebraically stable Runge-Kutta method is B-stable: for a dissipative vector field, a well-defined step cannot increase the distance between two starting values. This assumes that the compared stage equations have solutions, as required by stage solvability of an implicit Runge-Kutta method. The Runge-Kutta contractivity identity expresses the distance change as a nonpositive weighted term coming from the dissipative vector field minus a nonnegative quadratic form involving the matrix defining algebraic stability. Positive weights also rule out stage poles in the open left half-plane on the scalar test equation, giving A-stability there; zero-weight redundant stages need separate solvability attention.
For differences between corresponding stages and differences between their vector fields, a Runge--Kutta step satisfies
To derive the identity, expand the squared norm of and substitute in the linear term. Symmetrizing the double sum gives the displayed coefficients . For a dissipative vector field, the first sum is nonpositive when , and the second sum is nonnegative when the matrix is a positive semidefinite matrix. Thus algebraic stability implies B-stability.
As a quadrature rule, the trapezoidal rule replaces an integrand by the linear interpolation joining its two endpoint values:
For nonnegative endpoint values, this is the area of a trapezoid; in general it is a signed area. The quadrature nodes are , each with quadrature weight . Unlike the midpoint quadrature rule, it uses endpoint samples, which can be reused between adjacent panels.
Every affine function agrees with its linear interpolation, so the trapezoidal rule integrates it exactly. On , gives . On , the polynomial instead gives , exceeding by . Its degree of precision of a quadrature rule is exactly one.
If , its signed approximation error satisfies
A convex function lies below its endpoint chord, so the trapezoidal rule overestimates its integral; a concave function gives the reverse inequality. The error formula assumes that the second derivative exists and is a continuous function throughout the closed interval.[ref] A short derivation is the identity
obtained by two integrations by parts. The nonnegative Peano kernel has integral , and the weighted mean value theorem for integrals gives the formula.
This time-stepping use applies the same trapezoidal rule to the integral of the derivative in an ordinary differential equation. That connection explains its place under implicit Runge-Kutta methods; its quadrature behavior and the nonlinear issue in trapezoidal rule fails B-stability concern different uses of the same endpoint averaging.
For with , the trapezoidal rule satisfies the displayed bound, and the constant is best possible. The polynomial interpolation error for the endpoint linear interpolant satisfies , where . Integrating this inequality and using the triangle inequality for an integral proves the bound because . Equality holds for : the exact integral is , its trapezoidal rule estimate is , and .
On an equal-panel partition of an interval, with , sum the trapezoidal rule over adjacent panels:
There are distinct quadrature nodes. Each interior sample belongs to two panels and therefore has quadrature weight , while each endpoint has quadrature weight . Equivalently, the composite trapezoidal rule integrates the piecewise linear function obtained by linear interpolation exactly.[ref]
For and , summing panel quadrature errors gives
for some . Thus panel quadrature errors of order accumulate to order , using big O notation.[ref] On a nonuniform partition of an interval with widths and largest width , the bound is .
For the polynomial on , direct summation yields
Both quadrature errors shrink by exactly four when doubles, with opposite signs. This exact relation belongs to this polynomial example; the trapezoidal rule is not always twice as inaccurate as the midpoint quadrature rule.
Figure 1.
Quadratic quadrature errors fall by four on refinement while a common sample bias persists
. Details.
The left plot uses exact polynomial sums; the right adds a common sample bias to the composite trapezoidal rule. That mathematical model converges to , showing why smaller panels alone do not ensure accuracy for noisy samples. It illustrates noise sensitivity of a quadrature rule, rather than measured data.
On a partition of an interval symmetric about zero, the composite trapezoidal rule gives opposite quadrature nodes equal quadrature weights. Samples of an odd function cancel pairwise, and a zero quadrature node contributes zero. For a continuous odd function, its exact integral over is also zero. Adding any affine function preserves exactness by linearity of the integral and of the quadrature rule. For example, is nonpolynomial but both the exact integral and every uniform-grid composite trapezoidal rule value on are two.
On a uniform partition of with width , the right Riemann sum and the composite trapezoidal rule have equal weights at every interior mesh point. They differ only by adding half a final-endpoint weight and removing half an initial-endpoint weight. This proves the displayed identity. For continuous , both converge to its definite integral; their finite endpoint correction need not be confused with the smaller trapezoidal discretization error for a smooth integrand.
If is twice continuously differentiable on , take a uniform bound . On one panel , two integrations by parts give the signed quadrature error
The nonnegative kernel has integral , so the absolute error is at most . Summing equal panels proves the displayed bound. The maximum exists on the closed interval; a supremum or any known uniform bound also suffices. The estimate certifies a sufficient panel count, which need not be the least count achieving a particular actual error.
The trapezoidal rule is A-stable but is not B-stable. For the dissipative vector field at step size one, its uniquely defined step map obeys . At , and implicit differentiation gives , so nearby states expand rather than contract. This is a concrete nonlinear obstruction, rather than merely failure of the sufficient algebraic stability criterion.
A one-step numerical method with step map is time symmetric when . Its leading local-error power is odd, so every nontrivial consistent time-symmetric method has even order.
The order is the highest power through which the one-step expansion matches the exact Taylor expansion.
For an explicit Runge-Kutta method with coefficients , put and let mean componentwise squaring. The conditions , , and match the exact flow expansion through degree three: the two cubic differentials are and . For sufficiently smooth vector fields these give local error and, under the usual finite-interval Lipschitz continuity assumptions, global error .
The difference between a computed system energy and its exact value. Long-time bounded oscillation of this error is distinct from secular numerical energy drift.
A chosen smooth function inserted into a differential equation to define a matching source and boundary data. Its known exact values permit direct verification of an implementation's convergence order.
A norm used to quantify numerical error on a grid, such as the maximum norm or a mesh-weighted root-mean-square norm. Convergence studies must compare the same norm at a fixed physical time.
Vectorized numerical computation applies numerical operations to entire arrays of values instead of explicitly iterating over scalar entries. For a power series, constructing a vector of term indices, evaluating all corresponding terms and summing that vector is a vectorized evaluation. A loop over bounded blocks can control memory while preserving vectorized computation within each block.
A numerical algorithm is backward stable when its computed output is the exact output for input data perturbed by an amount comparable to the arithmetic's round-off error. The allowed input perturbations and their norm must be specified. A bound on backward error gives a forward error bound only after accounting for the problem's condition number. For example, a singular value decomposition with orthonormal computed outer factors is backward stable in the spectral norm if , with machine precision and a modest dimension-dependent constant .
Find a value satisfying for a given function. Methods include the bisection method, which retains a bracket around a root, and derivative-based iteration. Finding a root numerically is distinct from the root as a mathematical object.
Suppose is continuous on an interval, differentiable in its interior, and throughout the interior. If is a root in the interval and is another point in it, the mean value theorem gives for an intermediate point . Taking absolute values proves the stated bound from the residual of a root equation. This converts an observed residual into a stopping certificate, provided the evaluation error in that residual is also controlled.
The residual of a root equation at a proposed solution is the value . It measures violation of the equation, while the forward error measures distance from a chosen exact root. Rescaling rescales the residual of a root equation without moving its roots, so a small residual needs a scale or a derivative bound before it certifies a small forward error.
The secant method approximates a zero of a function by repeatedly taking the zero of a secant line through the two most recent sampled points. The formula follows by setting the line equal to zero. It requires distinct sampled positions and a nonzero difference of sampled values, unless a root has already been found. After initialization it needs one new function evaluation per step. Unlike bisection, it need not retain a bracket. For a sufficiently smooth function near a simple root, its usual local order of convergence is .[ref]
Fixed-point iteration seeks a fixed point of a map by repeatedly setting . Convergence requires additional hypotheses; for example, a contraction mapping on a complete metric space has a unique fixed point reached by this iteration.
Iterating an affine map gives . A fixed point exists exactly when is in the image of a linear map . If the spectral radius of is below one, its matrix powers tend to zero and every orbit converges to the unique fixed point .
An iteration converging to has exact asymptotic order if its nonzero errors satisfy the displayed limit. A bound instead asserts at least order . Finite termination is treated separately because the error ratios become undefined.
An iteration of a map has linear convergence to its limit when its nonzero errors satisfy for some . The error eventually shrinks by approximately the same factor at each step. This is exact order of convergence one, in contrast to quadratic convergence.
A sequence with errors converges Q-linearly in a specified norm if there is a constant with eventually. The limsup of consecutive nonzero error ratios is its asymptotic factor. This is stronger than merely having a bound , which is called R-linear convergence. The norm and whether an iteration is one coordinate step or an entire sweep must be specified when quoting a factor.
An iteration has at least cubic convergence when its errors eventually satisfy the displayed inequality with fixed . Exact order of convergence three requires a positive finite limit of . If , setting gives , hence .
An optimization algorithm that brackets an extremum of a unimodal function on an interval. Two interior probes divide the bracket in the golden ratio; after discarding one side, one probe can be reused, so each subsequent contraction needs only one new function evaluation.
In numerical analysis, significant figures record how many meaningful digits are retained in a written numerical value. Leading zeros locate the decimal point rather than adding precision: and each have two significant figures. Trailing zeros may require an explicit convention to distinguish measured precision from positional notation.
A numerical method is an algorithm for computing an exact or approximate solution to a mathematical problem through finitely many arithmetic operations and other prescribed steps. For example, Gaussian elimination solves a linear system exactly in exact arithmetic, whereas finite precision can introduce roundoff error.
For an ordinary differential equation with acceleration independent of velocity, the velocity Verlet method advances position and velocity by
Here is the time step and . For sufficiently smooth , the global error on a fixed time interval is , so halving reduces the leading global error by a factor of four once the asymptotic regime is reached.
A numerical algorithm implements a numerical method through specified finite computation steps, including arithmetic operations and any required function evaluations.
Floating-point arithmetic represents a real number by a sign, a fixed number of significant digits, and a scale. It trades exactness for a compact representation spanning many orders of magnitude. The picture shows the essential compromise: with the same precision, large numbers have wider gaps between representable neighbors. Thus accuracy is naturally relative to magnitude, rather than a fixed distance along the number line.
Figure 1.
Eight normalized four-bit binary values in each of three intervals, with gaps doubling from one eighth to one half
. Details.
In radix , an integer at least two, a nonzero normalized value has the positional notation
where the digits and exponent are integers. The parenthesized factor is the significand; counts all its significant digits, including the leading digit. Normalization means , so the same value has one such representation. The allowed exponents satisfy . Finite precision restricts the available digits, while the exponent bounds restrict the range. Zero needs a separate representation. This scales a digit string in positional notation by a power of its base.[ref]
For positive normalized values in , increasing the last digit by one gives the constant neighbor spacing
At the next scale, the spacing is multiplied by . In the binary numeral system with , the values in are ; those in are ; those in are . The respective gaps are , , and . Although absolute resolution deteriorates with magnitude, stays between and . This scale invariance is why floating-point arithmetic suits both microscopic and astronomical calculations.
The IEEE 754 binary64 format uses the binary numeral system with , including an implicit leading one for normalized values, and normal exponents . Its 64 stored binary digits comprise one sign digit, 11 exponent digits and 52 trailing significand digits. Subnormal numbers extend the range toward zero with a different leading-digit rule. In rounding to nearest, an operation returns the representable value closest to its exact result; a tie goes to the value whose last significant binary digit is even. Machine epsilon describes the gap just above one, whereas unit roundoff bounds a single relative rounding error in the normal range. These format and rounding rules are presented in MIT's floating-point lecture.[ref]
Even an ordinary terminating decimal can require rounding in the binary numeral system. The rational number has the repeating positional notation . Every finite binary fraction has a reduced denominator that is a power of two, so the factor five in prevents an exact finite binary representation. In binary64, the exact stored values of three decimal literals and their computed sum are
The exact sum of the first two stored rational numbers is , halfway between two binary64 values. The even-last-digit tie rule rounds it upward. The printed result is 0.30000000000000004, one step above stored 0.3, so 0.1 + 0.2 == 0.3 is false. Both conversion of the inputs and rounding of the addition matter here.
To reproduce the table on a Python installation using binary64, inspect exact fractions rather than only their printed decimal representations:
import sys
assert (sys.float_info.radix, sys.float_info.mant_dig) == (2, 53)
for value in (0.1, 0.2, 0.3, 0.1 + 0.2):
    print(repr(value), value.as_integer_ratio())
print(0.1 + 0.2 == 0.3)  # False
Python's as_integer_ratio() returns a pair of integers whose quotient equals the stored finite value exactly.[ref] Exact rational numbers are also useful for checking floating-point arithmetic: a short decimal printout can hide the approximation being made.
Historically, David Goldberg's March 1991 ACM Computing Surveys paper explained representation, rounding and catastrophic cancellation together with the IEEE standard's design choices. Oracle provides an authorized edited reprint. Its enduring lesson is practical: use the spacing to understand roundoff error, and inspect intermediate values when mathematically equivalent algorithms behave differently.[ref]
A floating-point operation is one arithmetic operation on values represented in floating-point arithmetic. Algorithmic counts commonly count addition, subtraction, multiplication and division separately. A fused multiply-add can therefore count as two arithmetic operations even when executed by one hardware instruction. Such counts describe work, while elapsed time also depends on memory traffic, parallelism and the implementation.
To add two finite floating-point numbers, compare their exponents, shift the smaller significand to a common exponent, add or subtract the signed significands, normalize the result, and apply floating-point rounding. Extra low-order bits are needed to determine correct rounding when shifting or cancellation discards information. A carry beyond the leading digit increases the exponent; cancellation can decrease it. Unlike exact real addition, this operation need not be associative. Changing the child evaluation order in a fixed binary expression tree need not change its parenthesization, whereas reassociation changes which intermediate results undergo floating-point rounding.
A sixteen-bit floating-point representation with one sign bit, five exponent bits and ten stored fraction bits. For sign , stored exponent and fraction integer , normal finite values are
The implicit leading one gives eleven significant binary digits. With , the value is , including signed zero at and subnormal numbers otherwise. The stored exponent is reserved for infinities at and NaN otherwise. The positive normal range is through ; the least positive subnormal number is .
A floating-point representation occupying bits, or bytes, with one sign bit, exponent bits and explicitly stored fraction bits. The implicit leading bit of a normal number gives bits of significand precision. Near one, adjacent numbers are separated by ; rounding to nearest has unit roundoff in the normal range. These are relative precision scales, distinct from underflow limits or a universal absolute error bound.[ref]
Floating-point overflow occurs when the magnitude of a computed result exceeds the largest finite representable floating-point number. Large values of an exponential function are a common source. In a normalized weighted sum, replacing exponentials by before division prevents this particular overflow while leaving the normalized weights unchanged; this is an application of the log-sum-exp construction.
A special floating-point arithmetic value representing an undefined or unrepresentable numerical result. A displayed NaN is not a numerical zero and is not a valid p-value.
Replacement of an exact real arithmetic result by a representable floating-point number under a specified rounding rule. Repeated products can depend on evaluation order, so a recursive rewrite intended to reproduce a floating-point loop should preserve its sequence of accumulator operations. An exact algebraic invariant does not by itself establish equality of rounded machine results.
Floating-point underflow occurs when a nonzero numerical result is smaller in magnitude than the representable range or loses precision in the subnormal range. A long product of probabilities can become zero despite a mathematically positive result. Adding logarithms avoids forming the product; adding alternative path probabilities then requires log-sum-exp or controlled rescaling.
The significant-digit factor in a floating-point representation , where is the sign bit, the radix and the exponent. For a normal positive binary significand, , and the leading one need not be stored. In a subnormal number, the leading digit is zero at the minimum normal exponent scale. The significand is a numerical factor, distinct from the stored trailing fraction bits that encode part of it.
Compensated summation retains a correction for low-order information lost to roundoff error in successive floating-point arithmetic additions. Kahan summation is a common implementation; it can substantially reduce accumulated error when many terms are added.
A summation algorithm that keeps a correction for low-order information lost when adding floating-point numbers. Feeding that correction into subsequent additions can greatly reduce accumulated rounding error compared with straightforward summation.
Here machine epsilon means the gap from one to the next larger value in normalized floating-point arithmetic:
It is a relative resolution scale near one, not the smallest positive representable value and not a fixed absolute error for all magnitudes. In binary64, gives
where is unit roundoff for rounding to nearest. Some authors instead call their machine epsilon; MIT 18.335J uses this half-gap convention. Always check which definition an error bound uses.[ref]
The gap below one is smaller: the preceding binary64 value is , whereas the next value above one is . Under nearest-even rounding, 1.0 + 2.0**-53 is exactly 1.0: the exact sum is a tie and one has the even final binary digit. By contrast, 1.0 + 2.0**-52 is the next value. Thus searching for the smallest increment that changes one by trial addition also depends on the rounding convention. At the next larger binary64 value is , illustrating why a small absolute increment can disappear at large magnitude.
Near a well-conditioned simple root, a numerically stable Newton root-finding iteration cannot usually resolve steps far below the local spacing of floating-point numbers. That spacing has relative scale comparable to machine epsilon , motivating the displayed position-based criterion with a modest constant . It combines an absolute scale near zero with a relative scale for large inputs. A residual-only test is changed by rescaling the equation, whereas the root and exact Newton step are unchanged. A tiny step alone is not a universal accuracy certificate: derivative errors, stagnation and cycles require separate consideration.
For floating-point arithmetic with precision in radix and rounding to nearest, unit roundoff is the half-gap scale . If a nonzero exact real number lies in the normal finite range, its nearest rounded value satisfies
Indeed, the absolute distance to the nearest value is at most , and gives the bound. For a correctly rounded addition, subtraction, multiplication or division, apply this estimate to the exact result of that one operation on the stored operands. The bound does not include earlier roundoff error or automatically bound a whole algorithm. Results outside the finite range and tiny subnormal numbers require separate treatment. Rounding in a directed mode also changes the bound.[ref]
A subnormal number is a nonzero representable value smaller in magnitude than the least positive normalized value . Keep the exponent scale fixed at and allow a zero leading digit: the positive values are for integers . This fills the gap toward zero with constant absolute spacing, at the cost of fewer significant digits. Goldberg describes this gradual approach to zero and why it matters for differences of small numbers.[ref]
For binary64 the least positive normalized value is , and subnormal numbers are spaced by . With nearest rounding and gradual underflow enabled, an exact result with has absolute rounding error at most . A uniform relative bound by unit roundoff fails here: rounds to zero under the even-last-digit tie rule, giving relative error one. Machine epsilon measures resolution near one; it does not measure the distance from zero to the first positive value.
Catastrophic cancellation occurs when subtraction of nearly equal approximations removes their matching leading digits and exposes earlier roundoff error. The subtraction can itself be exact on the stored operands: the information may already have been lost while obtaining them. Goldberg distinguishes this from cancellation of accurately known quantities, which can be harmless.[ref]
For , consider the single real-valued function
The rationalization of a square-root difference proves equality in exact arithmetic. The two evaluations use the same input , but the direct version first forms a value near one and then subtracts one. The rearranged version keeps the small input in its numerator and divides by a denominator near two.
Figure 1.
Direct and rationalized evaluation of a small square-root difference against a high-precision reference for the same binary64 inputs
. Details.
For binary64 x = 1e-16, the rounded sum 1.0 + x is one, so sqrt(1.0 + x) - 1.0 is zero. The rationalized evaluation returns approximately . A 100-digit Decimal calculation using the exact stored input gives relative errors of one and about respectively. At x = 1e-12, the direct result is about , with relative error ; the rearranged result is about , with relative error .
The plot uses Decimal.from_float(x) to preserve the binary input exactly, computes at 100 decimal digits, and verifies the reference at 160 digits. Exact conversion of a stored binary value is documented by Python.[ref] Each error is , with the computed result converted exactly to Decimal before comparison. Hence the curves measure evaluation error for one common input, rather than a mixture of input conversion error and evaluation error. The plotted interval is far above the subnormal number range.
The original problem is well conditioned with respect to relative changes in . Using the derivative and rationalization of a square-root difference, its relative condition number is
It tends to one as tends to zero. The direct evaluation instead introduces the intermediate difference with ; an error of order unit roundoff in is large relative to . This is a failure of the chosen algorithm's accuracy despite a small condition number for the same real-valued function. The rationalized evaluation avoids that intermediate catastrophic cancellation, retaining relative accuracy near the unit roundoff scale throughout the plotted interval. Recognizing this structure can improve a calculation far more than merely printing extra digits.
The Newton root-finding iteration seeks a zero of a function by repeatedly solving its tangent line approximation. At a current guess with derivative , set
Geometrically, follow the tangent line to the horizontal axis, then return to the function graph for the next tangent line. Close to a suitable zero of a function, the error becomes dramatically smaller.[ref]
For a concrete square root calculation, take the polynomial and start at . The Newton root-finding iteration becomes , giving
The errors use the unrounded iterates. After the first step, each iterate overestimates , and the exact identity
exhibits quadratic convergence: once close, the number of correct decimal digits roughly doubles per step. This speed makes the Newton root-finding iteration useful when accurate derivatives are available.
Figure 1.
Newton tangent steps toward a square root and a nonconvergent two-cycle
. Details.
Global convergence requires additional care. For the polynomial , starting at gives , , hence . Then , gives . The sequence repeats forever, although a real polynomial root lies in by the intermediate value theorem. Neither point in the cycle is a zero of a function, and neither has zero derivative. A maintained sign-changing interval and fallback bisection method can protect a root solver from unsuitable Newton steps.
A secant-updating method for a vector equation , named for Charles George Broyden. Solve , choose , and form , . For a nonzero step the displayed “good Broyden” update satisfies , learning the Jacobian matrix action along the observed step rather than evaluating a new full Jacobian matrix.
The update also has a least-change characterization in the Frobenius norm. Write . Any correction satisfying has squared row norms bounded below by , by the Cauchy-Schwarz inequality. Summing these bounds gives , with equality for . This proves the rank-one correction is the least-change update satisfying the secant constraint. Superlinear convergence needs local regularity and suitable initialization; it is not a global consequence of this algebraic identity.[ref]
Articles were limited to the first 100 out of 876 total.

Articles by others on the same topic (2)

Numerical analysis is a branch of mathematics that focuses on developing and analyzing numerical methods for solving mathematical problems that cannot be easily solved analytically. This field encompasses various techniques for approximating solutions to problems in areas such as algebra, calculus, differential equations, and optimization. Key aspects of numerical analysis include: 1. **Algorithm Development**: Creating algorithms to obtain numerical solutions to problems. This can involve iterative methods, interpolation, or numerical integration.
Numerical analysis by Ciro Santilli 40 Updated 2025-07-16
Techniques to get numerical approximations to numeric mathematical problems.
The entire field comes down to estimating the true values with a known error bound, and creating algorithms that make those error bounds asymptotically smaller.
Not the most beautiful field of pure mathematics, but fundamentally useful since we can't solve almost any useful equation without computers!
The solution visualizations can also provide valuable intuition however.
Important numerical analysis problems include solving: