GLOBAL KNOWLEDGE ARK

Mathematics · Article

Verification and reproducible computation

Build conditional numerical certificates from residuals, interval enclosures, derivative and mesh tests, reproducible arithmetic, explicit provenance and rigorously scoped random checks, while keeping implementation correctness and physical-model validation distinct.

Back to Mathematics

After reading, you can

  • State the mathematical target, physical assumptions, units and acceptance criterion before interpreting a numerical result.
  • Derive residual, preconditioned and componentwise error bounds, and certify roots with explicit enclosure and contraction hypotheses.
  • Use trajectory defects, derivative comparisons and manufactured solutions to assess the particular mathematical claim each test can support.
  • Explain how reduction trees, fused operations, input encoding and complete computation provenance affect reproducibility and safe reuse.
  • Derive probability bounds for bounded samples, randomized matrix verification and polynomial identity tests under their exact sampling and arithmetic assumptions.
  • Combine numerical and probabilistic certificates without confusing repeatability, finite test agreement or small residuals with physical truth.
01

Start with the claim the computation must support

A numerical answer can be repeatable, close to a reference and accompanied by a tiny residual, yet fail the scientific question. A mesh may solve the wrong boundary problem; two derivative routines may share the same mistake; repeated runs may share a common bias. Verification begins by naming the mathematical object, the implementation claim and the information that would make an error bound valid.

This lesson connects the numerical methods developed in the preceding lessons to explicit certificates. We derive residual and interval bounds, examine continuous defects and manufactured solutions, and distinguish a finite diagnostic from a complete argument. We then examine reproducible arithmetic and the probability models behind random tests. Every bound retains its units, domain, rounding or sampling conditions, including the cases where the available evidence is inconclusive.

The connections reach scientific computing, physics and engineering. A trustworthy simulation needs both numerical control and a defensible physical model; a reproducible data analysis needs both identifiable inputs and a valid statistical design. The goal is to make the conclusion exactly as strong as the evidence permits, while retaining enough detail for another reader to inspect the reasoning and reproduce the intended computation.

02

What verification can establish

Begin by naming the mathematical question. A target might be the solution x of A x=b for a stated nonsingular matrix, a trajectory on a stated interval, or an expectation under a specified probability law. Its data, units, domain, boundary conditions and requested output are part of the target. An implementation cannot be verified against a target that changes silently between the computation and its assessment.

Verification asks whether a mathematical argument or implementation meets a stated mathematical contract. A residual enclosure together with a valid inverse bound can verify an error claim for a particular linear solve. A proof about every permitted input is broader than a successful calculation at one input. Tests can contribute evidence, but their logical scope follows from the hypotheses that connect their results to the claimed contract.

Validation asks whether a model and its data describe the intended physical or empirical system sufficiently well for a stated use. Even an exact solution of A x=b says nothing by itself about whether that matrix represents a real structure accurately. Reproducibility asks whether another execution or investigator can recover a specified result under specified inputs and methods. Identically reproducing a modelling mistake leaves it a mistake.

Keep these claims separate in a scientific report. State what was proved, what was evaluated, which uncertainty was bounded and which model assumptions remain empirical. A reproducible, verified numerical calculation is a strong contribution; it becomes a validated physical prediction only with the additional domain evidence that the prediction needs. For the report-specific distinction between reproducibility and replication, and the separation of code verification from physical validation, see [Reproducibility and Replicability in Science, Chapter 3: Understanding Reproducibility and Replicability](https://www.nationalacademies.org/read/25303/chapter/6); [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); the terminology must be declared rather than inferred from a successful run.

03

Tolerances with units and zero scales

Let y be a reference vector with d≥1 components and yhat an estimate of the same dimension. For component i choose an absolute scale a_i>=0 with the units of y_i and a dimensionless relative scale r_i>=0. Define s_i=a_i+r_i*|y_i|. When every s_i>0, the mixed error measure is ||yhat-y||_s,infinity=max_i |yhat_i-y_i|/s_i. It is dimensionless and the inequality <=1 is exactly the collection of componentwise inequalities |yhat_i-y_i|<=s_i.

If a scale s_i is zero, that component has no error allowance: require yhat_i=y_i exactly rather than evaluating an undefined 0/0. A nonzero error on a zero scale fails the comparison. Positive absolute scales protect quantities near a zero reference value, where a purely relative allowance collapses. The choice of these scales is a scientific requirement, not a consequence of the numerical answer.

Under a consistent change of units y_i to c_i*y_i with c_i nonzero, transform the estimate by the same factor and a_i to |c_i|*a_i while leaving r_i unchanged. Both numerator and denominator of a positive-scale ratio acquire the factor |c_i|, so the ratio and the pass/fail result stay unchanged. Rescaling only the data or only the tolerance would describe a different requirement.

This comparison uses y as the reference. Replacing its scale by a scale computed from yhat can change the predicate and can make a test asymmetric. A small root-mean-square of scaled errors also does not imply that every component is <=1: in d dimensions it only gives the individual bound <=sqrt(d). Choose the aggregate norm to match the required guarantee. For a contrasting symmetric tolerance contract and the role of declared norms in verification, see [math: Mathematical functions](https://docs.python.org/3/library/math.html); [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); the additive reference-scaled predicate here is a separate definition, with its own units and zero-scale convention.

04

Composing an error budget

Consider a finite chain y_i=F_i(y_(i-1)) for i=1,...,m, and an approximate chain yhat_i=F_i(yhat_(i-1))+d_i. Suppose ||d_i||<=epsilon_i and F_i is Lipschitz with constant L_i on a domain containing the compared exact and approximate intermediate values. Use compatible norms for each input/output space, including any units carried by L_i.

The error e_i=||yhat_i-y_i|| satisfies e_i<=L_i*e_(i-1)+epsilon_i. Substitution gives e_m<=(product_(i=1)^m L_i)*e_0+sum_(j=1)^m [(product_(i=j+1)^m L_i)*epsilon_j], where an empty product is 1. This follows by induction: multiplying the preceding-stage bound by L_i propagates each old contribution once, and the new epsilon_i is then added.

The constants need not be dimensionless when different stages have different units. Each propagated term must nevertheless have the output units of y_m. A local derivative at one point supplies a finite Lipschitz constant only when a valid derivative bound on the necessary connecting domain has been established. Unproved domain membership or an uncontrolled intermediate amplification breaks this certificate.

Measurement error can be included as an initial-data bound when that bound is actually known. Discretization and arithmetic errors can occupy separate d_i terms. An unknown discrepancy between the mathematical model and reality is not removed by summing these numerical contributions; it needs its own justified bound or an explicit statement that it is unquantified. For verified numerical bounds and the distinction between numerical error and model adequacy, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); the complete Lipschitz composition above supplies the specific budget used here.

05

A computed residual needs its own enclosure

For a nonsingular square matrix A, define the exact residual r=b-A*xhat and the exact solution x=A^(-1)*b. Then x-xhat=A^(-1)*r. In an induced norm, ||x-xhat||<=||A^(-1)||*||r||. Thus a residual becomes a forward-error certificate only when a usable inverse bound and the correct residual are available.

In practice let rtilde be the evaluated residual and suppose an arithmetic analysis or enclosing computation establishes ||r-rtilde||<=eta. If K>=||A^(-1)|| is certified, the triangle inequality gives ||x-xhat||<=K*(||rtilde||+eta). Any rounding uncertainty in evaluating the norm of rtilde must also be enclosed before its displayed value is used as an upper bound.

A tiny rtilde without eta may be caused by evaluation cancellation. A tiny exact r without K can still accompany a large solution error when A has a nearly singular direction. If A is singular, the inverse argument is unavailable; residual zero might indicate one solution among many, and a nonzero residual might indicate inconsistency. The hypotheses determine which conclusion is justified.

Pass for the residual tolerance aloneAbsolute tolerance at zero; The residual magnitude lies in [0, 1/16] and the tolerance is 1/8. Model discrepancy has its own budget 1/64.Pass for the residual tolerance aloneResidual lower bound0Tolerance1/8Residual upper bound1/16-0.0150.14Magnitude in the declared residual units
The residual magnitude lies in [0, 1/16] and the tolerance is 1/8. Model discrepancy has its own budget 1/64.

The reverse triangle inequality gives the lower bound and the triangle inequality gives the upper bound for the true residual magnitude. Pass requires the upper bound to meet tolerance. Fail requires the entire enclosure to exceed it. A straddling interval leaves the question unresolved. At reference zero the absolute term remains meaningful.

Exact decision ingredients
QuantityExact result
Reference magnitude0
Absolute + relative contribution1/8 + 0
Observed absolute residual1/32
Measurement enclosure radius1/32
Certified residual interval[0, 1/16]
Tolerance1/8
DecisionPass
Independent model discrepancy budget1/64
Exact inputs and supporting calculations
Declared inputs
ParameterValue
ref0
absolute1/8
relative1/16
observed1/32
measurement1/32
model1/64

The bound above is absolute. A relative error bound requires an appropriate nonzero solution scale or a certified lower bound on that scale. Dividing by a computed norm of xhat does not silently turn the result into a relative bound with respect to the unknown x. State the chosen denominator and its enclosure. For verified residual and preconditioner frameworks, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); the evaluated residual and its enclosure must remain separate quantities in the inverse bound.

06

An approximate inverse can certify nonsingularity

Let A and B be square matrices of the same size and put E=I-B*A. Suppose a verified induced norm bound ||E||<=q<1 is available. The Neumann series sum_(k=0)^infinity E^k converges in norm because its tail is bounded by a geometric series. Multiplication of its partial sums by I-E leaves I-E^(n+1), so the limit is (I-E)^(-1).

Since B*A=I-E is nonsingular, both A and B are nonsingular in finite dimensions. In particular A^(-1)=(I-E)^(-1)*B and ||A^(-1)||<=||B||/(1-q). This is a proof of nonsingularity from a strict defect bound; it does not assume that the numerical matrix called an approximate inverse is already invertible.

For r=b-A*xhat and e=x-xhat, multiplication by B gives e=B*r+E*e. Applying the inverse Neumann series yields ||e||<=||B*r||/(1-q). This bound can be sharper than ||B||*||r||/(1-q) because it retains the direction of the residual. Enclose the true B*r and E rather than using unconstrained rounded quantities in these formulas.

The inverse certificate bounds the actual errorA certified inverse margin; The tested contraction factor is 1/3. Since it is below one, the Neumann argument applies.The inverse certificate bounds the actual errorActual error1/4Scaled residual1/3Certified error bound1/2-0.060.56Infinity norm for error and scaled residual
The tested contraction factor is 1/3. Since it is below one, the Neumann argument applies.

From e=(I−MA)e+Mr, take infinity norms and rearrange only when 1−q>0. If q<1, the Neumann series also proves MA invertible, hence A invertible for this square case. When the criterion is inconclusive, a separate determinant calculation answers invertibility without repairing that bound.

Exact matrix certificate
QuantityExact result
Error x*−x̂(1/4, 1/4)
Residual r=A(x*−x̂)(5/4, 1)
Preconditioned residual Mr(5/16, 1/3)
E=I−MA[[0,−1/4],[−1/3,0]]
Absolute row sums of E(1/4, 1/3)
||I−MA||∞1/3
||x*−x̂||∞1/4
Certified forward bound1/2
det A11
InvertibilityInvertible
Exact inputs and supporting calculations
Declared inputs
ParameterValue
a4
u1
v1
b3
xStar[1,2]
xHat["3/4","7/4"]

If q>=1, this particular argument is inconclusive. A matrix A may be nonsingular even when B=0 gives E=I and q=1. A strict certificate that fails to qualify is different from a proof that the underlying problem has no solution. For the nonsingularity and preconditioned-residual framework, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); q<1 is a sufficient certificate, while failure to establish it leaves the result inconclusive.

07

Componentwise comparison certificates

Use componentwise absolute values. Suppose |E|<=M entry by entry with M nonnegative. Let w have strictly positive components and assume M*w<=q*w for some q<1. The weighted maximum norm ||z||_w=max_i |z_i|/w_i satisfies ||M*z||_w<=q*||z||_w, since each |z_j|<=||z||_w*w_j. Therefore M^k tends to zero and sum M^k converges to a nonnegative matrix.

Let c>=|B*r| and let v>=0 satisfy c+M*v<=v. Induction gives v>=sum_(k=0)^(n-1) M^k*c+M^n*v. Since the final term tends to zero, sum_(k=0)^infinity M^k*c<=v. The exact solution correction e=(I-E)^(-1)*B*r has |e|<=sum |E|^k*|B*r|<=sum M^k*c, hence |x-xhat|<=v.

The contraction weights w and enclosure radii v play different roles and need not be equal. A sharp supersolution v may have a component where M*v=v, while another positive weight still proves strict convergence of M. When a component of v is zero, the comparison proof remains valid provided c+M*v<=v; a weighted norm using v itself would instead be undefined there.

Every matrix and vector inequality must be certified in its stated direction. Enclose rounding in M, c and the supersolution verification. This method can retain disparate units and component sensitivities more effectively than one normwise number, but it establishes a numerical enclosure for the specified linear problem, not a physical-model validation. For the inclusion and preconditioned-error setting, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); the weighted contraction and supersolution derivation above establishes the particular componentwise certificate.

08

Enclosing arithmetic operations

An interval [a,b] represents all real numbers z with a<=z<=b. For exact real endpoints, addition is enclosed by [a,b]+[c,d]=[a+c,b+d], subtraction by [a-d,b-c], and multiplication by the minimum and maximum of the four endpoint products. These bounds follow by monotonicity for addition and by the extrema of a bilinear function on a rectangle for multiplication.

If 0 is not in [c,d], reciprocal is enclosed by [1/d,1/c], and interval division is multiplication by this reciprocal interval. If the denominator interval contains zero, a finite real interval cannot enclose every permitted quotient in general: values approaching zero can make the quotient arbitrarily large, and division at zero is undefined.

On a finite-precision machine, round every computed lower endpoint downward and every upper endpoint upward under a verified elementary-operation contract. The exact endpoint value then lies between its rounded bounds. Structural induction over an expression tree proves that each interval result contains every real evaluation allowed by the initial intervals and the operation domains.

Overflow, unsupported elementary functions, invalid operations and lost domain restrictions require explicit handling. An ordinary nearest-rounded evaluation with brackets added around it is not outward interval arithmetic. Inclusion is a conditional theorem about the actual arithmetic contract; the notation alone cannot establish it. For outward enclosures and interval-operation domains, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); first-order floating-point error shorthand cannot replace a rigorous containing interval.

09

Dependency and reformulation

Suppose x ranges over [a,b]. Replacing each occurrence of x by an independent choice from [a,b] enlarges the admissible combinations. Interval evaluation of x-x therefore gives [a-b,b-a], although the true expression is zero for every single x. This is dependency overestimation: it preserves inclusion while forgetting equality between repeated occurrences.

An algebraically equivalent expression can retain more of the dependence. For x in [1,2], direct interval evaluation of x^2-2*x+1 gives [1,4]-[2,4]+1=[-2,3], whereas evaluating (x-1)^2 gives [0,1], which is the exact range. Both contain every true value; only the second exposes the shared-variable structure effectively.

If a domain is split into finitely many subdomains whose union covers it, an enclosing result on every subdomain also encloses the original range when the results are united or their hull is taken. This follows by assigning any admissible x to one covering subdomain. No value may be dropped merely because a narrow region is inconvenient.

A shared variable narrows the true rangeThe unit interval; The natural interval product is [0, 1]. The completed-square range [0, 1/4] is attained by the original function on [a,b].A shared variable narrows the true range-0.6501.74-0.141.14Natural interval enclosureCompleted-square exact range0101/4Closed enclosure endpointsShared physical scale for both range enclosures
The natural interval product is [0, 1]. The completed-square range [0, 1/4] is attained by the original function on [a,b].

Treating x and 1−x as independent interval factors allows combinations that cannot occur for the same x. The completed square is algebraically identical and the interval square has exact extrema at a far endpoint and either zero or the near endpoint. Continuity gives every intermediate value.

Exact interval ranges
QuantityExact result
Input x[0, 1]
Independent range for 1−x[0, 1]
Natural product enclosure[0, 1]
Shifted range x−1/2[−1/2, 1/2]
Does the squared input cross zero?Yes, including its boundary
Exact square of shifted interval[0, 1/4]
Exact attained range[0, 1/4]
Lower and upper endpoint excesses(0, 3/4)
Total excess of enclosure width3/4
Exact inputs and supporting calculations
Declared inputs
ParameterValue
left0
right1

Subdivision can reduce dependency inflation for many regular expressions, but inclusion alone does not promise any desired accuracy after a fixed number of splits. A singularity, an invalid operation domain, a discontinuity or irreducible endpoint uncertainty may prevent useful narrowing. Report the obtained enclosure and any unresolved domain instead of equating work performed with precision achieved. For dependence between repeated interval occurrences and its effect on enclosure width, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); inclusion alone gives neither a narrow interval nor a pointwise accuracy claim.

10

A bracket is a conditional certificate

Let f be continuous on a finite closed interval [a,b], with f(a)<=0 and f(b)>=0, or the reversed sign pattern. The intermediate value theorem gives at least one root in the interval. If endpoint values are evaluated approximately, certified enclosures must justify their signs; the sign of an unbounded rounded value is not the required hypothesis.

Choose a midpoint m strictly between the endpoints. If its exact value is zero, it is a root. Otherwise a certified sign permits retaining a half-interval with the original sign-change property. Induction preserves a nonempty closed root bracket. After k exact halvings its width is (b-a)/2^k, so its midpoint has distance at most (b-a)/2^(k+1) from a root in that bracket.

In finite precision a computed midpoint may equal an endpoint. The computation has then stagnated and has not performed another mathematical halving. Use an outward-enclosed midpoint/radius for the actual retained interval, or stop with its current certified width. An unresolved sign enclosure containing zero may require more accurate evaluation or a different certificate; it does not authorize choosing a side arbitrarily.

A bracket alone need not identify a unique root, and a small function value need not give a narrow position enclosure. Uniqueness requires additional structure such as a derivative of one strict sign. A discontinuous sign change, such as the reciprocal across its pole, does not meet the continuity hypothesis and supplies no root certificate. For interval root-finding context, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); continuity and an actual reliable sign test are the hypotheses that preserve this bracket, while uniqueness requires further information.

11

A scalar contraction root certificate

Let f be continuously differentiable on a neighborhood of a finite closed interval X, choose m in X and a nonzero scalar c, and define T(x)=x-c*f(x). Let D enclose every derivative f'(x) on X. The interval K=m-c*f(m)+(1-c*D)*(X-m) contains T(X): write T(x)=T(m)+integral_0^1 [1-c*f'(m+s*(x-m))]*(x-m) ds and use the interval enclosure along the segment.

Suppose K is contained in X and q=sup_(d in D)|1-c*d|<1. The mean-value estimate |T(x)-T(y)|<=q*|x-y| makes T a contraction on the complete metric space X, and K inclusion makes it a self-map. Its iterates are Cauchy because successive differences decrease geometrically; their limit z lies in X and satisfies T(z)=z by continuity.

Since c is nonzero, the fixed-point equation is f(z)=0. If z and w are roots in X, |z-w|=|T(z)-T(w)|<=q*|z-w| forces z=w. Thus the root is unique within X. Any root in X also lies in K, which can sharpen the reported root enclosure after existence has been established.

Enclose the true f(m), derivative interval, products and endpoints outward when implementing this argument. Inclusion in the closed interval is sufficient here because strict contraction is already proved; strict interior inclusion is a stronger optional margin. If inclusion or contraction fails, the conclusion is inconclusive, and no claim about roots outside X follows. For interval-Newton and Krawczyk constructions, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); the closed-inclusion argument here includes a separate strict contraction bound and is not the strict-interior-only theorem printed there.

12

A multivariable Krawczyk-style certificate

Let F map a neighborhood of a nonempty closed convex box X in R^n to R^n and be continuously differentiable there. Choose x0 in X and a fixed square matrix C. Let [J] enclose every entry of J_F(x) for x in X. Define the interval vector K=x0-C*F(x0)+(I-C*[J])*(X-x0). Integration of the Jacobian along each segment from x0 shows that T(x)=x-C*F(x) belongs to K for every x in X.

Suppose K is contained in X, and a rigorously computed matrix bound gives ||I-C*J_F(x)||<=q<1 for every x in X in one fixed induced norm. One sufficient bound is a nonnegative entrywise majorant M for the interval matrix followed by ||M||<=q in the maximum norm. Integrating the derivative on the segment between any x,y in X gives ||T(x)-T(y)||<=q*||x-y||.

The box is complete in finite dimensions, so the self-map contraction has one fixed point z in X. At x0, ||I-C*J_F(x0)||<1 implies C*J_F(x0) is nonsingular by the Neumann-series argument. Hence the square matrix C is nonsingular. It follows that T(z)=z implies F(z)=0, and two roots in X would be two fixed points, contradicting strict contraction.

This proves existence and uniqueness in the specified box, including a reason that a fixed point is truly a root. It does not require every matrix in the interval Jacobian to occur as an actual Jacobian; overenclosure is allowed. Conversely, unverified floating-point matrix bounds, a missing segment domain or an omitted preconditioner condition cannot be replaced by the name of an interval method. For the interval-Jacobian and Krawczyk framework, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); this closed-box result uses the explicit C1 and strict-norm-contraction assumptions proved above.

13

Continuous trajectory defects

Assume the exact solution y of y'=F(t,y) exists on [0,T], and an absolutely continuous approximation u is defined there. Both trajectories must lie in a region on which ||F(t,v)-F(t,w)||<=L*||v-w|| with a fixed L>=0 for the comparisons used. Define the differential defect d(t)=u'(t)-F(t,u(t)) for almost every t, with a known integrable bound ||d(t)||<=D(t).

Subtracting the integral equations gives ||y(t)-u(t)||<=e0+integral_0^t [L*||y(s)-u(s)||+D(s)] ds, where e0>=||y(0)-u(0)||. Comparison with the scalar solution v'=L*v+D, v(0)=e0, or an integrating-factor Gronwall argument yields ||y(t)-u(t)||<=e0*exp(L*t)+integral_0^t exp(L*(t-s))*D(s) ds.

If D(s)<=D is constant and L>0, the bound becomes e0*exp(L*t)+D*(exp(L*t)-1)/L. For L=0 it is e0+D*t. The defect has units of state divided by time and L has units of inverse time, so both terms have the state norm's units. A sharper time-dependent D can give a substantially better bound than its maximum.

This is a continuous-trajectory certificate, not merely a check at accepted mesh points. Dense output, numerical differentiation of u and residual evaluation must support the defect bound over the whole interval. Existence and the valid Lipschitz region are explicit hypotheses unless a separate self-consistent enclosure proves them; a small defect cannot extend a solution through a genuine blow-up. For the broader verified-error and model-validation distinctions, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); the trajectory certificate above additionally needs an existing solution and a common Lipschitz-controlled domain.

14

A directional derivative test has a scope

Let F be twice continuously differentiable along x+t*v for 0<=t<=h, h>0, and suppose the bilinear second derivative has norm at most M on that segment. Taylor's integral remainder gives ||[F(x+h*v)-F(x)]/h-J_F(x)*v||<=M*h*||v||^2/2. If each function evaluation has norm error at most epsilon, the evaluated difference adds at most 2*epsilon/h.

Thus B=M*h*||v||^2/2+2*epsilon/h bounds the distance between the evaluated finite difference and the true directional derivative, with any additional subtraction/division error added explicitly. An alleged exact directional derivative g with discrepancy greater than B cannot equal J_F(x)*v under these contracts. If g is itself uncertain by eta, rejection needs discrepancy greater than B+eta.

Passing a discrepancy threshold B is not a proof that the alleged derivative error is <=B. From that pass and the difference bound one obtains at most 2*B by the triangle inequality for this one direction. Very small h can increase the evaluation-error contribution, while a fortuitously vanishing leading Taylor term can make one test unusually forgiving.

The signed central-difference errors are exact hereA positive cubic remainder; The exact directional derivative is 1. The halved-step error is 1/16. The signed ratio is four.The signed central-difference errors are exact hereAt h1/4At h/21/16-0.030.28Computed derivative minus exact derivative
The exact directional derivative is 1. The halved-step error is 1/16. The signed ratio is four.

On this fixed line the cubic coefficient of φ(t)=F(x+tu,y+tv) is u³. Central differencing cancels the even terms, leaving φ′(0)+u³h² in exact arithmetic. Passing a few directional checks does not establish the full derivative on other directions or inputs.

Exact directional check
QuantityExact result
Input direction(1, −1)
Exact DF·(u,v)1
Steps h and h/2(1/2, 1/4)
Central quotients(5/4, 17/16)
Signed errors(1/4, 1/16)
Signed coarse/fine error ratio4
Exact inputs and supporting calculations
Declared inputs
ParameterValue
k2
x1
y2
u1
v-1
h1/2

Testing selected directions cannot determine an unrestricted Jacobian. If their span is a proper subspace, a nonzero linear perturbation D can vanish on every tested direction: choose a nonzero row functional annihilating that span and multiply it by a nonzero output vector. Then J and J+D agree on all those tests but disagree elsewhere. Broader conclusions require structural assumptions or a complete directional basis. For derivative-comparison context and finite verification coverage, see [The Connection Between the Complex-Step Derivative Approximation and Algorithmic Differentiation](https://www.umich.edu/~mdolaboratory/pdf/Martins2001.pdf); [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); a directional Taylor test controls that direction under the stated oracle bound, rather than an unrestricted Jacobian.

15

Complex-step differentiation and analyticity

Let f have a holomorphic extension near the segment from real x to x+i*h, h nonzero and real, and be real-valued on the real axis nearby. Then f(x), f'(x) and f''(x) are real. Complex Taylor expansion along that segment gives f(x+i*h)=f(x)+i*h*f'(x)-h^2*f''(x)/2+R, where |R|<=M*|h|^3/6 if |f'''|<=M on the segment.

The constant and quadratic terms have no imaginary part. Dividing the imaginary part by h therefore gives |Im(f(x+i*h))/h-f'(x)|<=M*h^2/6. Unlike a real forward difference, the expression does not subtract two nearly equal real function values. This structural benefit depends on the analytic extension and on the actual complex implementation.

If the computed complex value differs from f(x+i*h) by at most epsilon in modulus, its imaginary error is at most epsilon and the derivative error bound becomes M*h^2/6+epsilon/|h|, plus input and final-operation errors if present. Consequently an arbitrarily small step is not justified by this bound when epsilon is fixed.

Operations such as conjugation, taking an absolute value, discarding imaginary parts or selecting incompatible branches can violate holomorphicity. For f(z)=conjugate(z), the real-axis function is f(x)=x with derivative 1, but Im(f(x+i*h))/h=-1. A successful real-valued implementation is not automatically a valid complex-step oracle. For the analytic complex-step construction, see [The Connection Between the Complex-Step Derivative Approximation and Algorithmic Differentiation](https://www.umich.edu/~mdolaboratory/pdf/Martins2001.pdf); holomorphic extension and bounded evaluation error remain essential, and very small h does not make every implementation analytic or exact.

16

Adjoint consistency and operator accuracy

For a real matrix A of size m by n, its Euclidean adjoint is A transpose. An implementation B of size n by m is adjoint-consistent exactly when <A*x,y>=<x,B*y> for all x in R^n and y in R^m. Taking x=e_i and y=e_j gives A_(j,i)=B_(i,j), so all m*n exact standard-basis tests imply B=A transpose.

Conversely B=A transpose implies every dot-product identity by expansion of the finite sums. If each complete basis discrepancy is bounded by delta, every entry of B-A transpose has magnitude at most delta. Its Frobenius norm is at most sqrt(m*n)*delta, and its induced Euclidean norm is no larger. Include the dot-product evaluation errors in any bound obtained from rounded tests.

A few test pairs constrain only a few bilinear evaluations and can miss nonzero entries or directions. Even all adjoint-consistency tests do not establish that A is the intended operator: the pair (2*A,2*A transpose) is perfectly consistent with itself while differing from target A whenever A is nonzero.

Use these tests to check a stated relationship and compare at least one implementation against independent target evidence when operator accuracy is required. The complex version uses a conjugate transpose and a consistently defined complex inner product; replacing it silently by a real transpose changes the contract. For derivative verification and test-coverage context, see [The Connection Between the Complex-Step Derivative Approximation and Algorithmic Differentiation](https://www.umich.edu/~mdolaboratory/pdf/Martins2001.pdf); [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); the basis calculation establishes an adjoint relation, while accuracy of either operator against the intended map remains a separate claim.

17

Differentiate the iteration actually executed

Consider the fixed executed recurrence y_(n+1)=a*y_n+theta with a fixed independently specified scalar a, y_0=0, and exactly N steps. Direct differentiation gives v_0=0 and v_(n+1)=a*v_n+1. Hence v_N=sum_(j=0)^(N-1) a^j=(1-a^N)/(1-a) for a!=1, while v_N=N for a=1.

When |a|<1, the mathematical fixed point is y*=theta/(1-a) and its derivative with respect to theta is 1/(1-a). The difference between that derivative and v_N is a^N/(1-a), with absolute value |a|^N/|1-a|. The primal difference is theta*a^N/(1-a). Convergence can be slow near a=1 even when every individual differentiation step is correct.

An automatic differentiation procedure that follows the N executed steps should return v_N under its operation contract. Returning the fixed-point derivative answers a different question unless convergence and its derivative error have been justified. An accurate primal value and an accurate sensitivity are related but distinct tolerance requirements.

If a stopping rule selects N from the current data, the executed mapping can have different formulas on different regions. Within a region where N is constant the unrolled derivative applies, but boundaries can require separate continuity and differentiability analysis. Differentiating the branch that happened to run does not prove differentiability of the entire stopping-rule algorithm. For the connection between derivative-carrying arithmetic and iterative calculations, see [The Connection Between the Complex-Step Derivative Approximation and Algorithmic Differentiation](https://www.umich.edu/~mdolaboratory/pdf/Martins2001.pdf); the finite executed map and its implicit limit have different derivatives until a convergence argument relates them.

18

Manufactured solutions expose discretization errors

To verify a discretization, choose a smooth function first and derive the forcing and boundary data from the mathematical equation. For -u''=f on [0,1] with zero endpoints, take u(x)=x^3*(1-x). Direct differentiation gives f(x)=12*x^2-6*x. This constructed problem has an independently known exact solution without requiring an empirical physical interpretation.

Let N>=2 be an integer, set h=1/N and x_i=i*h for i=0,...,N, and let A_h be the central-difference Dirichlet matrix: (A_h*z)_i=(2*z_i-z_(i-1)-z_(i+1))/h^2, with endpoint entries zero. The polynomial identity D_h^2*u=u''+h^2*u''''/12 is exact for this quartic, and u''''=-24. Therefore A_h*u_grid=f_grid+2*h^2*1. The exact sampled continuum solution has a nonzero discrete residual.

The barrier w(x)=x*(1-x)/2 satisfies A_h*w_grid=1 exactly. Consequently U=u_grid-2*h^2*w_grid=u_grid-h^2*x_grid*(1-x_grid) satisfies A_h*U=f_grid. The matrix is nonsingular because z transpose A_h z=h^(-2)*sum_(i=0)^(N-1)(z_(i+1)-z_i)^2>0 for nonzero interior z with zero endpoints. Thus U is the unique exact discrete solution.

The nodal error is U_i-u(x_i)=-h^2*x_i*(1-x_i), with maximum magnitude <=h^2/4 and equality when the grid contains 1/2. Yet U has algebraic residual zero. This manufactured experiment can expose the discretization's second-order mesh error; it cannot by itself validate the equation as a model of a physical object or bound between-node interpolation error. For manufactured-solution verification, see [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); the exact polynomial calculation here separately exposes discretization error even when the linear-system residual is zero.

19

What an observed convergence order means

Suppose a scalar approximation has the actual asymptotic expansion U_h=U+C*h^p+o(h^p) as h tends to zero through a compatible mesh family, where p>0 and C is a fixed nonzero coefficient. Fix a refinement ratio r>1 and define Delta_h=U_h-U_(h/r). Then Delta_h=C*h^p*(1-r^(-p))+o(h^p).

The next difference is Delta_(h/r)=C*h^p*r^(-p)*(1-r^(-p))+o(h^p). Their ratio tends to r^p, and for sufficiently small h both differences are nonzero. Thus p_hat(h)=log(|Delta_h/Delta_(h/r)|)/log(r) tends to p. For vector errors with a fixed nonzero leading vector, the same conclusion holds for the ratio of compatible difference norms.

The conclusion uses a genuine asymptotic expansion, a common target and a refinement family with the same mathematical assumptions. Different boundary approximations, changing solver tolerances, quadrature choices, stochastic noise or arithmetic error can introduce contributions that are not C*h^p. Cancellation of the leading coefficient can also make an observed order higher than the method's generic order.

Three finite values supply a diagnostic p_hat, not a proof of the expansion or its remainder. Differences near evaluation uncertainty can make the ratio meaningless. State whether an order is theoretically proved, asymptotically expected or only observed, and retain enough precision and solver accuracy to interpret the particular diagnostic. For mesh-refinement verification, see [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); the observed-order conclusion here depends on the explicitly assumed nonzero leading coefficient and remainder, rather than consistency alone.

20

Extrapolation with a known remainder

Assume the stronger finite contract U_h=U+C*h^p+R_h and U_(h/r)=U+C*h^p*r^(-p)+R_(h/r), with p>0, r>1 and known |R_t|<=K*t^(p+q) at both meshes for q>0. Let Delta_h=U_h-U_(h/r). The conventional estimate for the signed fine error is Ehat=Delta_h/(r^p-1).

The true signed fine error is E_f=U_(h/r)-U. Subtracting the expressions cancels C exactly and gives E_f-Ehat=[r^p*R_(h/r)-R_h]/(r^p-1). Hence |E_f-Ehat|<=K*h^(p+q)*(1+r^(-q))/(r^p-1). This is a finite error enclosure derived from a specified remainder, rather than an inference from a small observed mesh difference.

The extrapolated value U_ext=U_(h/r)-Ehat has error U_ext-U=E_f-Ehat and obeys the same bound. If the evaluated approximations themselves have errors eta_c and eta_f, the extrapolation weights r^p/(r^p-1) and -1/(r^p-1) add at most [r^p*eta_f+eta_c]/(r^p-1) to its error bound.

Removing one power can leave a signed remainderA nonzero leading coefficient; The raw signed differences are (111/256, 399/4096). The nominal exponent is 2 and the extrapolated error is −1/64.Removing one power can leave a signed remainderQ(h)9/16Q(h/2)33/256Q(h/4)129/4096Extrapolated estimate−1/64-0.0850.6319Exact estimate minus target
The raw signed differences are (111/256, 399/4096). The nominal exponent is 2 and the extrapolated error is −1/64.

The nominal formula (2^p Q(h/2)−Q(h))/(2^p−1) exactly cancels c h^p and leaves a known multiple of d h^(p+2). A finite difference ratio can reflect cancellation or a vanishing leading term, so it is not a certificate of the nominal order. The extrapolation uses the nominal p independently of the observed ratio. Its signed fine-error estimate can have the wrong sign, as the case with cancelling raw errors shows.

Exact extrapolation readouts
QuantityExact result
Raw estimates(25/16, 289/256, 4225/4096)
Raw signed errors(9/16, 33/256, 129/4096)
Consecutive differences(111/256, 399/4096)
Signed difference ratio592/133
Magnitude of difference ratio592/133
Nominal p / leading coefficient c2 / 2
Actual leading nonzero power2
Signed fine-error estimate (Q(h)−Q(h/2))/(2^p−1)37/256
Exact signed fine error Q(h/2)−q33/256
Extrapolated estimate63/64
Extrapolated signed error−1/64
Exact inputs and supporting calculations
Declared inputs
ParameterValue
q1
c2
d1
p2
h1/2

The finite remainder contract must be justified for the problem and the actual meshes. A logarithmic error term, a vanishing leading coefficient or an unbounded remainder constant can defeat an unqualified interpretation of Richardson differences. A small estimate without a known remainder remains useful evidence, but it is not this rigorous certificate. For the refinement and solution-error setting, see [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); the quantitative remainder inequality above is the extra information that turns a Richardson correction into a bound.

21

Finite black-box agreement is limited

Let S={s_1,...,s_m} be a finite set of distinct real test inputs, and let x0 be a real input outside S. Define P(x)=product_(j=1)^m (x-s_j)^2, with the empty product 1 if no tests were made. Then P vanishes at every tested input but P(x0)>0.

For any proposed function f, the alternative g(x)=f(x)+lambda*P(x) agrees with f at every input in S. At x0 its discrepancy is |lambda|*P(x0), which can exceed any specified bound by increasing |lambda|. If f is smooth or analytic on a relevant domain, adding this polynomial preserves that qualitative regularity.

Thus finitely many exact black-box agreements cannot certify unrestricted off-sample equality, a uniform error bound or a physical law. Adaptive finite tests do not remove the basic limitation for a completed finite transcript: functions agreeing on the observed input set remain observationally indistinguishable on that transcript.

A quantitative function-class restriction can change the conclusion. Known degree bounds, certified derivative bounds, a finite-dimensional structural model or a specified probability distribution supply extra information beyond the tested values. The counterexample does not preserve arbitrary quantitative restrictions; those restrictions must be established and used explicitly in any stronger inference. For finite code-test coverage and reproducibility terminology, see [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); [Reproducibility and Replicability in Science, Chapter 3: Understanding Reproducibility and Replicability](https://www.nationalacademies.org/read/25303/chapter/6); the constructed unsampled perturbation explains why unrestricted agreement on finitely many values is insufficient.

22

Invariants can miss the wrong dynamics

Use dimensionless or consistently scaled oscillator coordinates z=(q,p) and the quadratic invariant H(z)=||z||_2^2/2. The rotation R(theta)=[[cos(theta),-sin(theta)],[sin(theta),cos(theta)]] satisfies R(theta) transpose R(theta)=I. It therefore preserves H exactly, has determinant 1 and has inverse R(-theta).

An intended time step R(theta) and an erroneous step R(phi) have all these properties for any real theta and phi. After N steps they give R(N*theta)*z0 and R(N*phi)*z0. Subtracting their squared norms or using the angle between them yields ||R(N*theta)*z0-R(N*phi)*z0||_2=2*||z0||_2*|sin(N*(theta-phi)/2)|.

This error can be comparable to the full trajectory amplitude while both discrete histories preserve energy perfectly. Executing an erroneous rotation and then its inverse also returns exactly to the start in exact arithmetic. Hence an invariant check and a reversibility check can both pass while the phase and time evolution are wrong.

Conservation diagnostics are valuable for finding violations of known structure, but they do not uniquely identify the dynamics. To verify the intended trajectory, combine them with independently justified local consistency, time-step accuracy or a suitable reference solution. Accuracy of the conserved quantity is a different target from accuracy of the state. For the scope of numerical verification tests, see [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); conservation and reversibility alone cannot rule out the explicit wrong-phase dynamics exhibited above.

23

Metamorphic properties and basis completeness

A metamorphic test checks a relationship between outputs under transformed inputs when a reliable individual answer may be unavailable. For a linear target A, exact additivity A(x+y)=A*x+A*y and homogeneity A(c*x)=c*A*x are examples. These identities follow from the mathematical target, so a genuine violation rejects the claimed linear contract under exact or appropriately enclosed arithmetic.

However every other linear operator H satisfies the same identities, including H=0. A wrong scalar multiple of A also preserves both tests. Checking finitely many such identities does not even prove that an unrestricted implementation is linear: a function may agree on all tested arguments and differ elsewhere.

If H is independently known to be a linear map on R^n, exact agreement H(e_i)=A(e_i) on all n standard basis vectors proves H=A. Indeed x=sum x_i*e_i gives (H-A)*x=sum x_i*(H-A)*e_i=0. The structural linearity assumption is doing essential work that a handful of numerical tests cannot replace.

Use transformations whose domain, boundary conditions and units preserve the target problem. A scaling identity can fail legitimately for a nonlinear or saturating model, and a symmetry may be broken by prescribed data. State both the relationship being tested and the conclusions a pass can and cannot support. For finite verification coverage and exact algebraic checking, see [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); [Lecture 10: Polynomial Identity Testing and Parallel Matchings](https://www.cs.cmu.edu/~avrim/Randalgs11/lectures/lect0209.pdf); complete basis agreement identifies an operator only when its linearity and arithmetic setting are already justified.

24

Eigenpair residuals depend on matrix structure

Let A be Hermitian, let v be a nonzero vector, and let lambdahat be real. An orthonormal eigenbasis u_j has real eigenvalues lambda_j. Write v=sum c_j*u_j and r=A*v-lambdahat*v. Orthogonality gives ||r||_2^2=sum |c_j|^2*|lambda_j-lambdahat|^2.

If d=min_j |lambda_j-lambdahat|, the sum is at least d^2*sum |c_j|^2=d^2*||v||_2^2. Hence d<=||r||_2/||v||_2. With an evaluated residual rtilde and certified ||r-rtilde||_2<=eta, replace its numerator by an enclosed upper bound for ||rtilde||_2+eta, and use a positive lower bound for ||v||_2 if its norm is uncertain.

The Hermitian assumption matters. For K>=1 take A=[[0,K],[0,0]], lambdahat=1 and v=(1,1/K) transpose. The eigenvalues of A are both zero, but A*v-lambdahat*v=(0,-1/K) transpose. The residual-to-vector ratio is 1/sqrt(K^2+1), arbitrarily small, while the distance from 1 to the spectrum stays exactly 1.

A residual therefore certifies a nearby spectral value through the stated structural theorem, not through size alone. In nonnormal problems it can instead indicate sensitivity to matrix perturbations and a pseudospectral effect. A small residual also does not by itself certify an eigenvector direction when nearby eigenvalues are clustered. For residual-enclosure principles, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); the Hermitian spectral argument and the nonnormal counterexample above show precisely which additional matrix structure makes this eigenvalue conclusion valid.

25

Bitwise repeatability differs from accuracy

Specify normalized binary arithmetic with precision three, nearest rounding with ties to even, and an exponent range sufficient to avoid underflow and overflow for the example. Between 8 and 16 the representable numbers are 8,10,12,14. The exact sum 8+1=9 is halfway between 8 and 10, and the even-significand rule rounds it to 8.

Consequently the rounded evaluation of (8+1)-8 is 0. In the alternative tree 1-8=-7 is exactly representable with three binary significant bits, and 8+(-7)=1 is also exactly representable. Thus the rounded evaluation of 8+(1-8) is 1, which equals the exact sum of the three original inputs.

Both operation trees can be reproduced perfectly under the same specified arithmetic semantics. One nevertheless loses the exact small result while the other retains it. Algebraic associativity over the real numbers does not justify reassociating rounded machine additions while claiming bitwise identity.

Bitwise reproducibility is a statement about the selected execution contract, input representations and output bits. Numerical accuracy is a statement about distance from the mathematical target. A deterministic answer can be wrong, and two different rounded answers can both meet a less stringent scientific tolerance. For bitwise reproducibility and the broader reproducibility terminology used in science, see [Efficient Reproducible Floating Point Summation and BLAS](https://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/Archive/EECS-2016-121.pdf); [Reproducibility and Replicability in Science, Chapter 3: Understanding Reproducibility and Replicability](https://www.nationalacademies.org/read/25303/chapter/6); the declared small-precision model demonstrates why repeatability and accuracy need different evidence.

26

A reproducible reduction needs a contract

A fixed reduction tree gives the same output bits when every leaf representation, elementary operation, rounding rule and exceptional-value convention is fixed and deterministic. Changing scheduling without changing the tree can preserve that result; changing the tree need not. This is an execution-semantics statement, not an automatic accuracy bound.

For an accuracy comparison, assume each addition satisfies fl(a+b)=(a+b)*(1+delta), |delta|<=u, with no unaccounted underflow or overflow. Expanding a binary summation tree expresses its computed sum as sum_i x_i*product_(j on path i)(1+delta_j). If each leaf path contains at most d additions and d*u<1, the magnitude of each product's deviation from 1 is at most (1+u)^d-1<=d*u/(1-d*u).

The last inequality follows by bounding each binomial coefficient by d^k and the resulting finite nonnegative sum by the geometric series sum_(k>=0)(d*u)^k. Therefore |shat-sum x_i|<=gamma_d*sum |x_i| with gamma_d=d*u/(1-d*u). Balanced trees can reduce d, but different balanced trees can still yield different bits, and a small absolute bound can be large relative to a heavily cancelled exact sum.

An exact accumulator instead sums the input dyadic rationals without intermediate rounding, using an integer scale and sufficient proven capacity, then applies one specified final rounding. Integer associativity makes the exact accumulated value independent of input order. The final result is correctly rounded to that exact sum under its representability contract; nearest rounding has error no larger than half the gap between the two adjacent representable values bracketing the sum. Required accumulator capacity and handling of exceptional inputs remain explicit. For reproducible summation contracts, see [Efficient Reproducible Floating Point Summation and BLAS](https://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/Archive/EECS-2016-121.pdf); the selected binned algorithm is approximate, whereas the exact-dyadic accumulator result above deliberately assumes exact accumulation and sufficient capacity.

27

Fused and separate operations have different semantics

Separate multiplication and addition compute p=fl(a*b) and s=fl(p+c); a fused multiply-add computes fl(a*b+c) with one final rounding of the exact product-plus-sum. These are distinct operation contracts even when the original inputs are exactly representable. Algebraic equivalence of the real expression does not make the contracts identical.

In the usual relative rounding model, write p=a*b+e1 with |e1|<=u*|a*b| and s=p+c+e2 with |e2|<=u*|p+c|. Then |s-(a*b+c)|<=u*(1+u)*|a*b|+u*|a*b+c|. The fused result instead has error at most u*|a*b+c|, when the model's normal-range and rounding assumptions apply to that result.

For a concrete precision-three binary example, take a=b=5/4 and c=-3/2. The exact product is 25/16, which rounds to 3/2 because the neighboring precision-three numbers are 3/2 and 7/4. Separate evaluation therefore returns 0. The exact product-plus-sum is 1/16, exactly representable with the stated exponent range, so the fused operation returns 1/16.

The fused operation is more accurate for this target in this example and changes the bits. A reproducibility requirement must say whether contraction to fused operations is part of the contract, while a scientific accuracy requirement can instead permit every result within a justified bound. Neither a compiler's freedom nor one observed output substitutes for specifying which claim is intended. For single-round fused multiply-add and reproducible-operation semantics, see [math: Mathematical functions](https://docs.python.org/3/library/math.html); [Efficient Reproducible Floating Point Summation and BLAS](https://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/Archive/EECS-2016-121.pdf); the fused and separate expressions have different rounding contracts even when they represent the same real algebra.

28

Encoding identity and finite hashes

Exact reproducibility begins with a defined data identity. Raw concatenation of variable-length strings is ambiguous: the ordered pairs ('ab','c') and ('a','bc') both concatenate to 'abc'. In a fixed byte encoding, represent each string by its canonical decimal byte length followed by a delimiter and exactly that many bytes. An ordered sequence of such fields can be parsed uniquely from left to right.

With explicit type tags and an unambiguous sequence length or terminator, induction on the parsed fields proves injectivity of this encoding over its stated domain. Numeric semantics must also be specified. A reduced rational numerator/positive-denominator representation identifies a rational value, whereas preserving a floating-point object's bit pattern can distinguish positive and negative zero or different exceptional payloads.

A b-bit hash has at most 2^b outputs. On any domain with more than 2^b distinct encoded inputs, the pigeonhole principle guarantees at least two inputs with the same hash. Consequently equal finite hashes alone are not a mathematical proof of byte equality over an unrestricted larger domain.

Hashes remain useful compact integrity evidence under their actual engineering and threat assumptions. A rigorous identity claim can retain the exact bytes or explicitly condition its use of a digest on a collision assumption. Do not silently turn a practical checksum into an injective encoding or confuse semantic equality of mathematical values with equality of their stored representations. For identifiable artifacts and computation semantics, see [Reproducibility and Replicability in Science, Chapter 3: Understanding Reproducibility and Replicability](https://www.nationalacademies.org/read/25303/chapter/6); [Efficient Reproducible Floating Point Summation and BLAS](https://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/Archive/EECS-2016-121.pdf); the encoding and finite-hash arguments above state what identity evidence can and cannot establish.

29

Complete provenance and safe reuse

Model a reproducible computation as a finite directed acyclic graph. Each node applies a deterministic pure function to an ordered tuple of predecessor outputs and explicit local inputs. Include in that function contract every effective parameter, operation semantics and random-stream specification; uncontrolled external state would violate purity.

Choose a topological ordering of the graph. If the initial inputs and every node's function contract are identical in two executions, the first node gives identical output. Induction gives identical predecessor values at the next node and hence identical output there. Proceeding through the finite ordering proves identical outputs at all nodes, independent of an evaluation schedule that preserves these dependencies.

A cached result is justified by this argument only when its identity includes all effective dependencies and the function contract. If a key identifies x but omits parameter a from f_a(x)=a*x+1, equal keys at different a do not imply equal outputs. Digest-based keys additionally inherit whatever collision assumptions their use of digests requires.

The dependency argument gives the mathematical conditions for justified reuse. A clear record of data, mathematical target, parameters, method and operation environment makes the dependency argument reviewable. Reusing a completed calculation is appropriate when this identity evidence is available; missing identity evidence is not a successful verification. For reproducibility through retained artifacts and explicit arithmetic contracts, see [Reproducibility and Replicability in Science, Chapter 3: Understanding Reproducibility and Replicability](https://www.nationalacademies.org/read/25303/chapter/6); [Efficient Reproducible Floating Point Summation and BLAS](https://www2.eecs.berkeley.edu/Pubs/TechRpts/2016/Archive/EECS-2016-121.pdf); the dependency induction above permits reuse only when all relevant inputs and semantics remain identified.

30

Parallel sample identities and dependence

To preserve sample identity under parallel scheduling, define each sample by a fixed global identifier rather than by whichever worker happens to request the next value. A deterministic mapping (seed,index) to sample yields the same indexed values when its mapping and arithmetic are fixed. Reordering their evaluation preserves the exact multiset, although rounded reductions can still depend on their operation tree.

This construction establishes identity, not probabilistic independence. A deterministic pseudorandom generator does not become a proved iid source because its indices are distinct. Any statistical theorem must separately state the sampling model or the generator assumptions under which it is used. Reusing a seed or overlapping index ranges can create identical observations.

For random variables X_i with finite second moments, Var(N^(-1)*sum X_i)=N^(-2)*sum_(i,j) Cov(X_i,X_j). Under independence and common variance sigma^2, off-diagonal covariances vanish and the result is sigma^2/N. If all N entries are duplicates of one variable Z, every covariance is sigma^2 and the mean's variance is sigma^2.

Repeatedly reproducing one stochastic realization therefore does not create independent replication or reduce uncertainty about its expectation. Preserve which sample identities were reused and which were newly drawn. Distinguish an exact repeatability check from a new statistical experiment. For indexed parallel sample identities and the independence conditions in concentration bounds, see [Parallel Random Numbers: As Easy as 1, 2, 3](https://random123.com/); [Probability Inequalities for Sums of Bounded Random Variables](https://www.cs.rpi.edu/academics/courses/spring06/random/hoefding.pdf); deterministic addressing does not itself supply the covariance assumptions needed by a probability theorem.

31

Replicate agreement cannot measure common bias

Suppose R>=2 independent replicates have the same finite-variance distribution Y_r=theta+b+epsilon_r, with E(epsilon_r)=0 and Var(epsilon_r)=sigma^2. The common mean is m=theta+b, and the replicate average has expectation m and variance sigma^2/R. Its mean-square error with respect to theta is b^2+sigma^2/R.

Define S^2=(R-1)^(-1)*sum_(r=1)^R (Y_r-Ybar)^2. The identity sum (Y_r-Ybar)^2=sum (Y_r-m)^2-R*(Ybar-m)^2 follows by expanding both sides and using sum(Y_r-Ybar)=0. Taking expectations gives R*sigma^2-R*(sigma^2/R)=(R-1)*sigma^2, so E(S^2)=sigma^2.

Thus S^2/R is an unbiased estimate of the average's sampling variance under these assumptions. It does not estimate b^2, and a small observed replicate spread does not bound the common bias. A confidence statement needs additional distributional or concentration assumptions; an unbiased variance estimator is not itself a high-probability upper bound.

Replicates that share random inputs or common fitted parameters can have covariance, requiring the covariance-sum calculation instead. Report separately what was repeated identically, what was independently replicated and what numerical or modelling bias was assessed by independent evidence. For replication terminology and assumptions on sample means, see [Reproducibility and Replicability in Science, Chapter 3: Understanding Reproducibility and Replicability](https://www.nationalacademies.org/read/25303/chapter/6); [Probability Inequalities for Sums of Bounded Random Variables](https://www.cs.rpi.edu/academics/courses/spring06/random/hoefding.pdf); the bias–variance calculation above shows why replicate spread cannot measure a common unknown bias.

32

A bounded-sample probability certificate

Let X_1,...,X_N be independent random variables with a common mean theta and almost-sure bounds a<=X_i<=b, where L=b-a>0. For one centered bounded variable Z=X-E(X), put psi(t)=log E(exp(t*Z)). Boundedness permits differentiation under expectation. Its second derivative is the variance under the exponentially tilted distribution, which still has support in [a,b].

Any distribution on [a,b] has variance <=L^2/4: with midpoint m0=(a+b)/2, Var(X)=E((X-m0)^2)-(E(X)-m0)^2<=L^2/4. Hence psi''(t)<=L^2/4, while psi(0)=psi'(0)=0. Taylor's integral formula psi(t)=t^2*integral_0^1 (1-s)*psi''(s*t) ds gives psi(t)<=t^2*L^2/8 for every real t.

Independence multiplies the moment-generating functions. Markov's inequality therefore bounds P(sum_i(X_i-theta)>=N*epsilon) by exp(-t*N*epsilon+N*t^2*L^2/8) for t>0. Minimizing at t=4*epsilon/L^2 gives exp(-2*N*epsilon^2/L^2). Applying the same argument to the negatives and taking a union bound yields P(|Xbar-theta|>=epsilon)<=2*exp(-2*N*epsilon^2/L^2).

Thus N>=L^2*log(2/delta)/(2*epsilon^2) is sufficient for failure probability <=delta, with epsilon>0 and 0<delta<1. Round N upward to an integer. If L=0 the observations equal their known constant almost surely and this division is unnecessary. The theorem uses true bounds and independence, not an empirical variance, unbounded observations or repeated copies of one draw. For the common bounded-range mean inequality, see [Probability Inequalities for Sums of Bounded Random Variables](https://www.cs.rpi.edu/academics/courses/spring06/random/hoefding.pdf); the selected Theorem 1, inequality (2.3), supports the stated rescaling, while the complete moment-generating-function argument above retains independence explicitly.

33

Random tests need a detection model

Fix an incorrect implementation and a specified distribution of test inputs. Suppose its detectable error set has probability at least p under that distribution, with 0<p<=1. For k independent tests of the same fixed implementation, each miss has probability at most 1-p, so the probability of missing every error is at most (1-p)^k.

For 0<p<1 and a desired miss probability delta in (0,1), it is sufficient that k>=log(delta)/log(1-p), rounded upward. Both logarithms are negative. If p=1 a single valid test detects the error; if no positive lower bound on p is known, the calculation gives no finite distribution-free assurance.

The conditional bound concerns false acceptance when the implementation is wrong in the specified way. It is not a posterior probability that an accepted implementation is correct. A test that samples only a convenient region can have p=0 for an error confined elsewhere. An oracle that fails to recognize an erroneous output also changes the detection model.

Fresh independent tests are a sufficient mechanism. More generally the same product bound follows if the conditional detection probability given the preceding misses is always at least p, by multiplying conditional miss probabilities. Reusing the same input or choosing tests adaptively without such a conditional guarantee does not justify the independent-trial formula. For randomized checking and explicit probabilistic assumptions, see [Lecture 10: Polynomial Identity Testing and Parallel Matchings](https://www.cs.cmu.edu/~avrim/Randalgs11/lectures/lect0209.pdf); [Probability Inequalities for Sums of Bounded Random Variables](https://www.cs.rpi.edu/academics/courses/spring06/random/hoefding.pdf); a miss probability conditional on a genuine defect is not a posterior probability of correctness after acceptance.

34

Freivalds verification over a finite field

Let A,B,C be n by n matrices over a finite field F_q, and suppose D=A*B-C is nonzero. Draw v uniformly from F_q^n with independent coordinates and test A*(B*v)=C*v using exact field arithmetic. If C=A*B every vector passes; if C is wrong, a passing vector means D*v=0.

Choose a nonzero row d of D and an index j with d_j nonzero. Condition on every coordinate of v except v_j. The scalar equation d*v=0 has exactly one solution for v_j because multiplication by the nonzero field element d_j is invertible. Therefore P(d*v=0)=1/q, and P(D*v=0)<=1/q because the vector equation implies that row equation.

For k fresh independent vectors, an incorrect product passes all trials with probability at most q^(-k). Each trial needs the three matrix-vector products B*v, A*(B*v) and C*v, using O(n^2) field operations for dense matrices, rather than explicitly forming the usual cubic matrix product. A vector giving unequal sides is an exact, reproducible witness against the proposed product.

The false-acceptance set is an exact finite kernelRank one over GF(2); The blue and orange marks show two discrete point sets. Each of the 4 vectors has equal selection probability; exactly 2 pass a false identity.The false-acceptance set is an exact finite kernel-0.401.55-0.41.45Kernel vectors (test accepts)Nonkernel vectors (test rejects)First coordinate horizontally · second vertically, in GF(2)
The blue and orange marks show two discrete point sets. Each of the 4 vectors has equal selection probability; exactly 2 pass a false identity.

With A=B=I and C=I−D, the test accepts when Dr=0. Rank–nullity gives p^(2−rank D) accepted equally likely inputs out of p². Multiplication of probabilities uses independently uniform vectors in the full field. A different choice of test distribution needs its own bound.

Exact rank and probability
QuantityExact result
Difference matrix D[[1,1],[0,0]]
Determinant modulo p0
Rank1
Accepted vectors(0, 0), (1, 1)
Single-trial false acceptance1/2
Independent trials3
False acceptance in every trial1/8
If D=0Every vector accepts; the identity is true.
Exact inputs and supporting calculations
Declared inputs
ParameterValue
p2
D[[1,1],[0,0]]
trials3

The theorem is conditional on the specified product being wrong over this field. It is not a posterior probability of correctness after a pass. Applying the test to real floating-point arithmetic does not preserve the field proof, and reducing an integer product modulo one prime can hide an integer discrepancy divisible by that prime. Those different targets require additional arguments. For the binary-vector matrix-checking argument, see [Lecture 10: Polynomial Identity Testing and Parallel Matchings](https://www.cs.cmu.edu/~avrim/Randalgs11/lectures/lect0209.pdf); the uniform finite-field version above independently proves its 1/q bound under exact field arithmetic and a nonzero difference matrix.

35

Polynomial identity testing

Let P be a nonzero formal polynomial of total degree at most d in m variables over a field, and let S be a nonempty finite subset of that field with s elements. Draw the m coordinates independently and uniformly from S. The claim is Pr(P(X_1,...,X_m)=0)<=min(1,d/s). For m=1 a nonzero polynomial has at most d roots: each distinct root supplies a linear factor by polynomial division, so more roots would force degree greater than d.

For the induction step write P=sum_(j=0)^k Q_j(x_1,...,x_(m-1))*x_m^j with Q_k nonzero. Its total degree is at most d-k. The induction hypothesis bounds the event Q_k(X_1,...,X_(m-1))=0 by at most (d-k)/s, with the probability also bounded by 1. Outside that event, the remaining univariate polynomial in x_m is nonzero of degree k.

Conditional on those first coordinates, independence makes x_m uniform on S, so the remaining zero probability is at most k/s, capped at 1. A union bound gives at most (d-k)/s+k/s=d/s, and probability never exceeds 1. This proves the claim; a nonzero constant d=0 has zero failure probability directly. Repeating independent full assignments to the same fixed polynomial raises this upper bound to the number of trials.

The nonzero and total-degree hypotheses concern the formal polynomial over the actual field. Over F_q the nonzero polynomial x^q-x vanishes on every field element, but d/s=q/q=1 gives no assurance and no contradiction. Rounded evaluation, an unknown degree, correlated coordinates or choosing a new polynomial after seeing its test points changes the theorem's premises. For the total-degree polynomial identity bound, see [Lecture 10: Polynomial Identity Testing and Parallel Matchings](https://www.cs.cmu.edu/~avrim/Randalgs11/lectures/lect0209.pdf); the proof above uses distinct field sample elements and clips the bound at one, so large degree can make the guarantee uninformative.

36

Combining probability guarantees

Let E_i be events on which individual claimed numerical certificates are valid, with P(E_i complement)<=delta_i. For a finite collection, the indicator of any failure is at most the sum of the failure indicators. Taking expectations yields P(any failure)<=sum delta_i, without assuming independence.

Thus all certificates hold simultaneously with probability at least max(0,1-sum delta_i). A report with several probability-qualified claims needs a simultaneous guarantee when it relies on all of them together; presenting each individual confidence level unchanged as the level of their conjunction is generally incorrect.

If test i or the reported claim is chosen using earlier random results, a bound proved only for one preselected fixed claim may no longer apply. A sufficient adaptive contract is P(E_i complement | preceding information)<=delta_i for every permitted history, with fixed prospective delta_i. Taking expectations recovers each unconditional failure bound, and the same union bound then applies.

Repeated inspection or selection of favorable results can violate those conditional premises. A finite set of predeclared candidate claims can instead receive a simultaneous union bound, while an unrestricted data-chosen family requires further analysis. A probability budget is part of the scientific contract, not a quantity inferred afterward from how convincing the observed outcomes look. For individual concentration and randomized identity guarantees, see [Probability Inequalities for Sums of Bounded Random Variables](https://www.cs.rpi.edu/academics/courses/spring06/random/hoefding.pdf); [Lecture 10: Polynomial Identity Testing and Parallel Matchings](https://www.cs.cmu.edu/~avrim/Randalgs11/lectures/lect0209.pdf); their finite union requires no mutual independence, but adaptive use still needs each claimed conditional failure bound.

37

When finite exact tests become a proof

Suppose f and g are known univariate polynomials over a field of degree at most d. Their difference h=f-g has degree at most d unless it is zero. If they agree exactly at d+1 distinct field elements, h has d+1 roots; the root-factor argument forces h to be the zero polynomial. Hence these finitely many exact tests prove global polynomial equality under the degree hypothesis.

Similarly, for two genuinely linear maps on an n-dimensional vector space, exact agreement on a basis proves equality everywhere. Expanding any input in that basis reduces its output difference to the same linear combination of the zero basis differences. Neither argument extends to an unrestricted nonlinear function merely because its observed outputs look polynomial or linear.

The structural hypotheses must be established independently, for example from the exact construction of the formulas being compared. Tests of a few values cannot establish a degree bound or universal linearity. In a finite field there must actually be d+1 distinct test elements available for the polynomial argument to apply.

Approximate equality at the test points is also different from exact equality. An error bound can sometimes be propagated through an independently controlled interpolation operator or matrix condition estimate, but a rounded value displayed as zero is not an exact polynomial identity. State which finite tests are diagnostic and which become a proof through a proved structural theorem. For algebraic identity tests and finite coverage limitations, see [Lecture 10: Polynomial Identity Testing and Parallel Matchings](https://www.cs.cmu.edu/~avrim/Randalgs11/lectures/lect0209.pdf); [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); the degree and linearity restrictions make these exact finite tests complete and must not be inferred from the tested values themselves.

38

Model discrepancy and identifiability

Write a linear observation model as y=G*theta+delta+eta, where theta is a parameter vector, delta is model discrepancy and eta is measurement noise. The observed fitting residual r=y-G*thetahat mixes all three possible sources: r=G*(theta-thetahat)+delta+eta. A small residual by itself does not isolate the parameter error.

For any vector h, the pair theta'=theta+h and delta'=delta-G*h produces exactly the same observations with the same eta. Thus discrepancy in the range of G can be absorbed into a changed parameter. If G has a nonzero null vector h, even delta need not change: theta and theta+h are observationally indistinguishable under this model.

With additional assumptions a conditional bound is possible. If G has full column rank and its Euclidean left inverse G^+=(G transpose G)^(-1)*G transpose is controlled, then G*(thetahat-theta)=delta+eta-r implies ||thetahat-theta||_2<=||G^+||_2*(||delta+eta||_2+||r||_2). This requires an actual bound on combined discrepancy/noise and any errors in the data and operator.

An excellent numerical fit is therefore a statement about agreement with the specified observations. Predicting an unobserved physical situation needs justified modelling and data assumptions beyond that fit. Keep component units and weighting explicit, and report nonidentifiability or unquantified discrepancy instead of disguising it as numerical precision. For the distinction between code verification, model validation and reproducible evidence, see [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); [Reproducibility and Replicability in Science, Chapter 3: Understanding Reproducibility and Replicability](https://www.nationalacademies.org/read/25303/chapter/6); the linear discrepancy example demonstrates why an unknown model error cannot be estimated from numerical precision alone.

39

A scientific certificate with explicit limits

Suppose fixed valid domain and sensitivity assumptions imply a deterministic final numerical-error bound sum_i w_i*epsilon_i whenever events E_i all hold, with w_i>=0 and each propagated term expressed in the final output units. Suppose each E_i fails with probability at most delta_i. On their intersection the deterministic composition proof applies unchanged.

The union bound then gives P(final numerical error<=sum_i w_i*epsilon_i)>=max(0,1-sum_i delta_i). Independence is unnecessary for this combination, although it may have been essential inside an individual sampling theorem. Deterministic contributions can be included with failure probability zero when their arithmetic and domain qualifications are actually established.

A scientific certificate should identify its mathematical target, exact or enclosed inputs, norm and units, algorithm and arithmetic contract, derivation or applicable theorem, actual result and remaining limitations. A repeatable execution supports recovery of that evidence; a failed guard, unresolved interval or exhausted work allowance should be reported as the obtained state rather than as a passed accuracy claim.

This certificate bounds the stated numerical target. If reality differs from that target by a separately bounded model term M, add M in compatible units. If M is unquantified, no numerical probability calculation supplies it. Preserve that boundary so that precision, reproducibility, verification and validation remain useful complementary claims. For conditional numerical enclosures, bounded-sample guarantees and scientific reproducibility, see [Verification methods: Rigorous results using floating-point arithmetic](https://www.tuhh.de/ti3/rump/intlab/ActaNumerica2010.pdf); [Probability Inequalities for Sums of Bounded Random Variables](https://www.cs.rpi.edu/academics/courses/spring06/random/hoefding.pdf); [Reproducibility and Replicability in Science, Chapter 3: Understanding Reproducibility and Replicability](https://www.nationalacademies.org/read/25303/chapter/6); [Code Verification by the Method of Manufactured Solutions](https://www.osti.gov/servlets/purl/759450-wLI4Ux/); the combined conclusion retains every domain, arithmetic, units, sampling and model assumption used by its components.

Compare exact bounds, finite checks, and reproducibility claims. Each case shows what the recorded assumptions allow the calculation to certify.

A residual enclosure and a tolerance answer different questions

Absolute tolerance at zero

Pass for the residual tolerance aloneAbsolute tolerance at zero; The residual magnitude lies in [0, 1/16] and the tolerance is 1/8. Model discrepancy has its own budget 1/64.Pass for the residual tolerance aloneResidual lower bound0Tolerance1/8Residual upper bound1/16-0.0150.14Magnitude in the declared residual units
The residual magnitude lies in [0, 1/16] and the tolerance is 1/8. Model discrepancy has its own budget 1/64.

The reverse triangle inequality gives the lower bound and the triangle inequality gives the upper bound for the true residual magnitude. Pass requires the upper bound to meet tolerance. Fail requires the entire enclosure to exceed it. A straddling interval leaves the question unresolved. At reference zero the absolute term remains meaningful.

Exact decision ingredients
QuantityExact result
Reference magnitude0
Absolute + relative contribution1/8 + 0
Observed absolute residual1/32
Measurement enclosure radius1/32
Certified residual interval[0, 1/16]
Tolerance1/8
DecisionPass
Independent model discrepancy budget1/64
Exact inputs and supporting calculations
Declared inputs
ParameterValue
ref0
absolute1/8
relative1/16
observed1/32
measurement1/32
model1/64

A small residual needs a certified inverse bound

A certified inverse margin

The inverse certificate bounds the actual errorA certified inverse margin; The tested contraction factor is 1/3. Since it is below one, the Neumann argument applies.The inverse certificate bounds the actual errorActual error1/4Scaled residual1/3Certified error bound1/2-0.060.56Infinity norm for error and scaled residual
The tested contraction factor is 1/3. Since it is below one, the Neumann argument applies.

From e=(I−MA)e+Mr, take infinity norms and rearrange only when 1−q>0. If q<1, the Neumann series also proves MA invertible, hence A invertible for this square case. When the criterion is inconclusive, a separate determinant calculation answers invertibility without repairing that bound.

Exact matrix certificate
QuantityExact result
Error x*−x̂(1/4, 1/4)
Residual r=A(x*−x̂)(5/4, 1)
Preconditioned residual Mr(5/16, 1/3)
E=I−MA[[0,−1/4],[−1/3,0]]
Absolute row sums of E(1/4, 1/3)
||I−MA||∞1/3
||x*−x̂||∞1/4
Certified forward bound1/2
det A11
InvertibilityInvertible
Exact inputs and supporting calculations
Declared inputs
ParameterValue
a4
u1
v1
b3
xStar[1,2]
xHat["3/4","7/4"]

Equivalent formulas can enclose very different ranges

The unit interval

A shared variable narrows the true rangeThe unit interval; The natural interval product is [0, 1]. The completed-square range [0, 1/4] is attained by the original function on [a,b].A shared variable narrows the true range-0.6501.74-0.141.14Natural interval enclosureCompleted-square exact range0101/4Closed enclosure endpointsShared physical scale for both range enclosures
The natural interval product is [0, 1]. The completed-square range [0, 1/4] is attained by the original function on [a,b].

Treating x and 1−x as independent interval factors allows combinations that cannot occur for the same x. The completed square is algebraically identical and the interval square has exact extrema at a far endpoint and either zero or the near endpoint. Continuity gives every intermediate value.

Exact interval ranges
QuantityExact result
Input x[0, 1]
Independent range for 1−x[0, 1]
Natural product enclosure[0, 1]
Shifted range x−1/2[−1/2, 1/2]
Does the squared input cross zero?Yes, including its boundary
Exact square of shifted interval[0, 1/4]
Exact attained range[0, 1/4]
Lower and upper endpoint excesses(0, 3/4)
Total excess of enclosure width3/4
Exact inputs and supporting calculations
Declared inputs
ParameterValue
left0
right1

A central difference has an exact remainder for a cubic

A positive cubic remainder

The signed central-difference errors are exact hereA positive cubic remainder; The exact directional derivative is 1. The halved-step error is 1/16. The signed ratio is four.The signed central-difference errors are exact hereAt h1/4At h/21/16-0.030.28Computed derivative minus exact derivative
The exact directional derivative is 1. The halved-step error is 1/16. The signed ratio is four.

On this fixed line the cubic coefficient of φ(t)=F(x+tu,y+tv) is u³. Central differencing cancels the even terms, leaving φ′(0)+u³h² in exact arithmetic. Passing a few directional checks does not establish the full derivative on other directions or inputs.

Exact directional check
QuantityExact result
Input direction(1, −1)
Exact DF·(u,v)1
Steps h and h/2(1/2, 1/4)
Central quotients(5/4, 17/16)
Signed errors(1/4, 1/16)
Signed coarse/fine error ratio4
Exact inputs and supporting calculations
Declared inputs
ParameterValue
k2
x1
y2
u1
v-1
h1/2

A Richardson step removes one power, not all error

A nonzero leading coefficient

Removing one power can leave a signed remainderA nonzero leading coefficient; The raw signed differences are (111/256, 399/4096). The nominal exponent is 2 and the extrapolated error is −1/64.Removing one power can leave a signed remainderQ(h)9/16Q(h/2)33/256Q(h/4)129/4096Extrapolated estimate−1/64-0.0850.6319Exact estimate minus target
The raw signed differences are (111/256, 399/4096). The nominal exponent is 2 and the extrapolated error is −1/64.

The nominal formula (2^p Q(h/2)−Q(h))/(2^p−1) exactly cancels c h^p and leaves a known multiple of d h^(p+2). A finite difference ratio can reflect cancellation or a vanishing leading term, so it is not a certificate of the nominal order. The extrapolation uses the nominal p independently of the observed ratio. Its signed fine-error estimate can have the wrong sign, as the case with cancelling raw errors shows.

Exact extrapolation readouts
QuantityExact result
Raw estimates(25/16, 289/256, 4225/4096)
Raw signed errors(9/16, 33/256, 129/4096)
Consecutive differences(111/256, 399/4096)
Signed difference ratio592/133
Magnitude of difference ratio592/133
Nominal p / leading coefficient c2 / 2
Actual leading nonzero power2
Signed fine-error estimate (Q(h)−Q(h/2))/(2^p−1)37/256
Exact signed fine error Q(h/2)−q33/256
Extrapolated estimate63/64
Extrapolated signed error−1/64
Exact inputs and supporting calculations
Declared inputs
ParameterValue
q1
c2
d1
p2
h1/2

Verification succeeds on a kernel of exact test vectors

Rank one over GF(2)

The false-acceptance set is an exact finite kernelRank one over GF(2); The blue and orange marks show two discrete point sets. Each of the 4 vectors has equal selection probability; exactly 2 pass a false identity.The false-acceptance set is an exact finite kernel-0.401.55-0.41.45Kernel vectors (test accepts)Nonkernel vectors (test rejects)First coordinate horizontally · second vertically, in GF(2)
The blue and orange marks show two discrete point sets. Each of the 4 vectors has equal selection probability; exactly 2 pass a false identity.

With A=B=I and C=I−D, the test accepts when Dr=0. Rank–nullity gives p^(2−rank D) accepted equally likely inputs out of p². Multiplication of probabilities uses independently uniform vectors in the full field. A different choice of test distribution needs its own bound.

Exact rank and probability
QuantityExact result
Difference matrix D[[1,1],[0,0]]
Determinant modulo p0
Rank1
Accepted vectors(0, 0), (1, 1)
Single-trial false acceptance1/2
Independent trials3
False acceptance in every trial1/8
If D=0Every vector accepts; the identity is true.
Exact inputs and supporting calculations
Declared inputs
ParameterValue
p2
D[[1,1],[0,0]]
trials3

Worked examples

An absolute tolerance protects a small component

For reference values (1000,1/1000), errors (1/5,1/50000), absolute tolerances (1/100,1/100000) and relative tolerance 1/1000, compute the two mixed-error ratios and the maximum norm. Explain consistent unit rescaling and the pass/fail conclusion.

  1. The first scale is 1/100+(1/1000)*1000=101/100. The second is 1/100000+(1/1000)*(1/1000)=11/1000000. Absolute scales have the component's units, and the relative factor is dimensionless.
  2. Divide each absolute error by its own scale. The first gives (1/5)/(101/100)=20/101<1. The second gives (1/50000)/(11/1000000)=20/11>1. A small absolute error in the second component can still exceed that component's much smaller allowance.
  3. The maximum scaled error is 20/11, so a maximum-norm or every-component requirement fails. Averaging the unscaled errors would obscure the intended scientific scales and would not evaluate this requirement.
  4. If component i changes units by a nonzero factor c_i, multiply its reference, estimate and absolute tolerance by the corresponding signed or absolute factor as appropriate. Its numerator and scale both acquire |c_i|, preserving the ratio. Changing only one side would change the problem's tolerance contract.

The mixed scales are 101/100 and 11/1000000. The ratios are 20/101 and 20/11, so the maximum is 20/11>1 and the componentwise tolerance fails.

A norm certificate and a sharper box

Let A=[[2,1],[1,3]], B=diag(1/2,1/3), b=(3,5) and xhat=(1,1). Derive E=I-BA, its infinity-norm contraction, the residual, the norm certificate and the exact solution error. Verify that v=(1/5,2/5) is a componentwise supersolution and explain why convergence of the comparison series is available.

  1. Multiplication gives B*A=[[1,1/2],[1/3,1]], so E=I-B*A has zero diagonal and off-diagonal entries -1/2 and -1/3. Its induced infinity norm is the largest absolute row sum, q=1/2<1. Hence the Neumann inverse argument applies and A is nonsingular.
  2. A*xhat=(3,4), so r=b-A*xhat=(0,1) and B*r=(0,1/3). Therefore ||x-xhat||_infinity<=||B*r||_infinity/(1-q)=(1/3)/(1/2)=2/3. Every value here is exact rational arithmetic, so no unrecorded residual-evaluation error has been omitted.
  3. For M=|E| and c=|B*r|, M*(1,1)=(1/2,1/3)<=(1/2)*(1,1). This positive weight proves convergence of the comparison series. For v=(1/5,2/5), M*v+c=(1/5,1/15+1/3)=(1/5,2/5)=v. Thus the componentwise certificate gives |x-xhat|<=v, despite the fact that v itself is not a strict contraction weight.
  4. Solving 2*x_1+x_2=3 and x_1+3*x_2=5 gives x=(4/5,7/5). Its correction from xhat is (-1/5,2/5), attaining both componentwise magnitude bounds. The actual infinity error is 2/5, smaller than the norm-only bound 2/3. This comparison concerns the stated linear system, not a physical model behind it.

E=[[0,-1/2],[-1/3,0]], q=1/2, r=(0,1), and the norm bound is 2/3. The exact solution is (4/5,7/5), so the error correction is (-1/5,2/5), enclosed sharply in magnitude by v=(1/5,2/5).

The same variable in an interval expression

For x in [1,2], enclose x^2-2x+1 by direct interval evaluation and by the equivalent expression (x-1)^2. Find the true range and explain both the inclusion guarantee and the dependency overestimate.

  1. For x in [1,2], the square lies in [1,4] and twice x lies in [2,4]. Direct interval subtraction and addition give [1,4]-[2,4]+[1,1]=[-2,3]. This allows extrema from different hypothetical x values to combine.
  2. The identity x^2-2*x+1=(x-1)^2 holds for the same real x throughout the interval. Now x-1 lies in [0,1], whose square has the exact interval [0,1]. The reformulation retains the relevant dependence.
  3. Every number in [0,1] is attained by the square of some z in [0,1], using z=sqrt(y), so [0,1] is the true range rather than only an upper enclosure. In particular the original expression never becomes negative on this interval.
  4. The broad enclosure [-2,3] remains logically valid because it contains [0,1]. Its negative lower endpoint is an overestimate of uncertainty, not evidence of a negative function value. In machine interval arithmetic each endpoint operation additionally needs the stated outward-rounding contract.

Direct interval evaluation gives [-2,3]; the reformulation gives [0,1], which is the true range.

Certifying the positive square root of two

For f(x)=x^2-2 on X=[7/5,3/2], use m=29/20 and c=10/29. Compute the derivative-factor interval 1-c*f'(X), the preconditioned center m-c*f(m), the full interval image K=m-c*f(m)+(1-c*f'(X))*(X-m), and a contraction root certificate.

  1. At m=29/20, f(m)=841/400-2=41/400. Thus c*f(m)=(10/29)*(41/400)=41/1160 and m-c*f(m)=1682/1160-41/1160=1641/1160.
  2. The derivative interval is f'(X)=2*X=[14/5,3]. Consequently 1-c*f'(X)=1-[28/29,30/29]=[-1/29,1/29], so the derivative of T(x)=x-c*f(x) has magnitude at most q=1/29<1 on X.
  3. Subtracting the center gives X-m=[-1/20,1/20]. Its interval product with the derivative factor is [-1/580,1/580]. Adding the preconditioned center yields K=[1639/1160,1643/1160]. The original X has endpoints 1624/1160 and 1740/1160, so K is strictly inside it.
  4. The enclosed image makes T a self-map of X and the derivative bound makes it a contraction. Since c is nonzero, its unique fixed point is a unique zero of x^2-2 in X, namely the positive root sqrt(2). That root is also in K, with distance at most 1/580 from 1641/1160. No rounded sign or approximate derivative has been used as an exact certificate.

The derivative factor is [-1/29,1/29], the preconditioned center is 1641/1160, and K=[1639/1160,1643/1160] is inside X. A contraction factor 1/29 certifies the unique root sqrt(2) in X and in K.

A continuous residual bounds a trajectory

For y'=y, y(0)=1, compare u(t)=1+t with the exact trajectory on [0,1]. Derive the signed differential defect, the generic uniform-defect error bound and the sharper bound obtained by integrating its actual time-dependent magnitude. Evaluate the endpoint error symbolically.

  1. The approximation has derivative u'=1, so d=u'-u=1-(1+t)=-t. It agrees exactly with the initial condition. The right-hand side F(t,y)=y is globally Lipschitz in y with L=1, and the exact solution is exp(t).
  2. On the whole interval [0,1], |d(t)|<=1. The constant-defect formula therefore gives |y(t)-u(t)|<=exp(t)-1, using zero initial error. At t=1 this is e-1.
  3. Retaining D(s)=s instead of its maximum gives integral_0^t exp(t-s)*s ds. Integration by parts gives exp(t)-1-t. This quantity is nonnegative for t>=0, since the exponential lies above its tangent 1+t.
  4. In fact y(t)-u(t)=exp(t)-1-t, so the sharper defect certificate is attained here. The endpoint error is e-2, not zero even though the initial value is exact. The certificate uses a defect bound over the full continuous interval; checks only at isolated time nodes would not establish it.

The defect is d(t)=-t. The uniform-defect bound is exp(t)-1 on [0,1], while the time-dependent bound is exp(t)-1-t and equals the actual error. The endpoint error is e-2.

A complex-step check with a controlled error

For f(z)=z^3 at real x=2, derive Im(f(2+i*h))/h exactly. At h=1/100, bound its error relative to f'(2) when the complex evaluation has absolute error at most 10^(-12). Explain why the same argument fails for complex conjugation.

  1. Expand (2+i*h)^3=8+12*i*h-6*h^2-i*h^3. Its imaginary part divided by h is 12-h^2, whereas the real derivative f'(2)=3*2^2=12. The exact truncation error has magnitude h^2.
  2. At h=1/100 the quotient is 12-1/10000=119999/10000. Since f'''=6 everywhere, the analytic Taylor certificate M*h^2/6=h^2 is exact for this polynomial.
  3. A complex evaluation error of modulus at most 10^(-12) gives imaginary-part error at most 10^(-12). Dividing by h=1/100 amplifies it to at most 10^(-10), yielding a total error bound 10^(-4)+10^(-10). Any represented-input or final-division error not already included in that contract would need an additional enclosure.
  4. For g(z)=conjugate(z), g(x)=x on the real axis has derivative 1 there, but g(x+i*h)=x-i*h gives imaginary quotient -1. Conjugation is not holomorphic, so the complex Taylor reasoning does not apply. Avoiding real subtraction is useful only when the function implementation preserves the analytic extension.

The exact complex-step quotient is 12-h^2. At h=1/100 it is 119999/10000 and its derivative error is at most 10^(-4)+10^(-10) under the stated evaluation enclosure. Conjugation gives -1 rather than the real-axis derivative 1.

The derivative of a finite fixed-point iteration

For y_(n+1)=(3/4)*y_n+theta and y_0=0, differentiate exactly four executed steps and compare with the converged fixed-point derivative. At theta=2, find the fourth iterate, the fixed point and their primal and derivative errors.

  1. Differentiate the exact recurrence with a fixed step count: v_(n+1)=(3/4)*v_n+1, v_0=0. Hence v_4=1+3/4+9/16+27/64=175/64. The primal iterate is theta times the same geometric sum, so y_4=(175/64)*theta.
  2. The converged fixed point solves y*=(3/4)*y*+theta, giving y*=4*theta and derivative 4. Their derivative difference is 4-175/64=81/64, agreeing with (3/4)^4/(1-3/4).
  3. At theta=2, the finite iterate is 175/32, while y*=8=256/32. Its primal error magnitude is 81/32. Correct differentiation of the four steps therefore does not produce the derivative of the infinite limit.
  4. These are exact identities for a fixed executed N=4. If a program stops at a data-dependent iteration count, differentiating the realized branch needs a separate interpretation at stopping boundaries. Numerical convergence of one value does not by itself establish a sensitivity tolerance.

After four steps y_4=(175/64)*theta and its derivative is 175/64. The fixed-point derivative is 4. At theta=2, y_4=175/32 and y*=8; the primal and derivative error magnitudes are 81/32 and 81/64.

A manufactured equation with zero solve residual

For -u''=12*x^2-6*x on [0,1] with zero Dirichlet boundaries, use manufactured u=x^3*(1-x). Derive the exact central-difference grid solution for h=1/4, its algebraic residual and its maximum nodal error. Separate equation verification from validation of a physical model.

  1. The manufactured solution u=x^3-x^4 has u''=6*x-12*x^2 and u''''=-24, so -u''=12*x^2-6*x with zero endpoint values. The three sampled exact values at x=1/4,1/2,3/4 are (3/256,16/256,27/256).
  2. For this quartic A_h*u_grid=f_grid+2*h^2*1 exactly. Since the sampled barrier x*(1-x)/2 satisfies A_h*w=1, the discrete solution is U=u_grid-h^2*x_grid*(1-x_grid). Its corrections at the three nodes are (-3/256,-4/256,-3/256), yielding U=(0,12/256,24/256)=(0,3/64,3/32).
  3. The forcing vector is (-3/4,0,9/4). Multiplication by A_h=16*tridiag(-1,2,-1) gives this vector exactly: the first row is -3/4, the middle row is zero and the last row is 9/4. Thus r=f_grid-A_h*U=0.
  4. The nodal error U-u_grid is (-3/256,-1/64,-3/256), with infinity norm 1/64=h^2/4. A zero solve residual has removed algebraic error for this discrete equation, not the mesh error relative to u. This manufactured calculation verifies a mathematical discretization behavior; no physical model or between-node approximation has thereby been validated.

For h=1/4 the exact discrete interior vector is U=(0,3/64,3/32). Its algebraic residual is zero, while the maximum nodal error is 1/64.

A finite refinement ratio is not the limit

For U_h=2+3*h^2-h^4 at h=1/2,1/4,1/8, find the successive differences and observed-order ratio. Compare the Richardson estimate of the h=1/4 error with the true fine error, and verify a remainder-based bound using |R_h|<=h^4.

  1. Substitution into U_h=2+3*h^2-h^4 gives U_(1/2)=43/16, U_(1/4)=559/256 and U_(1/8)=8383/4096. The first difference is 129/256 and the second is 561/4096.
  2. The ratio is (129/256)/(561/4096)=688/187, strictly between 2 and 4. Thus the finite observed order lies between 1 and 2. The known symbolic expansion has asymptotic order two, but this finite ratio has not reached its limiting value 4.
  3. For the h=1/4 fine-grid result, second-order Richardson estimates its signed error by (129/256)/(4-1)=43/256. The actual signed error is 559/256-2=47/256, so the estimate underestimates it by 1/64. The extrapolated value is 129/64, still 1/64 above the target 2.
  4. Here the stated remainder is R_h=-h^4, so K=1, p=2, q=2, r=2 are justified exactly. At coarse h=1/2 the certificate is h^4*(1+r^(-q))/(r^p-1)=5/192. The actual discrepancy 1/64=3/192 is within it. This finite remainder evidence, rather than the observed ratio alone, justifies the enclosure.

The values are 43/16,559/256,8383/4096. Their difference ratio is 688/187, giving observed order log(688/187)/log(2). The fine-error estimate is 43/256 versus true error 47/256, with discrepancy 1/64<=5/192.

Two floating-point meanings of the same expression

Use normalized binary arithmetic with precision three, round-to-nearest ties-to-even, and an exponent range large enough for every value. Evaluate (8+1)-8 and 8+(1-8). Then compare separately rounded (5/4)*(5/4)-3/2 with a fused multiply-add, and identify each exact target.

  1. In precision-three binary arithmetic the neighbors of 9 are 8 and 10. It is a tie, and the significand of 8 is even, so fl(8+1)=8. The next subtraction is exact, giving fl(fl(8+1)-8)=0. The exact three-input sum is 1.
  2. In the other tree, 1-8=-7 is exactly representable and adding 8 gives the exactly representable 1. Thus fl(8+fl(1-8))=1. Fixed inputs and rounding do not remove dependence on the operation tree.
  3. For the multiply-add, (5/4)*(5/4)=25/16. Its nearest precision-three value is 3/2, so separately rounding the product and then subtracting 3/2 gives 0. There is no nonzero residual left for the last subtraction to recover.
  4. The exact product-plus-sum is 25/16-3/2=1/16. A fused multiply-add rounds only this final exact quantity and returns it exactly with the assumed exponent range. The two contracts therefore differ in both bits and accuracy here; deterministic replay of either contract establishes only its repeatability.

The two rounded sums are 0 and 1, although their common exact target is 1. Separate multiply-add returns 0; the fused result is 1/16, its exact target.

A finite-field false-acceptance probability

Over F_5 let A=[[1,2],[0,1]], B=[[2,0],[1,3]] and C=[[4,2],[1,3]]. Find AB-C, characterize all vectors missed by a Freivalds trial, compute the one- and three-trial false-acceptance probabilities, and work through the trial vector (2,3).

  1. Compute AB over F_5: the integer product [[4,6],[1,3]] reduces to [[4,1],[1,3]]. Subtracting C gives D=[[0,-1],[0,0]]=[[0,4],[0,0]] in this field.
  2. For v=(v_1,v_2), D*v=(4*v_2,0). Since 4 is invertible in F_5, the vector is zero exactly when v_2=0. Five of the twenty-five possible vectors meet that condition, giving one-trial false acceptance 1/5. Fresh independent vectors make the three-trial probability (1/5)^3=1/125.
  3. For v=(2,3), B*v=(4,11)=(4,1) modulo 5. Then A*(B*v)=(6,1)=(1,1). On the other side C*v=(14,11)=(4,1), so the difference is (2,0), nonzero.
  4. This vector is an exact witness that the proposed field product is wrong. The probability calculation concerns undetected error for a fixed wrong product under uniform fresh vectors; it is not a posterior confidence in an accepted real matrix multiplication.

AB-C=[[0,4],[0,0]] over F_5. A trial misses exactly when v_2=0, with probability 1/5; three independent trials miss with probability 1/125. Vector (2,3) detects the discrepancy.

A prospective bounded-sample guarantee

For independent Bernoulli observations with unknown mean theta, derive a sample size sufficient to make the probability of absolute sample-mean error exceeding 1/20 at most 1/100. State the exact ceiling formula, its integer value, and why an empirical sample variance or repeated identical pseudorandom samples does not supply this guarantee.

  1. Each observation lies in [0,1], so L=1 and its mean is theta. For epsilon=1/20, Hoeffding's bound is P(|Xbar-theta|>=1/20)<=2*exp(-N/200), under independent observations and an exact or separately enclosed sample mean.
  2. To make that upper bound at most 1/100, require exp(-N/200)<=1/200, equivalently N>=200*log(200). Therefore take N=ceil(200*log(200))=1060, using log(200) approximately 5.29831737. The ceiling rounds a prospective bound upward, not a favorable observed outcome.
  3. The actual Bernoulli error probability may be much smaller, and depends on theta and the discrete possible sample means. The formula gives a uniform sufficient guarantee for every theta in [0,1]; it does not prove 1060 is the smallest size under the true probability.
  4. An empirical variance is not automatically an upper confidence bound on the population variance or an alternative proof of this theorem. Repeating one observation 1060 times produces a perfectly dependent sample whose mean is still that one observation. Identically replaying a pseudorandom realization is a repeatability check, not 1060 new independent observations.

A sufficient prospective size is N=ceil(200*log(200))=1060 independent Bernoulli observations. This is a sufficient Hoeffding-bound size, not a claim of the least possible true-probability sample size.

Try it yourself

  1. For the reference-scaled comparison |a-b|<=r*|b| with r=1/10, compare (a,b)=(10,9) with its reverse. Separately show nontransitivity of the absolute-tolerance relation |a-b|<=1 using 0,3/4,3/2. Explain zero reference scales.

    Show the answer and reasoning

    The reference-scaled test fails for (10,9) and passes for (9,10). The absolute-tolerance relation passes 0 with 3/4 and 3/4 with 3/2 but fails 0 with 3/2; it is not transitive.

    For (a,b)=(10,9), |a-b|=1 but r*|b|=9/10, so the inequality fails. Reversing the roles gives (a,b)=(9,10), the same difference 1 and allowance 1, so it passes. A tolerance defined from one designated reference is an asymmetric predicate. With absolute tolerance 1, the differences between 0 and 3/4 and between 3/4 and 3/2 are each 3/4, so both comparisons pass. The difference between 0 and 3/2 is 3/2>1, so the endpoint comparison fails. Consequently approximate agreement under these tolerances cannot be treated as an equivalence relation for chaining identities or grouping data. The mathematical reason is that the triangle inequality can add two separate allowances rather than preserving one. For a purely relative comparison with reference b=0, the allowance is zero and only a=0 passes. Do not form the undefined ratio 0/0 to implement that case. A positive absolute tolerance supplies a nonzero scale near zero when the scientific requirement permits it.

  2. Let A=diag(2,1/4), b=(2,1/2) and xhat=(1,3). A displayed residual is (0,-6/25), with a certified infinity-norm evaluation error at most 1/100. Derive a rigorous solution-error bound and compare with the exact error.

    Show the answer and reasoning

    The rigorous infinity-norm solution-error bound is 1 and is attained. The exact solution is (1,2), so x-xhat=(0,-1).

    The inverse matrix is diag(1/2,4), whose induced infinity norm is K=4. The evaluated residual has infinity norm 6/25, and its error enclosure is 1/100, so the exact residual norm is at most 6/25+1/100=1/4. The residual certificate gives ||x-xhat||_infinity<=4*(1/4)=1. The extra evaluation-error term is essential: using only the displayed residual would give 24/25, an unjustified bound that is too small for this example. Direct solution of the diagonal system gives x=(1,2). For xhat=(1,3), the true residual b-A*xhat is (0,-1/4), exactly 1/100 away from the displayed residual (0,-6/25) in infinity norm. The exact correction is (0,-1) and its norm is 1, attaining the certified upper bound. All calculations use the exact rational data and the stated absolute norm; a relative claim would need its own explicitly nonzero reference scale.

  3. Let A=[[1,1],[0,1]], B=[[1,-1],[0,1]], and the exact residual r=(1/50,-1/100). Derive the approximate-inverse certificate and the exact error correction. Explain why the failure of the strict test for B=0 does not show A singular.

    Show the answer and reasoning

    E=0 and B*r=(3/100,-1/100), so the exact correction has infinity norm 3/100. Choosing B=0 fails the strict test but does not make A singular.

    Multiply B*A=[[1,-1],[0,1]]*[[1,1],[0,1]]=I. Therefore E=I-B*A=0 and q=0. This is the special case where the approximate inverse is an exact inverse. The correction is e=B*r=(1/50+1/100,-1/100)=(3/100,-1/100). The bound ||e||_infinity<=||B*r||_infinity/(1-q)=3/100 is exact. If B is replaced by the zero matrix, E=I and its induced norm is 1. The sufficient strict inequality q<1 is then unavailable, and the inverse-certificate argument makes no conclusion. Nevertheless the original A has determinant 1 and the displayed nonzero B is its inverse. This separates failure of a chosen certificate or preconditioner from failure of the underlying mathematical problem.

  4. For x in [-1,1], compare the tight square interval with the interval obtained by multiplying two independent copies of [-1,1]. Explain why division by x has no finite enclosing real interval over this domain.

    Show the answer and reasoning

    The tight square range is [0,1], while independent interval multiplication gives [-1,1]. The reciprocal is undefined at zero and unbounded near it, so there is no finite enclosing real interval over the stated domain.

    For one real x in [-1,1], x^2 is nonnegative, reaches zero at x=0 and reaches one at x=±1. Every intermediate value is attained, so its exact range is [0,1]. Generic interval multiplication treats its two arguments as independent. The four endpoint products for [-1,1]*[-1,1] are 1,-1,-1,1, yielding [-1,1]. The negative values arise from choosing opposite signs for what were originally the same variable. The generic product still encloses the true square range and is therefore inclusion-correct, although weaker. A square operation can exploit the same-variable structure without violating that inclusion requirement. At x=0 the reciprocal 1/x is undefined. Even after excluding zero, points approaching it from the positive or negative side have reciprocals of arbitrarily large magnitude. A finite real interval cannot cover all those values; a valid computation must retain the domain issue or use an appropriate unbounded/disjoint representation.

  5. Apply two exact bisection steps to f(x)=x^3-2 starting from [1,3/2]. Give each midpoint, its exact sign, the final interval, midpoint and radius, and state every hypothesis needed for the root certificate.

    Show the answer and reasoning

    The successive brackets are [5/4,3/2] and [5/4,11/8]. The final midpoint is 21/16 with radius 1/16, enclosing the unique real cube root of two.

    The initial endpoint values are f(1)=-1 and f(3/2)=27/8-2=11/8>0. The first midpoint is 5/4, where f(5/4)=125/64-2=-3/64<0. The retained sign bracket is therefore [5/4,3/2]. The next midpoint is 11/8. Its value is 1331/512-2=307/512>0, so the next bracket is [5/4,11/8]. These sign decisions are exact rational calculations. The final width is 11/8-5/4=1/8. Its midpoint is 21/16 and its radius is 1/16, so the root in the bracket has distance at most 1/16 from that midpoint. Continuity of x^3-2 on the bracket, valid endpoint/midpoint signs and actual nested intervals justify existence and the enclosure. Strict increase, for example f'(x)=3*x^2>0 throughout this positive bracket, justifies uniqueness there. Rounded sign decisions or a stagnated midpoint would require their own enclosures rather than being credited as exact halvings.

  6. For F(x,y)=(2*x+y-3,x+3*y-5), the box X=[1/2,3/2]^2, center (1,1) and C=diag(1/2,1/3), compute a multivariable preconditioned interval image and contraction factor. Prove existence and uniqueness in X and compare with the exact root.

    Show the answer and reasoning

    The interval image is [3/4,5/4] by [7/6,3/2], contained in X, with infinity-norm contraction factor 1/2. The unique root is (4/5,7/5).

    The Jacobian is the constant A=[[2,1],[1,3]], and F(1,1)=(0,-1). Thus x0-C*F(x0)=(1,4/3). The preconditioned derivative is I-C*A=[[0,-1/2],[-1/3,0]]. Since X-x0=[-1/2,1/2]^2, its interval image under this derivative is [-1/4,1/4] by [-1/6,1/6]. Adding the preconditioned center gives K=[3/4,5/4] by [7/6,3/2], wholly contained in X=[1/2,3/2]^2. The induced infinity norm of the derivative is 1/2<1. The map T(z)=z-C*F(z) is therefore a contraction self-map of the closed box. The nonsingular diagonal C ensures that its unique fixed point is a root of F. Touching the upper box boundary in one interval component does not invalidate this closed-set contraction argument. Solving the two equations gives (x,y)=(4/5,7/5), which belongs to K and X. The argument establishes existence and uniqueness inside X with exact rational bounds. It makes no claim based solely on a floating-point solver status.

  7. For u(t)=1/(1-t), evaluate its differential defect for y'=y^2, y(0)=1 on [0,1/2]. Explain why a zero defect there cannot certify a finite continuation through t=1.

    Show the answer and reasoning

    The differential defect is identically zero on [0,1/2], where u is an exact solution. It diverges as t approaches 1 from below, so there is no finite classical continuation through t=1 of this initial-value solution.

    Differentiate u(t)=(1-t)^(-1): u'(t)=(1-t)^(-2)=u(t)^2. Therefore d(t)=u'(t)-u(t)^2=0, and u(0)=1 exactly. On [0,1/2], the trajectory lies in [1,2]. The right-hand side y^2 is continuously differentiable there and has Lipschitz constant at most 4 on this state interval. The explicit u is an existing solution, and local uniqueness or the zero-defect comparison identifies the initial-value solution on the stated interval. As t tends to 1 from below, u(t) tends to positive infinity. A finite-valued classical solution continued through t=1 would have to be continuous there and agree with this solution before 1 by uniqueness, which is impossible. A zero defect certifies the differential equation where the approximate trajectory and the hypotheses are defined. It does not prove global existence, provide a finite Lipschitz bound on an unbounded state range or authorize a claim beyond a blow-up time.

  8. For f(x)=x^2 at x=3 in direction v=2, derive the forward-difference derivative and a certified comparison tolerance when each function evaluation has absolute error at most epsilon. At h=1/1000 compare an alleged directional derivative 13. Explain what a test in one direction cannot establish about a multivariable Jacobian.

    Show the answer and reasoning

    The true directional derivative is 12, and the exact forward quotient is 12+4*h. Its comparison bound is 4*h+2*epsilon/h, excluding any separately unbounded final arithmetic. At h=1/1000, the exact quotient is 12.004 and rejects 13.

    With direction v=2, the exact forward quotient is [(3+2*h)^2-9]/h=12+4*h, while f'(3)*v=6*2=12. The second derivative is 2, so the Taylor bound M*h*|v|^2/2=4*h is attained. Two function-evaluation errors of magnitude at most epsilon perturb the quotient by at most 2*epsilon/h. Thus B=4*h+2*epsilon/h bounds the evaluated quotient's distance from the true directional derivative, assuming the subtraction/division is exact or its error is added. At h=1/1000 this is 1/250+2000*epsilon. The exact quotient is 3001/250=12.004, whose discrepancy from 13 is 249/250. With exact evaluations it exceeds the allowed 1/250 and rejects 13. For an actual uncertain evaluated quotient q, use the observed test |q-13|>B. Indeed every evaluation satisfying the enclosure must reject if 249/250-2000*epsilon>1/250+2000*epsilon, equivalently epsilon<31/125000. This tests one directional derivative. In two dimensions, a Jacobian error row (0,1) vanishes on direction (1,0) yet is nonzero on (0,1). Passing one direction therefore does not certify every Jacobian entry or every multivariable sensitivity.

  9. For A=[[1,2],[0,1]] and B=A transpose+[[0,0],[0,1]], exhibit one standard-basis dot-product test that passes and one that fails. Explain why (2*A,2*A transpose) passes all adjoint-consistency tests while remaining wrong for target A.

    Show the answer and reasoning

    The pair x=e_1,y=e_1 passes; x=e_2,y=e_2 fails with absolute discrepancy 1. The pair (2*A,2*A transpose) is adjoint-consistent but implements a wrong forward target.

    The transpose is A transpose=[[1,0],[2,1]], so the proposed B=[[1,0],[2,2]]. For x=e_1,y=e_1, <A*e_1,e_1>=1 and <e_1,B*e_1>=1. This particular test passes despite the error in B. For x=e_2,y=e_2, A*e_2=(2,1), so the left side is 1. But B*e_2=(0,2), so the right side is 2. The signed discrepancy is -1 and its magnitude is 1. All four standard-basis pairs would determine the complete 2 by 2 adjoint relation in exact arithmetic, whereas one pair constrains only one matrix entry. Rounded dot products need error allowances before a numerical discrepancy is interpreted as a mathematical failure. For a different forward implementation H=2*A, its exact adjoint is H transpose=2*A transpose, so every adjoint identity passes. H differs from the intended nonzero A. Adjoint consistency verifies a relationship between two implementations and needs independent target evidence to establish their common correctness.

  10. Manufacture u(x)=sin(pi*x) for -u''=pi^2*sin(pi*x) with zero endpoint values. For a uniform Dirichlet central-difference grid derive the exact discrete solution in terms of lambda_h=4*sin^2(pi*h/2)/h^2, the sign of its error and its leading second-order relative amplitude error as h tends to zero.

    Show the answer and reasoning

    The exact grid solution is U=(pi^2/lambda_h)*u_grid. Its interior error is positive, and its relative amplitude error is pi^2*h^2/12+O(h^4).

    Let h=1/N with N>=2 and u_i=sin(pi*i*h) for interior i. The sine addition identity gives u_(i+1)+u_(i-1)=2*cos(pi*h)*u_i. Thus A_h*u_grid=[2-2*cos(pi*h)]*u_grid/h^2=lambda_h*u_grid, where lambda_h=4*sin^2(pi*h/2)/h^2. The forcing vector is pi^2*u_grid. Since the Dirichlet central-difference matrix is nonsingular, its unique exact solution is U=(pi^2/lambda_h)*u_grid. Its algebraic residual is zero, but U-u_grid=(pi^2/lambda_h-1)*u_grid. For z=pi*h/2 in (0,pi/2), 0<sin(z)<z implies 0<lambda_h<pi^2. All interior sine values are positive, so every interior error is positive. The relative nodal infinity-norm error equals the positive amplitude factor pi^2/lambda_h-1. Taylor expansion sin(z)/z=1-z^2/6+O(z^4) yields (z/sin(z))^2-1=z^2/3+O(z^4)=pi^2*h^2/12+O(h^4). The expansion is justified by analyticity near zero. This is a mesh-amplitude error for the stated manufactured problem, with interpolation and physical-model questions remaining separate.

  11. For U_h=U+h^2*log(h), derive the ratio of successive differences under halving and its limit. Compute the error remaining after second-order Richardson extrapolation, and explain why an observed order approaching two does not justify a pure constant-times-h^2 leading coefficient with a higher-power remainder.

    Show the answer and reasoning

    The successive-difference ratio is 4*(3*log(h)+log(2))/(3*log(h)-2*log(2)), tending to 4. Richardson extrapolation leaves error -h^2*log(2)/3, so it does not obtain fourth-order accuracy.

    Under halving, U_(h/2)-U=(h^2/4)*(log(h)-log(2)). Subtracting gives Delta_h=U_h-U_(h/2)=(h^2/4)*(3*log(h)+log(2)). At the next level Delta_(h/2)=(h^2/16)*(3*log(h)-2*log(2)). Where the differences are nonzero their ratio is 4*(3*log(h)+log(2))/(3*log(h)-2*log(2)). As h tends to zero, log(h) tends to negative infinity, so the ratio tends to 4 and the logarithmic observed order tends to 2. The second-order Richardson value is U_ext=(4*U_(h/2)-U_h)/3. Direct substitution cancels the log(h) term but gives U_ext-U=-h^2*log(2)/3. This remains a nonzero constant times h^2, not an O(h^4) remainder. The original normalized error (U_h-U)/h^2=log(h) has no finite limit C. It therefore cannot have the contract C*h^2+O(h^(2+q)) for any fixed finite C and q>0. An observed order tending to two does not prove that stronger expansion or the associated extrapolation certificate.

  12. Starting from (1,0), compare an intended rotation by pi/6 per step with a rotation by pi/3 per step after three steps. Compute the state error and quadratic invariant, and explain why reversibility and exact energy preservation miss this error.

    Show the answer and reasoning

    After three steps the intended state is (0,1) and the erroneous state is (-1,0), with Euclidean error sqrt(2). Both preserve H=1/2 and are exactly reversible.

    Three intended steps of angle pi/6 compose to a rotation by pi/2, sending (1,0) to (0,1). Three erroneous steps of angle pi/3 compose to a rotation by pi, sending the same initial state to (-1,0). The difference between the two final states is (1,1), up to sign, so its Euclidean norm is sqrt(2). Their amplitudes are both 1 and their quadratic invariants H=(q^2+p^2)/2 both equal 1/2. Each rotation has inverse given by the negative angle. Reversing either three-step calculation with its own inverse returns exactly to the initial state in exact arithmetic. The erroneous dynamics can therefore pass both exact energy and reversibility diagnostics. The missing condition is fidelity to the intended phase advance at the stated time step. Structural diagnostics can reject some errors, but they do not uniquely determine the correct evolution. An independent time-accuracy or trajectory comparison is needed for that target.

  13. Show a collision in raw concatenation of the ordered string pairs ('ab','c') and ('a','bc'). Give unambiguous length-delimited encodings and prove that at least one collision exists when nine distinct inputs are assigned three-bit hashes.

    Show the answer and reasoning

    Both raw concatenations are 'abc'; length-delimited encodings '2:ab1:c' and '1:a2:bc' distinguish the ordered pairs. Nine distinct inputs cannot all have distinct three-bit hashes.

    Concatenating the first pair gives 'ab' followed by 'c', or 'abc'. Concatenating the second gives 'a' followed by 'bc', also 'abc'. The boundary between fields has been lost, so this encoding is not injective even for two fixed ordered fields. In a fixed byte encoding, use the canonical decimal byte length, a colon and exactly that many bytes for each field. The pairs become '2:ab1:c' and '1:a2:bc'. Reading the first length determines the first field's exact boundary, after which the second field is parsed in the same way. Unique left-to-right parsing proves that two encoded pairs with the same bytes have the same two fields, provided the length format and byte encoding are fixed. A more general format also needs explicit type and sequence-boundary information; those are part of its domain contract. A three-bit hash has only 2^3=8 outputs. Assigning hashes to nine distinct inputs forces at least two to share an output by the pigeonhole principle. This does not identify which collision occurs, but it proves that finite hash equality alone cannot be an unconditional identity proof for all those inputs.

  14. A cached function is f_a(x)=a*x+1, but its key contains only x. Compute the stale-answer error when x=3 and a changes from 2 to 5. Identify the mathematical assumption missing from an argument that identical keys justify output reuse.

    Show the answer and reasoning

    The cached old value is 7 and the new correct value is 16, so the stale-answer error has magnitude 9. The key omits an effective parameter.

    At a=2 and x=3, f_a(x)=2*3+1=7. A cache keyed only by x stores that output under the key for 3. After a changes to 5, the mathematical target becomes f_5(3)=5*3+1=16. The old key is unchanged, so blindly returning its old value produces 7 instead of 16, an absolute error of 9. The pure-function identity argument requires identical complete inputs and the same function contract. Here a is an effective input even if stored outside the nominal x argument. Its omission means equal cache keys do not establish identical mathematical computations. Safe reuse needs evidence that a and all other effective dependencies remain identical, or an identity that includes them. A successful old check is not evidence that an unrecorded parameter stayed unchanged, and this example does not require discarding genuinely unchanged completed work.

  15. For N=100 observations of variance 9, compare the variance of their mean under independence, complete duplication of one observation, and an equicorrelation model with pairwise correlation 1/10. Derive each result from the covariance sum.

    Show the answer and reasoning

    The mean variances are 9/100 under independence, 9 under complete duplication, and 981/1000 under pairwise correlation 1/10.

    For any finite-variance observations, Var(Xbar)=N^(-2)*sum_(i,j) Cov(X_i,X_j). With N=100 and each variance 9, the diagonal contribution is 100*9/10000=9/100. Under independence every off-diagonal covariance is zero, so the variance is exactly 9/100. If all observations are one duplicated variable Z, every covariance equals 9; the sum has 10000 such terms and the mean variance is 9. In the equicorrelation model each distinct-pair covariance is 9/10. There are 100*99 ordered off-diagonal pairs, giving [100*9+100*99*(9/10)]/10000=981/1000. Equivalently the formula is (9/100)*[1+99*(1/10)]. The third model has a valid positive correlation structure and much less variance reduction than independence. Merely counting stored rows or reexecutions does not establish the number of independent observations. The covariance assumptions, rather than the labels of the replicates, determine this uncertainty.

  16. Suppose independent replicates satisfy Y_r=theta+3+epsilon_r, with centered epsilon_r of variance 4, and R=16. Find the mean bias, variance, mean-square error, theoretical standard error and expected unbiased sample variance. Explain why replicate agreement does not measure the common bias.

    Show the answer and reasoning

    The unadjusted mean has bias 3, variance 1/4, mean-square error 37/4 and theoretical standard error 1/2. The unbiased sample variance has expectation 4.

    Each replicate has mean theta+3 and variance 4. Independence gives E(Ybar)=theta+3 and Var(Ybar)=4/16=1/4. The bias with respect to theta is therefore 3. Mean-square error decomposes into squared bias plus variance: E((Ybar-theta)^2)=3^2+1/4=37/4. The theoretical standard error sqrt(Var(Ybar))=1/2 describes fluctuation around theta+3, not the total error around theta. For R=16, S^2=(1/15)*sum(Y_r-Ybar)^2 has expectation 4 by the unbiased-sample-variance identity. Thus S^2/16 estimates the sampling variance of the mean, whose expectation is 1/4. Replicate agreement cannot reveal a common shift because centering by Ybar removes it from every deviation. The supplied bias 3 could be corrected if independently known, but the replicate spread does not discover or bound it. A confidence statement about theta needs that bias treatment and its own probability assumptions.

  17. For P(x,y)=x^2+y over F_7 with independent uniform coordinates, calculate its exact zero probability and compare with the total-degree bound. Give the exact and bounded false-acceptance probabilities for four independent trials. Explain why the formal nonzero polynomial x^7-x vanishing on F_7 does not contradict the bound.

    Show the answer and reasoning

    The exact single-trial zero probability is 1/7, below the bound 2/7. Four-trial false acceptance is exactly 1/2401 and at most 16/2401 by the degree bound. The x^7-x example has the vacuous bound 1.

    For each of the seven values of x in F_7, exactly one value y=-x^2 makes P(x,y)=0. There are therefore seven zero pairs among forty-nine uniform pairs, giving probability 1/7. The polynomial is formally nonzero and has total degree 2, so the general bound is 2/7. Four fresh independent complete assignments have exact all-zero probability (1/7)^4=1/2401 for this particular polynomial. Applying only the general degree bound gives the weaker sufficient upper bound (2/7)^4=16/2401. For the formal polynomial Q(x)=x^7-x over F_7, every field element satisfies a^7=a: it is immediate for zero, and nonzero elements satisfy a^6=1 in the multiplicative group. Thus Q vanishes at all seven field elements despite being formally nonzero. Here the degree and sample-set size are both 7, so the theorem states probability at most min(1,7/7)=1. That permits every test to pass and is not a contradiction. The degree and actual field are essential parts of a probabilistic identity certificate.

  18. A final quantity has three error contributions bounded by 1/50,3/1000,1/1000 with propagation factors 2,5,1. The bounds fail with probabilities at most 1/1000,1/500,1/200. Derive a simultaneous probability guarantee and total numerical-error bound without assuming independence. Does this certify tolerance 1/20? State how an unbounded model discrepancy changes the conclusion.

    Show the answer and reasoning

    The simultaneous numerical bound is 7/125=0.056 with probability at least 124/125=0.992. It does not certify tolerance 1/20=0.05, and it does not bound an unquantified model discrepancy.

    Propagate the three contributions in their compatible final-output units: 2*(1/50)+5*(3/1000)+1/1000=40/1000+15/1000+1/1000=56/1000=7/125. The probability of any individual bound failing is at most 1/1000+1/500+1/200=1/1000+2/1000+5/1000=1/125. By a union bound, all three hold simultaneously with probability at least 124/125. No independence between these three events is needed. On that simultaneous event the final numerical error is at most 7/125, assuming the propagation factors and domains are valid as stated. Since 7/125>1/20, this certificate does not qualify the requested tolerance. It also does not prove the actual error exceeds tolerance: the bound may be conservative. If physical-model discrepancy is bounded separately by M, add M to this numerical error bound in compatible units, and combine any probability qualification on M appropriately. If that discrepancy is unbounded or unquantified, the stated numerical guarantee cannot become a guarantee about the true physical prediction.

What to carry forward

  • A certificate is an implication from stated assumptions to a stated conclusion. Missing domain, arithmetic, sampling or model assumptions remain missing after a test passes.
  • A residual must include its own evaluation uncertainty and the relevant inverse or contraction bound before it becomes a solution-error estimate.
  • Interval inclusion and contraction can establish existence and uniqueness; a narrow numerical output or a self-containing box alone does not automatically do so.
  • Manufactured solutions and refinement studies expose particular implementation and discretization errors. A zero algebraic residual can coexist with a nonzero continuum error.
  • A consistent derivative or adjoint pair can be consistently wrong. Finite checks become complete only under independently justified structural assumptions.
  • Bitwise reproducibility needs a computation contract, while numerical accuracy needs an error argument. Neither property implies the other.
  • Randomized checks quantify false acceptance only under the declared defect and sampling model. Reusing dependent samples does not create fresh confidence.
  • Unknown physical discrepancy cannot be removed by tighter numerical tolerances. Preserve the difference between a verified computation and a validated model.

References

Sources for the concepts and teaching approaches in this article.

  1. Verification methods: Rigorous results using floating-point arithmeticSiegfried M. RumpResearch survey · PDFtuhh.deRead source
  2. Code Verification by the Method of Manufactured SolutionsKambiz Salari and Patrick KnuppInstitutional technical reportosti.govRead source
  3. The Connection Between the Complex-Step Derivative Approximation and Algorithmic DifferentiationJoaquim R. R. A. Martins, Peter Sturdza and Juan J. AlonsoResearch conference paper · PDFumich.eduRead source
  4. Efficient Reproducible Floating Point Summation and BLASWillow Ahrens, Hong Diep Nguyen and James DemmelUniversity technical report · PDFwww2.eecs.berkeley.eduRead source
  5. math: Mathematical functionsPython documentation contributorsOfficial software documentationdocs.python.orgRead source
  6. Reproducibility and Replicability in Science, Chapter 3: Understanding Reproducibility and ReplicabilityNational Academies of Sciences, Engineering, and MedicineInstitutional research reportnationalacademies.orgRead source
  7. Parallel Random Numbers: As Easy as 1, 2, 3John SalmonAuthor project documentationrandom123.comRead source
  8. Probability Inequalities for Sums of Bounded Random VariablesWassily HoeffdingOriginal research article · PDFcs.rpi.eduRead source
  9. Lecture 10: Polynomial Identity Testing and Parallel MatchingsAnupam GuptaAuthor lecture notes · PDFcs.cmu.eduRead source