ArticleslgStudy

mathematics

Affine arithmetic

Affine arithmetic is a mathematics topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Affine arithmetic rather than just read about it. In short: Affine arithmetic (AA) is a model for self-validated numerical analysis. In AA, the quantities of interest are represented as affine combinations (affine forms) of certain primitive variables, which stand for sources of uncertainty in the data or approximations made during the computation.

Key takeaways

  • Affine arithmetic belongs to mathematics; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Affine arithmetic to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Affine arithmetic from memory before moving on to harder problems.

Reference excerpt

Affine arithmetic (AA) is a model for self-validated numerical analysis. In AA, the quantities of interest are represented as affine combinations (affine forms) of certain primitive variables, which stand for sources of uncertainty in the data or approximations made during the computation. Affine arithmetic is meant to be an improvement on interval arithmetic (IA), and is similar to generalized interval arithmetic, first-order Taylor arithmetic, the center-slope model, and ellipsoid calculus — in the sense that it is an automatic method to derive first-order guaranteed approximations to general formulas. Affine arithmetic is potentially useful in every numeric problem where one needs guaranteed enclosures to smooth functions, such as solving systems of non-linear equations, analyzing dynamical systems, integrating functions, differential equations, etc. Applications include ray tracing, plotting curves, intersecting implicit and parametric surfaces, error analysis (mathematics), process control, worst-case analysis of electric circuits, and more.

Definition In affine arithmetic, each input or computed quantity x is represented by a formula x=x0+x1ϵ1+x2ϵ2+⋯+xnϵn where x0,x1,x2,…,xn are known floating-point numbers, and ϵ1,ϵ2,…,ϵn are symbolic variables whose values are only known to lie in the range [-1,+1]. Thus, for example, a quantity X which is known to lie in the range [3,7] can be represented by the affine form x=5+2ϵk, for some k. Conversely, the form x=10+2ϵ3−5ϵ8 implies that the corresponding quantity X lies in the range [3,17]. The sharing of a symbol ϵj among two affine forms x, y implies that the corresponding quantities X, Y are partially dependent, in the sense that their joint range is smaller than the Cartesian product of their separate ranges. For example, if x=10+2ϵ3−6ϵ8 and y=20+3ϵ4+4ϵ8, then the individual ranges of X and Y are [2,18] and [13,27], but the joint range of the pair (X,Y) is the hexagon with corners (2,27), (6,27), (18,19), (18,13), (14,13), (2,21) — which is a proper subset of the rectangle [2,18]×[13,27].

Affine arithmetic operations Affine forms can be combined with the standard arithmetic operations or elementary functions, to obtain guaranteed approximations to formulas.

Affine operations For example, given affine forms x,y for X and Y, one can obtain an affine form z for Z = X + Y simply by adding the forms — that is, setting zj ← xj+yj for every j. Similarly, one can compute an affine form z for Z = αX, where α is a known constant, by setting zj ← αxj for every j. This generalizes to arbitrary affine operations like Z = αX + βY + γ.

Non-affine operations A non-affine operation Z ← F(X,Y,…), like multiplication Z ← XY or Z ← sin⁡(X), cannot be performed exactly, since the result would not be an affine form of the ϵi. In that case, one should take a suitable affine function G that approximates F to first order, in the ranges implied by x and y; and compute z ← G(x,y,…)+zkϵk, where zk is an upper bound for the absolute error |F−G| in that range, and ϵk is a new symbolic variable not occurring in any previous form. The form z then gives a guaranteed enclosure for the quantity Z; moreover, the affine forms x,y,…,z jointly provide a guaranteed enclosure for the point (X,Y,...,Z), which is often much smaller than the Cartesian product of the ranges of the individual forms.

Chaining operations Systematic use of this method allows arbitrary computations on given quantities to be replaced by equivalent computations on their affine forms, while preserving first-order correlations between the input and output and guaranteeing the complete enclosure of the joint range. One simply replaces each arithmetic operation or elementary function call in the formula by a call to the corresponding AA library routine. For smooth functions, the approximation errors made at each step are proportional to the square h2 of the width h of the input intervals. For this reason, affine arithmetic will often yield much tighter bounds than standard interval arithmetic (whose errors are proportional to h).

Roundoff errors In order to provide guaranteed enclosure, affine arithmetic operations must account for the roundoff errors in the computation of the resulting coefficients zj. This cannot be done by rounding each zj in a specific direction, because any such rounding would falsify the dependencies between affine forms that share the symbol ϵj. Instead, one must compute an upper bound δj to the roundoff error of each zj, and add all those δj to the coefficient zk of the new symbol ϵk (rounding up). Thus, because of roundoff errors, even affine operations like Z = αX and Z = X + Y will add the extra term zkϵk. The handling of roundoff errors increases the code complexity and execution time of AA operations. In applications where those errors are known to be unimportant (because they are dominated by uncertainties in the input data and/or by the linearization errors), one may use a simplified AA library that does not implement roundoff error control.

Affine projection model Affine arithmetic can be viewed in matrix form as follows. Let X1,X2,…,Xm be all input and computed quantities in use at some point during a computation. The affine forms for those quantities can be represented by a single coefficient matrix A and a vector b, where element Ai,j is the coefficient of symbol ϵj in the affine form of Xi; and bi is the independent term of that form. Then the joint range of the quantities — that is, the range of the point (X1,X2,…,Xm) — is the image of the hypercube Un=[−1,+1]n by the affine map from Un to Rm defined by ϵ → Aϵ+b. The range of this affine map is a zonotope bounding the joint range of the quantities X1,X2,…,Xm. Thus one could say that AA is a "zonotope arithmetic". Each step of AA usually entails adding one more row and one more column to the matrix A.

Affine form simplification Since each AA operation generally creates a new symbol ϵk, the number of terms in an affine form may be proportional to the number of operations used to compute it. Thus, it is often necessary to apply "symbol condensation" steps, where two or more symbols ϵk are replaced by a smaller set of new symbols. Geometrically, this means replacing a complicated zonotope P by a simpler zonotope Q that encloses it. This operation can be done without destroying the first-order approximation property of the final zonotope.

Implementation

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with Affine arithmetic

Start with the simplest possible case. Write down what Affine arithmetic claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In mathematics, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Affine arithmetic before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Affine arithmetic ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Affine arithmetic

In research
Affine arithmetic appears in mathematics research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Affine arithmetic in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Affine arithmetic is common in secondary-school and first-year university syllabi. It links to neighbouring topics Affine geometry, Numerical analysis, so understanding it makes those chapters shorter.
In everyday life
Look for Affine arithmetic outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Affine arithmetic” →

How to study Affine arithmetic in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Affine arithmetic means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Affine arithmetic out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Affine arithmetic in simple terms?

Affine arithmetic (AA) is a model for self-validated numerical analysis. In AA, the quantities of interest are represented as affine combinations (affine forms) of certain primitive variables, which stand for sources of uncertainty in the data or approximations made during the computation.

Why does Affine arithmetic matter?

Because it connects several mathematics ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Affine arithmetic?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Affine arithmetic.

Tags

  • Affine geometry
  • Numerical analysis

Keep exploring