A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Rounding Errors and Error Propagation

Graduate Depth 85 in the knowledge graph ☐ I know this ☆ Set as goal
12topics build on this
341prerequisites beneath it
See this on the map →
Floating Point RepresentationMachine Epsilon and Unit Roundoff+1 more→→Catastrophic CancellationNumerical Differentiation
rounding error propagation

Core Idea

Every floating point operation introduces rounding error bounded by machine epsilon times the result's magnitude. As operations are chained, these errors accumulate unpredictably. Understanding error propagation through algorithms is essential for predicting and controlling overall numerical accuracy.

Explainer

You've learned that machine epsilon (ε_mach) is the smallest positive number such that 1 + ε_mach ≠ 1 in floating-point arithmetic — it measures the granularity of the number system. Every time you perform a floating-point operation like addition or multiplication, the result must be rounded to the nearest representable number. The rounding error introduced by a single operation is bounded by ε_mach × |result|, which is tiny on its own. The challenge is that algorithms chain thousands or millions of such operations, and these small errors accumulate.

Error propagation asks: if the inputs to a computation have small errors, how large are the errors in the output? For a function f(x), the absolute error in the output is approximately |f'(x)| × |Δx|, where Δx is the error in x. The relative error in the output is approximately |f'(x)| × |x/f(x)| × (relative error in x). The factor |f'(x)| × |x/f(x)| is the condition number of the function — it measures how much relative error is amplified. A condition number near 1 is benign; a large condition number means the function is ill-conditioned and tiny input errors explode into large output errors.

In multi-step algorithms, rounding errors accumulate through two distinct mechanisms. Forward error analysis tracks how errors introduced at each step propagate to the final result — it bounds the total error by summing contributions from each operation. Backward error analysis (Wilkinson's key insight) asks instead: for what slightly perturbed input would the algorithm have produced this exact output? If the backward error is small (of order ε_mach), the algorithm is numerically stable, even if the forward errors look alarming. Stable algorithms give the right answer to a nearby problem; unstable ones don't even achieve that.

A concrete example: summing n numbers in sequence accumulates O(n ε_mach) relative error. For n = 10⁶ and ε_mach ≈ 10⁻¹⁶, this gives relative error of about 10⁻¹⁰ — still small. But if some numbers nearly cancel (like summing 1.0000001 − 1.0000000), catastrophic cancellation can amplify the relative error dramatically, since you subtract two nearly equal quantities and the leading significant digits vanish, leaving only the rounded residue. This is why the order of operations matters in floating-point arithmetic, and why numerical analysts sometimes reformulate algebraically equivalent expressions to avoid cancellation.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Binary Counters: Design and Analysis → Binary Arithmetic → Fixed-Point Number Representation → Two's Complement Representation → Floating-Point Representation (IEEE 754) → Machine Epsilon and Unit Roundoff → Floating Point Representation → Rounding Errors and Error Propagation

Longest path: 86 steps · 341 total prerequisite topics

Prerequisites (3)

Leads To (2)