Fundamentals
0.1 Evaluating a Polynomial
1) Polynomial
Polynomial: A function of the form
where are coefficients and is the degree.
Degree: The largest exponent of whose coefficient is nonzero.
Polynomial Evaluation: The process of computing for a given value of .
2) Horner’s Method
Horner’s Method: An efficient method for evaluating a polynomial by rewriting it in nested form.
For a polynomial of degree , Horner’s method requires:
- multiplications
- additions
- time
- additional space
Horner’s method avoids computing powers of separately.
3) Nested Multiplication
Nested Multiplication: A generalized form of Horner’s method using different base points.
Base Points: The values used in the nested representation.
Nested multiplication is used in polynomial interpolation.
0.2 Binary Numbers
1) Positional Number System
Positional Number System: A representation in which the value of each digit depends on its position.
For a base- number,
2) Binary Number
Binary Number: A base- number whose digits are or .
Bit: A single binary digit whose value is either or .
For example,
For a binary fraction,
3) Decimal Integer to Binary
Repeated-Division Method: A method for converting a decimal integer to binary by repeatedly dividing by .
- Divide the integer by .
- Record the remainder.
- Repeat with the quotient.
- Read the remainders in reverse order.
4) Decimal Fraction to Binary
Repeated-Multiplication Method: A method for converting a decimal fraction to binary by repeatedly multiplying by .
- Multiply the fractional part by .
- Record the integer part.
- Repeat with the new fractional part.
- Read the recorded bits in order.
A finite decimal fraction may have an infinite binary representation.
5) Hexadecimal Number
Hexadecimal Number: A base- number using the digits through and through .
Each hexadecimal digit corresponds to four binary bits.
Hexadecimal notation is a compact representation of binary data.
0.3 Floating-Point Representation
1) Floating-Point Number
Floating-Point Number: A finite approximation of a real number represented using a sign, significand, and exponent.
A normalized binary floating-point number has the form
where:
- is the sign bit.
- is the significand.
- is the exponent.
Significand: The part containing the significant digits of a floating-point number.
Normalized Number: A nonzero floating-point number whose significand has an implicit leading .
2) IEEE 754 Formats
IEEE 754: The standard representation and arithmetic rules for binary floating-point numbers.
| Format | Total Bits | Sign | Exponent | Fraction |
|---|---|---|---|---|
| Single precision | 32 | 1 | 8 | 23 |
| Double precision | 64 | 1 | 11 | 52 |
For IEEE 754 double precision,
for .
Exponent Bias: A fixed value added to the actual exponent before storage.
For double precision,
3) Floating-Point Approximation
Floating-Point Approximation: The representable floating-point number stored in place of an exact real number.
The notation
denotes the floating-point approximation of .
Many real numbers cannot be represented exactly with a finite number of binary digits.
For example,
in exact real arithmetic.
4) Machine Epsilon
Machine Epsilon: The distance between and the next representable floating-point number greater than .
For IEEE 754 double precision,
Machine epsilon measures floating-point spacing near .
It is not the smallest positive representable number.
5) Rounding
Chopping: Removing all digits beyond the available precision.
Rounding to Nearest: Selecting the representable number closest to the exact value.
Round to Nearest, Ties to Even: If two representable values are equally close, select the one whose final stored bit is even.
For rounding to nearest,
The value represents the relative rounding error.
6) Absolute Error
Absolute Error: The magnitude of the difference between an approximation and the exact value .
Absolute error measures the numerical distance between the two values.
7) Relative Error
Relative Error: The absolute error divided by the magnitude of the exact value.
Relative error measures the error in proportion to the size of the exact value.
8) Special Floating-Point Values
| Exponent | Fraction | Value |
|---|---|---|
| to | Any | Normalized number |
| Zero | Signed zero | |
| Nonzero | Subnormal number | |
| Zero | Positive or negative infinity | |
| Nonzero | NaN |
Signed Zero: A representation of zero with either a positive or negative sign.
Infinity: A special value representing a result beyond the finite floating-point range.
NaN: “Not a Number,” representing an undefined or invalid numerical result.
9) Subnormal Number
Subnormal Number: A very small floating-point number represented without an implicit leading .
For double precision,
The smallest positive subnormal double is
Subnormal numbers allow gradual underflow near zero.
10) Overflow and Underflow
Overflow: A nonzero result is too large to be represented as a finite floating-point number.
Overflow usually produces positive or negative infinity.
Underflow: A nonzero result is smaller in magnitude than the normal floating-point range.
Underflow may produce a subnormal number or zero.
11) Floating-Point Addition
Floating-point addition generally performs four steps:
- Align the exponents.
- Add the significands.
- Normalize the result.
- Round the result.
When two operands differ greatly in magnitude, the smaller operand may have no effect on the result.
For double precision,
under round to nearest, ties to even.
12) Floating-Point Arithmetic
Floating-Point Arithmetic: Arithmetic performed on finite approximations rather than exact real numbers.
Floating-point arithmetic is generally not associative.
Rounding errors make the order of operations important.
Floating-point values should usually be compared using absolute and relative tolerances.
0.4 Loss of Significance
1) Significant Digits
Significant Digits: Digits that contribute meaningful precision to a numerical value.
A numerical calculation loses accuracy when significant digits are removed or corrupted by rounding.
2) Cancellation
Cancellation: The loss of leading significant digits when subtracting numbers with similar magnitudes.
Cancellation is not always harmful, but it becomes dangerous when the operands already contain approximation errors.
3) Catastrophic Cancellation
Catastrophic Cancellation: A severe loss of relative accuracy caused by subtracting nearly equal approximate values.
If
then the subtraction
may eliminate most significant digits.
The relative error of the result can be much larger than the relative errors of and .
4) Numerically Stable Reformulation
Numerically Stable Reformulation: An algebraically equivalent expression designed to reduce rounding error or cancellation.
For ,
is numerically unstable.
Using the conjugate,
The second expression avoids subtracting nearly equal values.
Similarly,
is unstable near .
Because
it can be rewritten as
5) Stable Quadratic Formula
For
the ordinary quadratic formula is
One root may suffer from catastrophic cancellation when
A numerically stable method defines
The roots are then computed by
This method avoids subtracting nearly equal quantities.
6) Numerical Stability
Numerical Stability: A property of an algorithm that prevents small rounding errors from growing excessively during computation.
A mathematically correct formula is not necessarily a numerically stable algorithm.
0.5 Review of Calculus
1) Limit
Limit: The value approached by a function as its input approaches a specified point.
Limits describe the local behavior of functions and form the basis of continuity and differentiation.
2) Continuity
Continuous Function: A function is continuous at if
A function is continuous on an interval if it is continuous at every point in that interval.
3) Intermediate Value Theorem
Intermediate Value Theorem: If is continuous on , then takes every value between and .
If
then there exists at least one such that
This theorem is the foundation of bracketing root-finding methods such as the bisection method.
4) Derivative
Derivative: The instantaneous rate of change of a function.
The derivative is also the slope of the tangent line to the graph of .
5) Rolle’s Theorem
Rolle’s Theorem: If is continuous on , differentiable on , and
then there exists at least one such that
Rolle’s theorem is a special case of the Mean Value Theorem.
6) Mean Value Theorem
Mean Value Theorem: If is continuous on and differentiable on , then there exists at least one such that
The theorem connects the average rate of change over an interval with an instantaneous rate of change.
7) Taylor Polynomial
Taylor Polynomial: A polynomial approximation constructed from the derivatives of a function at a point.
The degree- Taylor polynomial of centered at is
Expanded,
Taylor polynomials are used to derive and analyze numerical methods.
8) Taylor’s Theorem
Taylor’s Theorem: If has sufficiently many continuous derivatives, then
where is the Taylor polynomial and is the remainder.
The Lagrange form of the remainder is
for some between and .
9) Error Bound
Taylor Error Bound: If
between and , then
The remainder provides a bound on the approximation error.
10) Mean Value Theorem for Integrals
Mean Value Theorem for Integrals: If is continuous on , then there exists some such that
Therefore,
The value equals the average value of over the interval.
Essential Concepts
- Horner’s Method: Evaluates a degree- polynomial using additions and multiplications.
- Binary Representation: Represents numbers as sums of powers of .
- Floating-Point Number: Stores an approximation using a sign, significand, and exponent.
- Machine Epsilon: Measures floating-point spacing near .
- Rounding Error: The error introduced when an exact value is replaced by a representable value.
- Absolute Error: Measures the numerical difference from the exact value.
- Relative Error: Measures the error relative to the size of the exact value.
- Overflow: Occurs when a result exceeds the largest finite representable value.
- Underflow: Occurs when a result is too small for the normal floating-point range.
- Catastrophic Cancellation: Causes severe accuracy loss when nearly equal values are subtracted.
- Numerical Stability: Describes whether an algorithm controls the growth of rounding errors.
- Intermediate Value Theorem: Guarantees a root when a continuous function changes sign.
- Mean Value Theorem: Relates average and instantaneous rates of change.
- Taylor Polynomial: Approximates a smooth function near a chosen point.
- Taylor Remainder: Measures and bounds the error of a Taylor approximation.