MATH 417 Lecture 5
« previous | Tuesday, January 28, 2014 | next »
Best Floating Point Adding Algorithm
- sort collection of numbers
- arrange in "baskets" of size Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 2^n} for . (e.g. 1/32, 1/16, 1/8, 1/4, 1/2, 1, 2, 4, 8, 16, 32)
- starting with smallest basket, remove 2 numbers and insert their sum into the next basket
- repeat (3) until only one number remains in the largest basket
Roundoff error will be minimized.
Polynomial Interpolation
Given for , we want to approximate with a simpler function .
Stuff to show:
- there exists only one polynomial
- find it
- find the error
Existence
Theorem. Given and , there exists a polynomial of degree such that for all .
Proof. [Omitted in the book, so we will not cover it here]
The good news: every function can be approximated by a polynomial. Weierstrass proved the existence of such polynomials, but Bernstein actually found one.
Lagrange Interpolating Polynomial
For , given measurements , where , We want to find such that for , and .
Theorem 1. There exists a unique which satisfies the conditions above:
Proof. We take our initial conditions and construct a matrix equation :
There is only one unique solution if and only if .
Basis.
- Given one point , the determinant is just .
- Given two points , the determinant is since points are distinct.
- Given three points , the determinant is
Induction. In general,
To find , We construct a polynomial that is 0 at all points except when , in which case .
Therefore , or in short
Example
| 0 | 1 | 2 | 3 | |
| 4 | 1 | 7 | 28 |
.
Error Estimation
Theorem. Let for .
Proof. Let . This function is special because and . Hence there are roots, and it is Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle (n+1)} -differentiable. Let's compute that derivative:
We know Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle g^{(n+1)}(t)} has a zero at some Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle \xi \in \left[ a,b \right]} . To solve for it, we set Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://wikimedia.org/api/rest_v1/":): {\displaystyle 0 = f^{(n+1)}(\xi) - \frac{f(x) - L_n(x)}{(x-x_0)(x-x_1) \ldots (x-x_n)} \, (n+1)!} . Therefore our desired equation follows