2. Interpolation of functions
Finite differences
Divided differences
Lagrange interpolating polynomial
Newton interpolating polynomial
Hermite interpolating polynomial∗
Interpolation error
Neville algorithm
Algorithmic complexity of interpolation
Dmytro Mitin fb.com/dmitry.mitin Interpolation
3. String interpolation
int x = 5, y = 4;
System.out.println(String.format("%d * %d = %d",
x, y, x * y));
5 * 4 = 20
Dmytro Mitin fb.com/dmitry.mitin Interpolation
4. How many roots?
c ·
(x − a)(x − b)
(c − a)(c − b)
+ a ·
(x − b)(x − c)
(a − b)(a − c)
+ b ·
(x − c)(x − a)
(b − c)(b − a)
= x
(a, b, c are fixed, a = b, b = c, c = a)
Dmytro Mitin fb.com/dmitry.mitin Interpolation
5. How many roots?
(x − a)(x − b)
(c − a)(c − b)
+
(x − b)(x − c)
(a − b)(a − c)
+
(x − c)(x − a)
(b − c)(b − a)
= 1
(a, b, c are fixed, a = b, b = c, c = a)
Dmytro Mitin fb.com/dmitry.mitin Interpolation
6. How many roots?
c2
·
(x − a)(x − b)
(c − a)(c − b)
+a2
·
(x − b)(x − c)
(a − b)(a − c)
+b2
·
(x − c)(x − a)
(b − c)(b − a)
= x2
(a, b, c are fixed, a = b, b = c, c = a)
Dmytro Mitin fb.com/dmitry.mitin Interpolation
7. How many roots?
c3
·
(x − a)(x − b)
(c − a)(c − b)
+a3
·
(x − b)(x − c)
(a − b)(a − c)
+b3
·
(x − c)(x − a)
(b − c)(b − a)
= x3
(a, b, c are fixed, a = b, b = c, c = a)
Dmytro Mitin fb.com/dmitry.mitin Interpolation
8. How many roots?
c4
·
(x − a)(x − b)
(c − a)(c − b)
+a4
·
(x − b)(x − c)
(a − b)(a − c)
+b4
·
(x − c)(x − a)
(b − c)(b − a)
= x4
(a, b, c are fixed, a = b, b = c, c = a)
Dmytro Mitin fb.com/dmitry.mitin Interpolation
12. Interpolation
p(xk) = f (xk), k = 0, n − 1 or p(xk) = yk, k = 0, n − 1
Dmytro Mitin fb.com/dmitry.mitin Interpolation
13. Lagrange interpolating polynomial
n = 3
p(x) = f (c)·
(x − a)(x − b)
(c − a)(c − b)
+f (a)·
(x − b)(x − c)
(a − b)(a − c)
+f (b)·
(x − c)(x − a)
(b − c)(b − a)
p(a) = f (a), p(b) = f (b), p(c) = f (c)
(a = b, b = c, c = a)
Dmytro Mitin fb.com/dmitry.mitin Interpolation