From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires...

16
From polynomial interpolation to Chebfun Nick Trefethen, University of Oxford 1 /24

Transcript of From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires...

Page 1: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that

From polynomial interpolation to ChebfunNick Trefethen, University of Oxford

1/24

Page 2: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that

What's the integral of exp(-x) cos(6x)5 sin(5x)6 from –1 to 1?

Maple or Mathematica can figure out the answer exactly:

Page 3: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that

To combat the combinatorial explosion we use floating-point arithmetic: as we calculate, we round each number to 16 digits.

CHEBFUN VISION: floating-point arithmetic for functions, not just numbers.Represent functions by (piecewise) polynomial interpolants.

“Computing with symbolic feel and numerical speed”

Through any n+1 data values,there is a unique polynomial interpolant of degree n.

As Chebfun calculates, it chooses each polynomial degree to achieve 16 digits.

• Extend floating-point arithmetic from numbers to functions.• Overload Matlab’s vectors and matrices to functions and operators.

Page 4: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that

WHAT THE BOOKS SAY ABOUT POLYNOMIAL INTERPOLATION

Dahlquist & Björck (1974): “But there are many functions which are not at all suited for approximation by a single polynomial in the entire interval which is of interest.”

Forsythe, Malcolm & Moler (1977): “Polynomials of high degree can lead to difficult problems associated with roundoff error.”

Fröberg (1985): “Although Lagrangian interpolation is sometimes useful in theoretical investigations, it is rarely used in practical computations.”

Kahaner, Moler & Nash (1989): “Polynomial interpolation is a bad idea.”

Cormen, Leiserson & Rivest (1990): “Interpolation is a notoriously tricky problem from the point of view of numerical stability.”

Stoer & Bulirsch (1993): “While theoretically important, Lagrange's formula is, in general, not as suitable for actual calculations as some other methods to be described below.”

Stewart (1996): “Unfortunately, there are functions for which interpolation at the Chebyshevpoints fails to converge.”

Kincaid & Cheney (2002): “For most continuous functions, the quantity || f −pn ||∞ willnot converge to 0.”

Burden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that a fluctuation over a small portion of the interval can induce large fluctuations over the entire range, restricts their use.”

Parlett, SIAM Review book review (2010): “You do not want to meet a polynomial of degree 1000 on a dark night.”

.

Page 5: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that

All this is untrue.

Interpolants in equispaced points are bad, but Chebyshev points are fine.

Some algorithms are numerically unstable,but the barycentric interpolation formula is bulletproof.

.

Page 6: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that

CHEBYSHEV POINTS IN [−1,1]

xj = cos( j/n), 0 j n . Clustered near the boundaries.

Chebyshev… Bernstein… Lanczos… Clenshaw… Fox… Elliott… Mason… Rivlin… Good… Salzer… Orszag… Geddes…

Page 7: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that
Page 8: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that
Page 9: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that
Page 10: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that
Page 11: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that
Page 12: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that

f = continuous function on [–1,1]

p* = best max-norm degree n polynomial approximation of f

p = degree n interpolant of f in the Chebyshev pts.

|| f – p|| : error in Chebyshev interpolation

|| f – p*|| : smallest possible error among all polynomials

NOTATION FOR FIVE THEOREMSABOUT POLYNOMIAL INTERPOLATION

IN CHEBYSHEV POINTS

Page 13: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that

Theorem 1. || f − p || [ 2 + (2/) log n ] || f − p*|| .

Theorem 2. If f , f ’ ,…, f (k−1) are absolutely continuous and f (k) has bounded variation, then || f − p|| = O( n−k ) .

Theorem 3. If f is analytic in the closed ellipse in the complex planewith foci 1 and semiaxis lengths summing to ρ , then

|| f − p|| = O( ρ−n ) .

Theorem 4. Barycentric interpolation formula:

p(x) = .

Theorem 5. The barycentric formula is numerically stable.

" (−1) j f (x j ) / ( x − x j )

" (−1) j / ( x − x j )

Ehlich & Zeller 1966

Mastroianni & Szabados 1995

follows from Bernstein 1912

N. J. Higham 2004

M. Riesz 1916Salzer 1972

"NEAR-

BEST"

"SPE

CTRAL A

CCURACY"

BARYCENTRIC I

NTERP.

Page 14: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that

SIAM 2013

“Chebyshev technology”

Textbook Software

Textbook 2

Exploring ODESTrefethen, Birkisson, and Driscoll

To be published by SIAM in 2018and also freely available online

Page 15: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that
Page 16: From polynomial interpolation to Chebfunjm/wiki/uploads/LMS/Trefthen-chebfun.pdfBurden & Faires (2005): “The oscillatory nature of high degree polynomials, and the property that

Demonstration