In pure mathematics, solutions live in the serene continuum of real numbers R\mathbb{R}. We manipulate infinite Taylor series, take limits as step sizes Δx→0\Delta x \to 0, and write down exact roots with complete confidence. But the moment we ask physical hardware to calculate, we step into a world of unavoidable physical constraints: numbers must fit into finite bit registers (typically 32 or 64 bits), infinite processes must terminate in finite steps, and continuous functions must be represented on discrete grids.

The numerical pipeline: sources of approximation and error from real phenomena to computed results.

The numerical pipeline: sources of approximation and error from real phenomena to computed results.

This note establishes the foundational vocabulary and mental models for computational mathematics. Across subsequent topics, root finding, polynomial interpolation, and numerical calculus, we will repeatedly evaluate algorithms through four essential virtues:

  1. Accuracy: How close is the computed approximation to mathematical truth?
  2. Efficiency: What is the computational cost (work, memory, iterations) required to reach a target tolerance?
  3. Stability: Does the algorithm prevent small representation perturbations from exploding into catastrophic errors?
  4. Robustness: Does the algorithm behave predictably across diverse inputs and fail gracefully when assumptions break down?

From phenomena to computation

Before writing an algorithm or writing code, we must understand the transformation that carries an observed physical phenomenon into machine memory. This pipeline spans four distinct layers: the physical phenomenon, the mathematical model, the mathematical problem, and the digital computation.

DefinitionMathematical model

A mathematical model is a deliberately simplified mathematical representation of a phenomenon. It specifies variables, parameters, assumptions, and relations among them so that questions about the phenomenon can be translated into mathematical problems.

A conservation principle might produce a partial differential equation; a balance of forces might yield a system of nonlinear algebraic equations. The modelling step decides what physics to retain and what to neglect. Crucially, solving these equations with infinite precision does not eliminate modelling error: an analytical solution to an incomplete model remains an incomplete description of reality.

RemarkModel adequacy comes before numerical accuracy

A result computed to twelve decimal digits is not automatically meaningful. If an omitted physical effect (such as friction or thermal expansion) alters the true behavior by five percent, reducing numerical error from 10−610^{-6} to 10−1210^{-12} does not improve real-world predictive validity.

DefinitionMathematical problem

A mathematical problem specifies admissible input data, the mathematical conditions that a solution must satisfy, and the desired output. Abstractly, we may write the exact solution operator as

y=F(x),y = F(x),

where xx is the input and yy is the exact output.

Concrete mathematical problems include finding a root f(x)=0f(x)=0, integrating a differential equation, or solving a linear system Ax=bAx=b. A problem statement is incomplete without its domain and underlying hypotheses: existence, uniqueness, differentiability, and nonzero denominators matter just as much as the algebraic formula itself.

DefinitionComputation

A computation is a finite process that transforms represented input into represented output through permitted elementary operations. It includes the representation of data, the order of operations, intermediate quantities, and a rule for termination.

This definition separates the exact continuous map FF from what silicon hardware can execute. While real numbers R\mathbb{R} contain uncountably infinite information, a floating-point register holds only finitely many bits. A computation therefore produces an approximation y^\hat{y} rather than the idealized yy.

A formula describes a static mathematical relationship; a computation describes an active, ordered process. Two programs implementing the exact same mathematical formula can produce dramatically different answers because they sequence operations differently or suffer from different numerical cancellation paths.

DefinitionNumerical analysis

Numerical analysis is the study and design of methods for obtaining approximate solutions to mathematical problems, together with the rigorous analysis of their error, cost, sensitivity, and reliability.

The discipline asks far more than “what number did the computer output?” It investigates whether the approximation converges to the true solution, how fast the error decays, how much work is required, how representation errors propagate, and where the method can break down.

Method, algorithm, and implementation

To reason clearly about software failures and numerical bugs, we distinguish between three layers of realization: the abstract method, the executable algorithm, and the machine implementation.

DefinitionNumerical method

A numerical method is a mathematically specified approximation strategy. It replaces an exact continuous problem by finite operations, or by a sequence of simpler problems whose solutions approach the exact solution.

A method can be based on iteration, discretisation, interpolation, linearisation, or recurrence. Its mathematical formulation identifies both the tuning parameter (such as step size hh, polynomial degree nn, or iteration count kk) and the theoretical sense in which the error is expected to shrink.

DefinitionNumerical algorithm

A numerical algorithm is a finite, unambiguous, and executable sequence of instructions that implements a numerical method for represented data. It specifies input formats, initialisation, update rules, stopping conditions, output, and detectable failure diagnostics.

A single numerical method often admits multiple competing algorithms. For instance, evaluating an nn-th degree polynomial can be done by computing powers individually or via Horner’s nested multiplication. While mathematically equivalent in infinite precision, their computational complexities and roundoff propagation profiles differ substantially.

def numerical_algorithm(data, tolerance, max_steps):
state = initialise(data)
for step in range(max_steps):
new_state = update(state, data)
if error_indicator(new_state, state) <= tolerance:
return new_state
state = new_state
raise RuntimeError("requested reliability was not established")

Two foundational principles are illustrated here: stopping criteria are an integral part of an algorithm rather than an afterthought, and hitting max_steps is not a numerical answer. It is proof that the requested accuracy was not certified.

LayerQuestionTypical source of failure
ProblemWhat exact output is required?Ill-conditioning or non-uniqueness
MethodWhat approximation principle is used?Truncation or discretisation error
AlgorithmHow is the method executed finitely?Instability or premature termination
ImplementationHow is it realised on a machine?Round-off, overflow, or precision loss

“The algorithm works” is too vague a claim. A theorem about an exact method does not guarantee that its floating-point implementation will succeed, and an error-free execution run does not prove that the underlying problem is well-conditioned.

DefinitionQuality of a numerical algorithm

A reliable numerical algorithm must satisfy four core criteria:

  • Accuracy: Its computed output is provably close to the true mathematical solution;
  • Efficiency: It reaches the target tolerance with minimal computational work and memory;
  • Stability: It dampens rather than magnifies intermediate round-off and representation errors;
  • Robustness: It performs predictably across its declared domain and signals when its mathematical assumptions are violated.

These four properties interact constantly. A fast algorithm that frequently diverges is useless; an accurate algorithm that takes exponential time is impractical; and a stable algorithm applied to an ill-conditioned problem will still produce large forward errors because the problem itself is hyper-sensitive.

Accuracy: what “close” means

Every numerical result can inherit error from the model, the approximation, the machine arithmetic, and earlier computational steps. Reducing one source does not automatically reduce the others.

SourceWhat causes it?Concrete example
Modelling errorThe mathematical model omits, simplifies, or misrepresents part of the physical system.A model may not adequately describe a virus, an electric field, or the behaviour of light.
Truncation errorAn infinite or continuous process is replaced by a finite calculation.Stop Newton’s method after NN steps, retain finitely many Taylor terms, or approximate an integral with NN quadrature nodes.
Round-off errorReal numbers and arithmetic operations are represented with finite floating-point precision.Limited significant digits, cancellation of nearby values, and overflow outside the representable range.
Propagation errorAn earlier error is carried into later steps and may be amplified.The forward recurrence for InI_n multiplies the initial error by increasing factors.

Truncation extends beyond Taylor series to any method with a finite budget: a fixed number of Newton iterations, a quadrature rule with NN nodes, or a mesh of spacing hh. The Taylor remainder Rn(x)R_n(x) below is one exact description of truncation error. Its order tells how the discarded part changes as nn or hh is refined.

Computers store only finitely many significant digits, so each represented number and arithmetic result can be rounded. Two practical failure modes deserve particular attention: catastrophic cancellation, when nearly equal numbers are subtracted and reliable digits are lost, and overflow, when an intermediate magnitude lies outside the available floating-point range. The stable quadratic formula later in this note illustrates how to avoid catastrophic cancellation.

This interactive figure needs JavaScript.

ExampleAn unstable forward recurrence

Define

In=∫01xnex−1 dx,n=1,2,… .I_n = \int_0^1 x^n e^{x-1}\, dx, \qquad n=1,2,\dots.

Integration by parts gives the forward recurrence In=1−nIn−1I_n = 1 - n I_{n-1}. Let IncompI_n^{\mathrm{comp}} be the value produced by the same recurrence and define its error by en=Incomp−Ine_n = I_n^{\mathrm{comp}} - I_n. Then

en=(1−nIn−1comp)−(1−nIn−1)=−nen−1.e_n = (1 - n I_{n-1}^{\mathrm{comp}}) - (1 - n I_{n-1}) = -n e_{n-1}.

Hence ∣en∣=n! ∣e1∣|e_n| = n!\, |e_1|: a tiny initial round-off error is multiplied at every forward step. This is propagation error, and it explains why the recurrence is numerically unstable in that direction.

DefinitionAbsolute and relative error

Let xtruex_{\mathrm{true}} be the true (exact) scalar value and let xapproxx_{\mathrm{approx}} be its computed approximation. The absolute error is

Eabs=∣xapprox−xtrue∣.E_{\mathrm{abs}} = |x_{\mathrm{approx}} - x_{\mathrm{true}}|.

If xtrue≠0x_{\mathrm{true}} \neq 0, the relative error is

Erel=∣xapprox−xtrue∣∣xtrue∣.E_{\mathrm{rel}} = \frac{|x_{\mathrm{approx}} - x_{\mathrm{true}}|}{|x_{\mathrm{true}}|}.

Absolute error has the same units as the quantity. Relative error is dimensionless and reports error compared with the scale of the answer. Neither is universally superior: relative error is undefined at xtrue=0x_{\mathrm{true}}=0 and can be misleading when zero is a meaningful reference point.

KindWhat it measures
Forward errorDistance between computed and exact result: $
Backward errorSmallest perturbation of the input for which y^\hat{y} is an exact output.
Local errorError introduced in one step, assuming the step starts from exact data.
Global errorAccumulated error after all steps over the interval or iteration history.
A priori boundA guarantee derived before the computation from assumptions and parameters.
A posteriori estimateAn estimate derived from the computed result, residual, or refinement comparison.

The residual is often computable even when the exact error is not. For a linear system, r=b−Ax^r = b - A\hat{x} measures how well the computed vector satisfies the equations. A small residual implies a small forward error only when the problem is not too sensitive.

Taylor series and order

TheoremTaylor's theorem with remainder

Suppose ff has n+1n+1 continuous derivatives on an interval containing x0x_0 and xx. Then there is a point ξ(x)\xi(x) between x0x_0 and xx such that

f(x)=Pn(x)+Rn(x),f(x) = P_n(x) + R_n(x),

where the degree-nn Taylor polynomial centred at x0x_0 is

Pn(x)=∑k=0nf(k)(x0)k!(x−x0)k,P_n(x) = \sum_{k=0}^{n} \frac{f^{(k)}(x_0)}{k!} (x-x_0)^k,

and the remainder (truncation error) is

Rn(x)=f(n+1)(ξ(x))(n+1)!(x−x0)n+1.R_n(x) = \frac{f^{(n+1)}(\xi(x))}{(n+1)!} (x-x_0)^{n+1}.
ProofLagrange remainder

For x=x0x=x_0 the remainder is zero. Otherwise fix xx and set c=(f(x)−Pn(x))/(x−x0)n+1c=(f(x)-P_n(x))/(x-x_0)^{n+1}. The auxiliary function

g(t)=f(t)−Pn(t)−c(t−x0)n+1g(t)=f(t)-P_n(t)-c(t-x_0)^{n+1}

vanishes at both endpoints x0,xx_0,x, and g(k)(x0)=0g^{(k)}(x_0)=0 for 0≤k≤n0\le k\le n. Rolle’s theorem gives a zero of g′g' between the endpoints. Apply Rolle again between this zero and x0x_0, where g′g' also vanishes. Repeating n+1n+1 times gives an interior point ξ\xi with g(n+1)(ξ)=0g^{(n+1)}(\xi)=0. Since Pn(n+1)=0P_n^{(n+1)}=0, this says c=f(n+1)(ξ)/(n+1)!c=f^{(n+1)}(\xi)/(n+1)!, which is the stated remainder. Rolle’s theorem is proved in interpolation error and Chebyshev nodes.

The notation makes the source of the approximation explicit: Pn(x)P_n(x) is the quantity we compute, while Rn(x)R_n(x) is what was discarded. The displacement from the expansion point is x−x0x-x_0. When only its size matters, write h=∣x−x0∣h = |x-x_0|. If f(n+1)f^{(n+1)} stays bounded near x0x_0, then Rn(x)=O(hn+1)R_n(x) = O(h^{n+1}). The first omitted power of hh determines the local order of the approximation.

ExampleTaylor error bound for ehe^h

Here hh is the signed increment from the expansion point: h=x−x0h = x - x_0. Since x0=0x_0 = 0 in this example, evaluating at x=hx = h means approximating ehe^h near h=0h = 0. Expanding f(x)=exf(x) = e^x to degree one gives

eh=1+h+R1(h),R1(h)=eξ(h)2h2,e^h = 1 + h + R_1(h), \qquad R_1(h) = \frac{e^{\xi(h)}}{2} h^2,

where ξ(h)\xi(h) lies between 00 and hh. Restrict to h≥0h \ge 0. Then 0≤ξ(h)≤h0 \le \xi(h) \le h. Since the exponential is increasing,

1=e0≤eξ(h)≤eh.1 = e^0 \le e^{\xi(h)} \le e^h.

Multiplying by the non-negative factor h2/2h^2/2 gives

12h2≤R1(h)≤eh2h2.\frac{1}{2} h^2 \le R_1(h) \le \frac{e^h}{2} h^2.

If 0≤h≤10 \le h \le 1, then eh≤ee^h \le e, and hence ∣R1(h)∣≤(e/2)h2|R_1(h)| \le (e/2) h^2. For h<0h < 0, ξ(h)\xi(h) lies between hh and 00, so eξ(h)≤1e^{\xi(h)} \le 1 and ∣R1(h)∣≤12h2|R_1(h)| \le \tfrac{1}{2} h^2. The upper bound therefore holds from both sides of zero: take C=e/2C = e/2 and δ=1\delta = 1. The approximation 1+h1+h has error O(h2)O(h^2) as h→0h \to 0.

DefinitionConsistency

A family of approximations is consistent if its local approximation error tends to zero as the approximation is refined.

DefinitionConvergence

A method is convergent if its computed approximation tends to the exact solution in the stated limit, such as h→0h \to 0, n→∞n \to \infty, or k→∞k \to \infty.

DefinitionOrder of accuracy

If an error E(h)E(h) satisfies E(h)=O(hp)E(h) = O(h^p) as h→0h \to 0, the approximation has order at least pp. Informally, once the asymptotic regime has been reached, halving hh reduces the leading error by approximately a factor of 2p2^p.

On logarithmic axes, an error law E(h)≈ChpE(h) \approx C h^p appears as a line with slope pp. A straight line in a log-log plot supports an asymptotic error model only over the tested range. Coarse discretisation may not yet be asymptotic, while excessive refinement may expose round-off or modelling errors.

Reporting digits without an error scale is incomplete. A more meaningful result is “xapproxx_{\mathrm{approx}} with estimated relative error below 10−610^{-6},” together with the assumptions behind that estimate.

Efficiency: the cost of obtaining accuracy

DefinitionComputational efficiency

The efficiency of a numerical algorithm describes the resources required to achieve a specified task or accuracy. Relevant resources include arithmetic operations, function evaluations, memory, communication, and elapsed time.

If evaluating ff requires a large simulation, the number of function evaluations may matter more than the number of scalar additions. On modern hardware, memory traffic and parallel communication can dominate arithmetic cost.

Useful distinctions include operation complexity, storage complexity, per-step cost versus the number of required updates, convergence rate, work-precision efficiency (total work to reach a target error), and scalability.

Suppose a one-dimensional discretisation uses N≈1/hN \approx 1/h degrees of freedom, costs O(N)O(N) work, and has error E(h)=O(hp)E(h) = O(h^p). To achieve E(h)<εE(h) < \varepsilon, we need roughly

h=O(ε1/p),N=O(ε−1/p),work=O(ε−1/p).h = O(\varepsilon^{1/p}), \qquad N = O(\varepsilon^{-1/p}), \qquad \text{work} = O(\varepsilon^{-1/p}).

This is a work-precision law. Increasing the order pp can reduce the cost of high accuracy dramatically, provided the higher-order method has reasonable constants and its smoothness assumptions are satisfied.

ExampleOne evaluation order, two algorithms

Consider p(x)=a0+a1x+⋯+anxnp(x) = a_0 + a_1 x + \dots + a_n x^n. Computing every power independently can require O(n2)O(n^2) multiplications. Horner’s nested form

p(x)=a0+x(a1+x(a2+⋯+xan))p(x) = a_0 + x\bigl(a_1 + x(a_2 + \dots + x a_n)\bigr)

uses nn multiplications and nn additions, hence O(n)O(n) work. The method’s mathematical output is unchanged. The algorithmic organisation is better.

def horner(coefficients, x):
value = 0.0
for coefficient in reversed(coefficients):
value = coefficient + x * value
return value

Efficiency is best understood as the computational cost required to achieve a target level of confidence, rather than raw wall-clock time alone. A fast calculation that frequently fails, requires repeated retries, or cannot certify its error bounds is rarely economical in practice.

Big-O as a shared language

DefinitionBig-O notation

We write f(t)=O(g(t))f(t) = O(g(t)) as t→at \to a if there exist constants C>0C > 0 and δ>0\delta > 0 such that ∣f(t)∣≤C∣g(t)∣|f(t)| \le C |g(t)| whenever 0<∣t−a∣<δ0 < |t-a| < \delta. For t→∞t \to \infty, the corresponding definition requires the bound for every t≥t0t \ge t_0 beyond some threshold. The limiting regime is part of the statement.

Big-O is an eventual upper bound up to a constant. It is not an equation for an exact value, and it does not say that two functions have the same leading constant. The statement f(t)=O(g(t))f(t) = O(g(t)) can remain true when gg is a loose upper bound.

For a tighter classification, f=Θ(g)f = \Theta(g) means both an asymptotic upper and lower bound. The notation f=o(g)f = o(g) means f/g→0f/g \to 0, so ff is asymptotically smaller than gg.

UseLimitTypical statement
Algorithmic costn→∞n \to \inftyT(n)=O(nlog⁡n)T(n) = O(n \log n) operations.
Discretisation errorh→0h \to 0E(h)=O(hp)E(h) = O(h^p).
Iteration errork→∞k \to \inftyek+1≈μekpe_{k+1} \approx \mu e_k^p.

The grammar is shared, but the interpretation changes. In cost analysis, smaller growth is desirable. In an error law O(hp)O(h^p) with h→0h \to 0, larger pp is usually desirable because the error decays faster.

If r(h)=O(hp)r(h) = O(h^p) and s(h)=O(hq)s(h) = O(h^q) as h→0h \to 0, then

r(h)+s(h)=O(hmin⁡(p,q)),r(h) s(h)=O(hp+q).r(h) + s(h) = O(h^{\min(p,q)}), \qquad r(h)\, s(h) = O(h^{p+q}).

The lower power normally dominates a sum near zero. For example, 3h2+7h3=O(h2)3h^2 + 7h^3 = O(h^2). Cancellation can improve the order, but it must be shown. It cannot be assumed from the two separate bounds.

RemarkDo not cancel Big-O terms

The symbol O(hp)O(h^p) denotes a class of bounded remainders, not one unknown scalar. From A+O(h2)=B+O(h2)A + O(h^2) = B + O(h^2) we may infer A−B=O(h2)A - B = O(h^2), but we cannot simply erase the two remainder terms as though they were identical.

The formal order of an iteration is a preview for later root-finding methods, not a Week 1 requirement. Let ek=xk−x∗e_k = x_k - x^*. If

lim⁡k→∞∣ek+1∣∣ek∣p=μ\lim_{k \to \infty} \frac{|e_{k+1}|}{|e_k|^p} = \mu

for μ>0\mu > 0, the iteration has order pp. For p=1p = 1, convergence is linear when 0<μ<10 < \mu < 1. The case p=2p = 2 is quadratic convergence. This definition differs from the discretisation statement E(h)=O(hp)E(h) = O(h^p), even though both use the word “order.”

Big-O deliberately hides constants and the point at which asymptotic behaviour begins. A method with cost 1000n1000n can be slower than one with cost n2n^2 over the entire practical range. Likewise, an O(h4)O(h^4) method with a large error constant may initially be less accurate than an O(h2)O(h^2) method.

Stability: controlling perturbations

DefinitionConditioning

Conditioning describes how sensitive the exact solution of a mathematical problem is to small perturbations in its input. A problem is ill-conditioned when small relative input changes can produce large relative output changes.

For a scalar map y=F(x)y = F(x), a local relative condition number is κ(x)=∣xF′(x)/F(x)∣\kappa(x) = |x F'(x) / F(x)| when the expression is defined. Roughly,

∣δy∣∣y∣≈κ(x)∣δx∣∣x∣.\frac{|\delta y|}{|y|} \approx \kappa(x) \frac{|\delta x|}{|x|}.

The condition number describes the problem before an algorithm is chosen. No algorithm can recover information that the represented input does not contain.

DefinitionNumerical stability

An algorithm is stable if the perturbations introduced during its execution do not grow substantially beyond what is unavoidable from the conditioning of the problem.

The phrase “does not amplify error” is useful intuition, but it needs a reference scale. Even a stable algorithm can exhibit a large forward error on an ill-conditioned problem, because the exact problem itself amplifies input uncertainty.

Forward stability directly bounds the difference between computed and exact output. Backward stability interprets the computed output as the exact solution of a nearby problem. Mixed analysis combines input and output perturbation bounds when a purely forward or backward statement is inconvenient. Backward stability is often powerful because it separates responsibilities: the algorithm introduces only a small input perturbation, and the condition number predicts how that perturbation affects the output.

For ax2+bx+c=0ax^2 + bx + c = 0, the textbook formula

x1=−b+b2−4ac2ax_1 = \frac{-b + \sqrt{b^2 - 4ac}}{2a}

can subtract nearly equal numbers when b>0b > 0 and 4ac4ac is small compared with b2b^2. The small root may lose most of its significant digits. A stable strategy computes the large root without cancellation and obtains the other from x1x2=c/ax_1 x_2 = c/a:

q=−12(b+sign⁡(b)b2−4ac),x1=q/a,x2=c/q.q = -\frac{1}{2}\bigl(b + \operatorname{sign}(b)\sqrt{b^2-4ac}\bigr), \qquad x_1 = q/a, \qquad x_2 = c/q.
from math import copysign, sqrt
def stable_quadratic_roots(a, b, c):
discriminant = b * b - 4 * a * c
q = -0.5 * (b + copysign(sqrt(discriminant), b))
return q / a, c / q

The mathematical formula has not changed. The route through intermediate values has. This is the practical use of stability analysis: identify where information is lost, and reorganise the computation so that the machine solves a nearby problem accurately.

If one step transforms an error approximately as ek+1≈G′(xk)eke_{k+1} \approx G'(x_k) e_k, repeated steps multiply the amplification factors. Stability therefore concerns a process, not only an isolated arithmetic operation. The unstable recurrence above is one instance of this mechanism.

Input conditioning versus algorithm stability. Conditioning describes sensitivity of the problem itself; numerical stability describes additional error introduced by its algorithm.

Input conditioning versus algorithm stability. Conditioning describes sensitivity of the problem itself; numerical stability describes additional error introduced by its algorithm.

Conditioning describes sensitivity of the problem itself; numerical stability describes additional error introduced by its algorithm.

Robustness: reliable behaviour across cases

DefinitionRobustness

A numerical algorithm is robust over a stated domain if it produces a reliable result for a broad range of admissible inputs and behaves predictably, preferably with a diagnostic, when its assumptions or resources are insufficient.

Robustness is wider than stability. A stable update formula may still fail because an initial guess lies outside its basin of attraction, a derivative vanishes, a stopping test is misleading, or an intermediate value leaves the representable range.

Useful dimensions include domain checks, dependence on the starting guess, mixed-magnitude data, behaviour near difficult parameter regimes, termination tests that distinguish success from stagnation, and whether the method remains meaningful under available arithmetic.

A robust algorithm may combine methods. For root finding, a bracketed method offers dependable interval reduction, while a derivative-based step can be much faster near the root. A hybrid can accept the fast step when it stays inside the bracket and fall back to bisection otherwise. The safeguard adds work per step but improves the range of inputs for which the procedure can be trusted.

Useful safeguards include checking domains and finite values before an update, scaling variables to comparable magnitudes, combining absolute and relative stopping tolerances, monitoring residual reduction as well as step size, imposing iteration limits with explicit failure states, and switching methods when progress stalls.

RemarkSmall steps do not always mean success

An iteration may stagnate because floating-point numbers can no longer represent a distinct update. A stopping rule based only on ∣xk+1−xk∣|x_{k+1}-x_k| may then report convergence even when the residual remains large.

A case study connecting all four properties

The derivation of finite difference formulas begins with Taylor’s theorem:

f(x+h)=f(x)+f′(x)h+f′′(ξ)2h2,f(x+h) = f(x) + f'(x)h + \frac{f''(\xi)}{2}h^2,

where ξ\xi lies between xx and x+hx+h. Rearranging gives

f′(x)=f(x+h)−f(x)h+O(h).f'(x) = \frac{f(x+h)-f(x)}{h} + O(h).

Thus the forward difference is first-order accurate. If ff is smooth, the centred difference

Dhf(x)=f(x+h)−f(x−h)2hD_h f(x) = \frac{f(x+h)-f(x-h)}{2h}

has truncation error O(h2)O(h^2). It is tempting to make hh as small as possible. In floating-point arithmetic, however, the numerator subtracts nearby function values and the division by hh magnifies their representation errors. A simplified total-error model is

E(h)≈C1h2+C2uh,E(h) \approx C_1 h^2 + C_2 \frac{u}{h},

where uu is the unit round-off. Refinement reduces truncation error but can increase round-off error. The total error has a useful intermediate scale.

This interactive figure needs JavaScript.

PropertyQuestion in this computation
AccuracyHow close is Dhf(x)D_h f(x) to f′(x)f'(x), and over what range is the O(h2)O(h^2) law observed?
EfficiencyHow many function evaluations and precision bits are required for the target error?
StabilityHow strongly do subtraction and division by hh amplify evaluation errors?
RobustnessCan the procedure choose or validate hh, detect stagnation, and handle badly scaled functions?

Balancing the two leading terms suggests an optimal scale of order h=O(u1/3)h = O(u^{1/3}) for this model. That conclusion is more useful than the slogan “smaller hh is better”: it combines truncation analysis, finite-precision stability, and the practical choice of a parameter.

A reusable framework

For a new numerical problem, keep the layers distinct:

  1. Specify the problem: inputs, desired output, domain, assumptions, and a meaningful scale for error.
  2. Assess conditioning: how uncertainty in the data can affect the exact answer.
  3. Choose a method: identify its approximation parameter and convergence assumptions.
  4. Design the algorithm: representation, updates, stopping tests, safeguards, and failure states.
  5. Analyse accuracy, efficiency, and stability as three separate questions.
  6. Test robustness on difficult scales and adversarial initialisations rather than typical inputs alone.
  7. Report the approximation together with residuals, error estimates, tolerances, and relevant assumptions.
PropertyPrimary objectDiagnostic question
AccuracyOutputIs the result close enough for its purpose?
EfficiencyResourcesWhat does the requested accuracy cost?
StabilityPerturbationsDid the algorithm add avoidable amplification?
RobustnessOperating domainWill failure be controlled and visible?

Numerical analysis studies the path from a mathematical problem to a trustworthy computed result. Big-O notation links several parts of that path: it describes how resource cost grows, how approximation error decays, and how iterative errors converge. Asymptotic order is only one dimension of quality. Constants, conditioning, floating-point stability, safeguards, and the intended use of the answer determine whether a method is genuinely useful.

The next note applies this language to bisection and fixed-point iteration. This page belongs to the Computational Mathematics reading path.