Fast algorithms based on asymptotic expansions of special functions Alex Townsend MIT

advertisement
Fast algorithms based on asymptotic
expansions of special functions
Alex Townsend
MIT
Cornell University, 23rd January 2015, CAM Colloquium
Introduction
Two trends in the computing era
Tabulations
Software
Logarithms
Gauss quadrature
Special functions
Alex Townsend @MIT
1/22
Introduction
Two trends in the computing era
Tabulations
Software
Logarithms
Gauss quadrature
Special functions
Classical
analysis
Numerical
analysis
=
~
Alex Townsend @MIT
Fast multipole method
Butterfly schemes
Iterative algorithms
Finite element method
1/22
Introduction
A selection of my research
Algebraic geometry
๐‘(๐‘ฅ, ๐‘ฆ)
=0
๐‘ž(๐‘ฅ, ๐‘ฆ)
[Nakatsukasa, Noferini, & T., 2015]
๐พ
Approx. theory
๐‘“(๐‘ฅ, ๐‘ฆ) ≈
๐‘๐‘— ๐‘ฆ ๐‘Ÿ๐‘— (๐‘ฅ)
๐‘—=1
[Trefethen & T., 2014]
Alex Townsend @MIT
2/22
Introduction
A selection of my research
Algebraic geometry
๐‘(๐‘ฅ, ๐‘ฆ)
=0
๐‘ž(๐‘ฅ, ๐‘ฆ)
[Nakatsukasa, Noferini, & T., 2015]
[Battels & Trefethen, 2004]
๐พ
Approx. theory
๐‘“(๐‘ฅ, ๐‘ฆ) ≈
๐‘๐‘— ๐‘ฆ ๐‘Ÿ๐‘— (๐‘ฅ)
๐‘—=1
[Trefethen & T., 2014]
Alex Townsend @MIT
2/22
Introduction
Many special functions are trigonometric-like
Trigonometric functions
cos(ωx), sin(๐œ”๐‘ฅ)
Chebyshev polynomials
Tn(x)
Legendre polynomials
Pn(x)
Bessel functions
Jv(z)
Airy functions
Ai(x)
Also, Jacobi polynomials, Hermite polynomials, parabolic cylinder functions, etc.
Alex Townsend @MIT
3/22
Introduction
Many special functions are trigonometric-like
Trigonometric functions
cos(ωx), sin(๐œ”๐‘ฅ)
Chebyshev polynomials
Tn(x)
Legendre polynomials
Pn(x)
Bessel functions
Jv(z)
Airy functions
Ai(x)
Also, Jacobi polynomials, Hermite polynomials, parabolic cylinder functions, etc.
Alex Townsend @MIT
3/22
Introduction
Many special functions are trigonometric-like
Trigonometric functions
cos(ωx), sin(๐œ”๐‘ฅ)
Chebyshev polynomials
Tn(x)
Legendre polynomials
Pn(x)
Bessel functions
Jv(z)
Airy functions
Ai(x)
Also, Jacobi polynomials, Hermite polynomials, parabolic cylinder functions, etc.
Alex Townsend @MIT
3/22
Introduction
Many special functions are trigonometric-like
Trigonometric functions
cos(ωx), sin(๐œ”๐‘ฅ)
Chebyshev polynomials
Tn(x)
Legendre polynomials
Pn(x)
Bessel functions
Jv(z)
Airy functions
Ai(x)
Also, Jacobi polynomials, Hermite polynomials, parabolic cylinder functions, etc.
Alex Townsend @MIT
3/22
Introduction
Many special functions are trigonometric-like
Trigonometric functions
cos(ωx), sin(๐œ”๐‘ฅ)
Chebyshev polynomials
Tn(x)
Legendre polynomials
Pn(x)
Bessel functions
Jv(z)
Airy functions
Ai(x)
Also, Jacobi polynomials, Hermite polynomials, parabolic cylinder functions, etc.
Alex Townsend @MIT
3/22
Introduction
Many special functions are trigonometric-like
Trigonometric functions
cos(ωx), sin(๐œ”๐‘ฅ)
Chebyshev polynomials
Tn(x)
Legendre polynomials
Pn(x)
Bessel functions
Jv(z)
Airy functions
Ai(x)
Also, Jacobi polynomials, Hermite polynomials, parabolic cylinder functions, etc.
Alex Townsend @MIT
3/22
Introduction
Asymptotic expansions of special functions
Legendre polynomials
cos
๐‘€−1
๐‘ƒ๐‘› (cos ๐œƒ) ~ ๐ถ๐‘›
โ„Ž๐‘š,๐‘›
๐‘š+๐‘›+
1
1 ๐œ‹
๐œƒ− ๐‘š+
2
2 2
1
๐‘š+2
(2 sin ๐œƒ)
๐‘š=0
,
๐‘›→∞
Thomas Stieltjes
Bessel functions
2
๐œ‹
๐ฝ0 ๐‘ง ~
(cos ๐‘ง −
๐œ‹๐‘ง
4
๐‘€−1
๐‘š=0
−1 ๐‘š ๐‘Ž2๐‘š
๐‘ง 2๐‘š
๐œ‹
− sin(๐‘ง − )
4
๐‘€−1
๐‘š=0
(−1)๐‘š ๐‘Ž2๐‘š+1
)
2๐‘š+1
๐‘ง
๐‘ง→∞
Hermann Hankel
Alex Townsend @MIT
4/22
Introduction
Numerical pitfalls of an asymptotic expansionist
๐ฝ0 ๐‘ง =
2
๐œ‹
(cos ๐‘ง −
๐œ‹๐‘ง
4
๐‘€−1
๐‘š=0
๐‘š๐‘Ž
−1
๐‘ง 2๐‘š
๐œ‹
2๐‘š
− sin(๐‘ง − )
4
๐‘€−1
๐‘š=0
(−1)๐‘š ๐‘Ž2๐‘š+1
) + ๐‘…๐‘€ (๐‘ง)
2๐‘š+1
๐‘ง
Fix M. Where is the asymptotic expansion accurate?
Alex Townsend @MIT
5/22
Introduction
Talk outline
Using asymptotics expansions of special functions:
I. Computing Gauss quadrature rules. [Hale & T., 2013], [T., Trodgon, & Olver, 2015]
II. Fast transforms based on asymptotic expansions. [Hale & T., 2014], [T., 2015]
Alex Townsend @MIT
6/22
Part I: Computing Gauss quadrature rules
Part I: Computing Gauss quadrature rules
Pn(x) = Legendre polynomial of degree n
Alex Townsend @MIT
7/22
Part I: Computing Gauss quadrature rules
Definition
n-point quadrature rule:
๐‘›
1
๐‘“ ๐‘ฅ ๐‘‘๐‘ฅ ≈
−1
๐‘ค๐‘˜ ๐‘“ ๐‘ฅ๐‘˜
๐‘˜=1
Gauss quadrature rule:
๐‘ฅ๐‘˜ = ๐‘˜๐‘กโ„Ž zero of ๐‘ƒ๐‘›
๐‘ค๐‘˜ = 2(1 − ๐‘ฅ๐‘˜2 )-1 [๐‘ƒ๐‘›′ (๐‘ฅ๐‘˜ )]-2
1. Exactly integrates polynomials of
degree ≤ 2n - 1. Best possible.
2. Computed by the Golub–Welsch
algorithm. [Golub & Welsch, 1969]
3. In 2004: no scheme for
computing Gauss rules in O(n).
[Bailey, Jeyabalan, & Li, 2004]
Alex Townsend @MIT
8/22
Part I: Computing Gauss quadrature rules
Gauss quadrature experiments
Execution time
Execution time
Quadrature error
Quadrature error
n
n
The Golub–Welsch algorithm is beautiful, but not the state-of-the-art.
There is another way...
Alex Townsend @MIT
9/22
Part I: Computing Gauss quadrature rules
Newton’s method
Newton’s method
(with asymptotics and a change of variables)
Solve Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2 = 0, θ ∈ (0, π).
Isaac Newton
1. Evaluation scheme for Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
2. Evaluation scheme for
๐‘‘
Pn( ๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/21/2
๐‘‘๐œƒ
3. Initial guesses for cos-1(xk)
Alex Townsend @MIT
10/22
Part I: Computing Gauss quadrature rules
Newton’s method… with asymptotics and a change of variables
Newton’s method
(with asymptotics and a change of variables)
Solve Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2 = 0, θ ∈ (0, π).
Isaac Newton
1. Evaluation scheme for Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
2. Evaluation scheme for
Pn(x)
๐‘‘
Pn( ๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2)1/2
๐‘‘๐œƒ
3. Initial guesses for cos-1(xk)
Alex Townsend @MIT
10/22
Part I: Computing Gauss quadrature rules
Newton’s method… with asymptotics and a change of variables
Newton’s method
(with asymptotics and a change of variables)
Solve Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2 = 0, θ ∈ (0, π).
Isaac Newton
1. Evaluation scheme for Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
2. Evaluation scheme for
Pn(x)
๐‘‘
Pn( ๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2)1/2
๐‘‘๐œƒ
3. Initial guesses for cos-1(xk)
Alex Townsend @MIT
10/22
Part I: Computing Gauss quadrature rules
Newton’s method… with asymptotics and a change of variables
Newton’s method
(with asymptotics and a change of variables)
Solve Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2 = 0, θ ∈ (0, π).
Isaac Newton
Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
1. Evaluation scheme for Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
2. Evaluation scheme for
๐‘‘
Pn( ๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
๐‘‘๐œƒ
3. Initial guesses for cos-1(xk)
Alex Townsend @MIT
10/22
Part I: Computing Gauss quadrature rules
Newton’s method… with asymptotics and a change of variables
Newton’s method
(with asymptotics and a change of variables)
Solve Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2 = 0, θ ∈ (0, π).
Isaac Newton
Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
1. Evaluation scheme for Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
2. Evaluation scheme for
๐‘‘
Pn( ๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
๐‘‘๐œƒ
3. Initial guesses for cos-1(xk)
Alex Townsend @MIT
10/22
Part I: Computing Gauss quadrature rules
Newton’s method… with asymptotics and a change of variables
Newton’s method
(with asymptotics and a change of variables)
Solve Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2 = 0, θ ∈ (0, π).
Isaac Newton
Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
1. Evaluation scheme for Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
2. Evaluation scheme for
๐‘‘
Pn( ๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
๐‘‘๐œƒ
3. Initial guesses for cos-1(xk)
Alex Townsend @MIT
10/22
Part I: Computing Gauss quadrature rules
Evaluation scheme for Pn
Interior (in grey region):
Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
๐‘ƒ๐‘› (cos ๐œƒ)(sin ๐œƒ)1/2
≈ ๐ถ๐‘›
1
1 ๐œ‹
๐‘š+๐‘›+ ๐œƒ− ๐‘š+
2
2 2
cos
๐‘€−1
โ„Ž๐‘š,๐‘›
2(2 sin ๐œƒ)๐‘š
๐‘š=0
Boundary:
๐‘ƒ๐‘›
(cos ๐œƒ)(sin ๐œƒ)1/2
≈
1
๐œƒ 2 (๐ฝ0 (๐œŒ๐œƒ)
๐‘€−1
๐‘š=0
๐ด๐‘š (๐œƒ)
+ ๐œƒ๐ฝ1 (๐œŒ๐œƒ)
2๐‘š
๐œŒ
๐‘š=0
๐ต๐‘š (๐œƒ)
),
2๐‘š+1
๐œŒ
1
๐œŒ=๐‘›+
2
[Baratella & Gatteschi, 1988]
Theorem
For ๐œ– > 0, ๐‘› ≥ 200, and
๐‘€−1
๐‘–๐‘›๐‘–๐‘ก
θ๐‘˜
= (๐‘˜
1 ๐œ‹
− ) ,
2 ๐‘›
Newton converges and the nodes are
computed to an accuracy of ๐’ช(๐œ–) in ๐’ช (๐‘›log(1/๐œ–)) operations.
Alex Townsend @MIT
11/22
Part I: Computing Gauss quadrature rules
Evaluation scheme for Pn
Interior (in grey region):
Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
๐‘ƒ๐‘› (cos ๐œƒ)(sin ๐œƒ)1/2
≈ ๐ถ๐‘›
1
1 ๐œ‹
๐‘š+๐‘›+ ๐œƒ− ๐‘š+
2
2 2
cos
๐‘€−1
โ„Ž๐‘š,๐‘›
2(2 sin ๐œƒ)๐‘š
๐‘š=0
Boundary:
๐‘ƒ๐‘›
(cos ๐œƒ)(sin ๐œƒ)1/2
≈
1
๐œƒ 2 (๐ฝ0 (๐œŒ๐œƒ)
๐‘€−1
๐‘š=0
๐ด๐‘š (๐œƒ)
+ ๐œƒ๐ฝ1 (๐œŒ๐œƒ)
2๐‘š
๐œŒ
๐‘š=0
๐ต๐‘š (๐œƒ)
),
2๐‘š+1
๐œŒ
1
๐œŒ=๐‘›+
2
[Baratella & Gatteschi, 1988]
Theorem
For ๐œ– > 0, ๐‘› ≥ 200, and
๐‘€−1
๐‘–๐‘›๐‘–๐‘ก
θ๐‘˜
= (๐‘˜
1 ๐œ‹
− ) ,
2 ๐‘›
Newton converges and the nodes are
computed to an accuracy of ๐’ช(๐œ–) in ๐’ช (๐‘›log(1/๐œ–)) operations.
Alex Townsend @MIT
11/22
Part I: Computing Gauss quadrature rules
Evaluation scheme for Pn
Interior (in grey region):
Pn(๐‘๐‘œ๐‘  θ) (๐‘ ๐‘–๐‘› θ)1/2
๐‘ƒ๐‘› (cos ๐œƒ)(sin ๐œƒ)1/2
≈ ๐ถ๐‘›
1
1 ๐œ‹
๐‘š+๐‘›+ ๐œƒ− ๐‘š+
2
2 2
cos
๐‘€−1
โ„Ž๐‘š,๐‘›
2(2 sin ๐œƒ)๐‘š
๐‘š=0
Boundary:
๐‘ƒ๐‘›
(cos ๐œƒ)(sin ๐œƒ)1/2
≈
1
๐œƒ 2 (๐ฝ0 (๐œŒ๐œƒ)
๐‘€−1
๐‘š=0
๐ด๐‘š (๐œƒ)
+ ๐œƒ๐ฝ1 (๐œŒ๐œƒ)
2๐‘š
๐œŒ
๐‘€−1
๐‘š=0
๐ต๐‘š (๐œƒ)
),
2๐‘š+1
๐œŒ
1
๐œŒ=๐‘›+
2
[Baratella & Gatteschi, 1988]
Theorem
For ๐‘› ≥ 200 and
๐‘–๐‘›๐‘–๐‘ก
θ๐‘˜
Alex Townsend @MIT
= (๐‘˜ −
1 ๐œ‹
) ,
2 ๐‘›
Newton converges to the nodes in ๐’ช (๐‘›) operations.
11/22
Part I: Computing Gauss quadrature rules
Initial guesses for the nodes
Interior: Use Tricomi’s
Max error in the initial guesses
Boundary: Use Olver’s
initial guesses. [Olver, 1974]
Ignace Bogaert
Alex Townsend @MIT
Max error
initial guesses. [Tricomi, 1950]
There are now better initial guesses. [Bogaert, 2014]
12/22
Part I: Computing Gauss quadrature rules
The race to compute high-order Gauss quadrature
“The race to compute
high-order Gauss
quadrature”
[T., 2015]
Alex Townsend @MIT
13/22
Part I: Computing Gauss quadrature rules
Applications
1.
Psychological: Gauss quadrature
2.
Experimental mathematics: High
precision quadratures. [Bailey, Jeyabalan,
& Li, 2004]
3.
Cosmic microwave background:
Noise removal by L2-projection.
Quadrature error
rules are cheap.
1
1
dx
2
2
−1 1+100 ๐‘ฅ
Generically, composite rules
converge algebraically.
Alex Townsend @MIT
14/22
Part II: Fast transforms based on asymptotic expansions
Part II: Fast transforms based on asymptotic
expansions
๐‘ƒ0 cos ๐œƒ0
โ‹ฎ
๐‘ท๐‘ต ๐‘ =
๐‘ƒ0 cos ๐œƒ๐‘−1
Alex Townsend @MIT
โ‹ฏ
โ‹ฑ
โ‹ฏ
๐‘ƒ๐‘−1 cos ๐œƒ0
โ‹ฎ
๐‘ƒ๐‘−1 cos ๐œƒ๐‘−1
๐‘1
โ‹ฎ
๐‘๐‘−1
๐‘˜๐œ‹
, ๐œƒ๐‘˜ =
๐‘−1
15/22
Part II: Fast transforms based on asymptotic expansions
Fast transforms as evaluation schemes
DFT
DCT
DCT
DLT
DHT
๐‘“๐‘˜ =
๐‘−1
๐‘›
๐‘
๐‘ง
,
๐‘›=0 ๐‘› ๐‘˜
๐‘ง๐‘˜ = ๐‘’ −2๐œ‹๐‘–๐‘˜/๐‘
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘๐‘œ๐‘ (๐‘›๐œƒ๐‘˜ ) ,
๐‘›=0 ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘‡ (๐‘๐‘œ๐‘ ๐œƒ๐‘˜ )
๐‘›=0 ๐‘› ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘ƒ (๐‘๐‘œ๐‘ ๐œƒ๐‘˜ )
๐‘›=0 ๐‘› ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐ฝ
๐‘›=0 ๐‘› ๐‘ฃ
Alex Townsend @MIT
๐œƒ๐‘˜ =
๐‘—๐‘ฃ,๐‘› ๐‘Ÿ๐‘˜ , ๐‘Ÿ๐‘˜ =
๐’›๐ŸŽ
๐‘˜๐œ‹
๐‘−1
๐’›๐Ÿ
๐’›๐Ÿ
๐œƒ0 ๐œƒ1
๐‘—๐‘ฃ,๐‘›
๐‘—๐‘ฃ,๐‘
,
๐‘—๐‘ฃ,๐‘› = ๐‘›๐‘กโ„Ž ๐‘Ÿ๐‘œ๐‘œ๐‘ก ๐‘œ๐‘“ ๐ฝ๐‘ฃ ๐‘ง
16/22
Part II: Fast transforms based on asymptotic expansions
Fast transforms as evaluation schemes
DFT
DCT
DCT
DLT
DHT
๐‘“๐‘˜ =
๐‘−1
๐‘›
๐‘
๐‘ง
,
๐‘›=0 ๐‘› ๐‘˜
๐‘ง๐‘˜ = ๐‘’ −2๐œ‹๐‘–๐‘˜/๐‘
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘๐‘œ๐‘ (๐‘›๐œƒ๐‘˜ ) ,
๐‘›=0 ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘‡ (๐‘๐‘œ๐‘ ๐œƒ๐‘˜ )
๐‘›=0 ๐‘› ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘ƒ (๐‘๐‘œ๐‘ ๐œƒ๐‘˜ )
๐‘›=0 ๐‘› ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐ฝ
๐‘›=0 ๐‘› ๐‘ฃ
Alex Townsend @MIT
๐œƒ๐‘˜ =
๐‘—๐‘ฃ,๐‘› ๐‘Ÿ๐‘˜ , ๐‘Ÿ๐‘˜ =
๐’›๐ŸŽ
๐‘˜๐œ‹
๐‘−1
๐’›๐Ÿ
๐’›๐Ÿ
๐œƒ0 ๐œƒ1
๐‘—๐‘ฃ,๐‘›
๐‘—๐‘ฃ,๐‘
,
๐‘—๐‘ฃ,๐‘› = ๐‘›๐‘กโ„Ž ๐‘Ÿ๐‘œ๐‘œ๐‘ก ๐‘œ๐‘“ ๐ฝ๐‘ฃ ๐‘ง
16/22
Part II: Fast transforms based on asymptotic expansions
Fast transforms as evaluation schemes
DFT
DCT
DCT
DLT
DHT
๐‘“๐‘˜ =
๐‘−1
๐‘›
๐‘
๐‘ง
,
๐‘›=0 ๐‘› ๐‘˜
๐‘ง๐‘˜ = ๐‘’ −2๐œ‹๐‘–๐‘˜/๐‘
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘๐‘œ๐‘ (๐‘›๐œƒ๐‘˜ ) ,
๐‘›=0 ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘‡ (๐‘๐‘œ๐‘ ๐œƒ๐‘˜ )
๐‘›=0 ๐‘› ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘ƒ (๐‘๐‘œ๐‘ ๐œƒ๐‘˜ )
๐‘›=0 ๐‘› ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐ฝ
๐‘›=0 ๐‘› ๐‘ฃ
Alex Townsend @MIT
๐œƒ๐‘˜ =
๐‘—๐‘ฃ,๐‘› ๐‘Ÿ๐‘˜ , ๐‘Ÿ๐‘˜ =
๐’›๐ŸŽ
๐‘˜๐œ‹
๐‘−1
๐’›๐Ÿ
๐’›๐Ÿ
๐œƒ0 ๐œƒ1
๐‘—๐‘ฃ,๐‘›
๐‘—๐‘ฃ,๐‘
,
๐‘—๐‘ฃ,๐‘› = ๐‘›๐‘กโ„Ž ๐‘Ÿ๐‘œ๐‘œ๐‘ก ๐‘œ๐‘“ ๐ฝ๐‘ฃ ๐‘ง
16/22
Part II: Fast transforms based on asymptotic expansions
Fast transforms as evaluation schemes
DFT
DCT
DCT
DLT
DHT
๐‘“๐‘˜ =
๐‘−1
๐‘›
๐‘
๐‘ง
,
๐‘›=0 ๐‘› ๐‘˜
๐‘ง๐‘˜ = ๐‘’ −2๐œ‹๐‘–๐‘˜/๐‘
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘๐‘œ๐‘ (๐‘›๐œƒ๐‘˜ ) ,
๐‘›=0 ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘‡ (๐‘๐‘œ๐‘ ๐œƒ๐‘˜ )
๐‘›=0 ๐‘› ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐‘ƒ (๐‘๐‘œ๐‘ ๐œƒ๐‘˜ )
๐‘›=0 ๐‘› ๐‘›
๐‘“๐‘˜ =
๐‘−1
๐‘ ๐ฝ
๐‘›=0 ๐‘› ๐‘ฃ
Alex Townsend @MIT
๐œƒ๐‘˜ =
๐‘—๐‘ฃ,๐‘› ๐‘Ÿ๐‘˜ , ๐‘Ÿ๐‘˜ =
๐’›๐ŸŽ
๐‘˜๐œ‹
๐‘−1
๐’›๐Ÿ
๐’›๐Ÿ
๐œƒ0 ๐œƒ1
๐‘—๐‘ฃ,๐‘›
๐‘—๐‘ฃ,๐‘
,
๐‘—๐‘ฃ,๐‘› = ๐‘›๐‘กโ„Ž ๐‘Ÿ๐‘œ๐‘œ๐‘ก ๐‘œ๐‘“ ๐ฝ๐‘ฃ ๐‘ง
16/22
Part II: Fast transforms based on asymptotic expansions
Related work
James Cooley
Leslie Greengard
Emmanuel Candes
Daniel Potts
Ahmed, Tukey, Gauss,
Gentleman, Natarajan,
Rao
Alpert, Barnes, Hut,
Martinsson, Rokhlin,
Mohlenkamp, Tygert
Boag, Demanet,
Michielssen,
O’Neil, Ying
Driscoll, Healy,
Steidl, Tasche
Many others: Candel, Cree, Johnson, Mori, Orszag, Suda, Sugihara, Takami, etc.
Fast transforms are very important.
Alex Townsend @MIT
17/22
Part II: Fast transforms based on asymptotic expansions
Asymptotic expansions as a matrix decomposition
The asymptotic expansion
cos
๐‘€−1
๐‘ƒ๐‘› (cos ๐œƒ๐‘˜ ) = ๐ถ๐‘›
โ„Ž๐‘š,๐‘›
1
1 ๐œ‹
๐‘š + ๐‘› + ๐œƒ๐‘˜ − ๐‘š +
2
2 2
(2 sin ๐œƒ๐‘˜ )
๐‘š=0
๐‘š + 1/2
+ ๐‘…๐‘€,๐‘› (๐œƒ๐‘˜ )
gives a matrix decomposition (sum of diagonally scaled DCTs and DSTs):
๐‘€−1
๐‘ท๐‘ต =
๐ท๐‘ข ๐‘š ๐‘ช๐‘ต ๐ท๐ถโ„Ž๐‘š + ๐ท๐‘ฃ๐‘š
๐‘š=0
๐‘ท๐‘ต
Alex Townsend @MIT
=
0
0
0 ๐‘บ๐‘ต−๐Ÿ
0
0
๐‘จ๐‘บ๐’€
๐‘ท๐‘ต
0
0 ๐ท๐ถโ„Ž๐‘š + ๐‘น๐‘ด,๐‘ต
0
+
๐‘น๐‘ด,๐‘ต
18/22
Part II: Fast transforms based on asymptotic expansions
Be careful and stay safe
Error curve: ๐‘…๐‘€,๐‘› ๐œƒ๐‘˜
=๐œ–
Fix M. Where is the asymptotic
expansion accurate?
๐‘น๐‘ด,๐‘ต =
2๐ถ๐‘› โ„Ž๐‘€,๐‘›
๐‘…๐‘€,๐‘› (๐œƒ๐‘˜ ) ≤
(2 sin ๐œƒ๐‘˜ )๐‘€+1/2
Alex Townsend @MIT
19/22
Part II: Fast transforms based on asymptotic expansions
Partitioning and balancing competing costs
Theorem
The matrix-vector product ๐‘“ = PN ๐‘ can
be computed in ๐’ช (๐‘((log ๐‘)2 / log log ๐‘)
operations.
0
1
α too small
Alex Townsend @MIT
20/22
Part II: Fast transforms based on asymptotic expansions
Partitioning and balancing competing costs
Theorem
The matrix-vector product ๐‘“ = PN ๐‘ can
be computed in ๐’ช(๐‘((log ๐‘)2 / log log ๐‘)
operations.
0
1
α too small
Alex Townsend @MIT
20/22
Part II: Fast transforms based on asymptotic expansions
Partitioning and balancing competing costs
Theorem
The matrix-vector product ๐‘“ = ๐๐ ๐‘ can
be computed in ๐’ช(๐‘((log ๐‘)2 / log log ๐‘)
operations.
0
1
α too small
Alex Townsend @MIT
20/22
Part II: Fast transforms based on asymptotic expansions
Partitioning and balancing competing costs
Theorem
The matrix-vector product ๐‘“ = PN ๐‘ can
be computed in ๐’ช(๐‘((log ๐‘)2 / log log ๐‘)
operations.
0
1
α too large
Alex Townsend @MIT
20/22
Part II: Fast transforms based on asymptotic expansions
Partitioning and balancing competing costs
Theorem
The matrix-vector product ๐‘“ = PN ๐‘ can
be computed in ๐’ช(๐‘((log ๐‘)2 / log log ๐‘)
operations.
0
1
α = O (1/ log ๐‘)
(j)
PN ๐‘
PNEVAL ๐‘
2
๐’ช
Alex Townsend @MIT
N (log N)
(
)
log log ๐‘
2
๐’ช
N (log N)
(
)
log log ๐‘
20/22
Part II: Fast transforms based on asymptotic expansions
Numerical results
Modification of rough signals
Execution time
100
0.15
Direct approach
Using asymptotics
0.1
0.05
0
10-1
-0.05
-0.1
-2
10
-0.15
-0.2
10-3
102
10
3
N
10
4
-0.25
105
0.3
0.32
x
1
No precomputation.
๐‘ƒ๐‘› ๐‘ฅ
−1
Alex Townsend @MIT
๐‘’ −๐‘–๐œ”๐‘ก ๐‘‘๐‘ฅ
=
๐‘–๐‘š
0.34
2๐œ‹
๐ฝ 1 (−๐œ”)
−๐œ” ๐‘š+2
21/22
Future work
Fast spherical harmonic transform
Spherical harmonic transform:
Existing approaches
Precomputation
Fast transform
Direct approach
4
๐‘−1
๐‘™
๐›ผ๐‘™๐‘š ๐‘ƒ๐‘™ ๐‘š
๐‘“ ๐œƒ, ๐œ™ =
(cos ๐œƒ)๐‘’ ๐‘–๐‘š๐œ™
๐‘™=0 ๐‘š=−๐‘™
[Mohlenkamp, 1999]
[Rokhlin & Tygert, 2006]
[Tygert, 2008]
Execution time
10
102
100
10-2
103
104
105
N
A new generation of fast algorithms with no precomputation.
Alex Townsend @MIT
22/22
Thank you
Alex Townsend @MIT
References
• D. H. Bailey, K. Jeyabalan, and X. S. Li, A comparison of three high-precision quadrature schemes, 2005.
• P. Baratella and I. Gatteschi, The bounds for the error term of an asymptotic approximation of Jacobi
polynomials, Lecture notes in Mathematics, 1988.
• Z. Battels and L. N. Trefethen, An extension of Matlab to continuous functions and operators, SISC,
2004.
• I. Bogaert, Iteration-free computation of Gauss–Legendre quadrature nodes and weights, SISC, 2014.
• G. H. Golub and J. H. Welsch, Calculation of Gauss quadrature rules, Math. Comput., 1969.
• N. Hale and A. Townsend, Fast and accurate computation of Gauss–Legendre and Gauss–Jacobi
quadrature nodes and weights, SISC, 2013.
• N. Hale and A. Townsend, A fast, simple, and stable Chebyshev–Legendre transform using an asymptotic
formula, SISC, 2014.
• Y. Nakatsukasa, V. Noferini, and A. Townsend, Computing the common zeros of two bivariate functions
via Bezout resultants, Numerische Mathematik, 2014.
Alex Townsend @MIT
References
• F. W. J. Olver, Asymptotics and Special Functions, Academic Press, New York, 1974.
• A. Townsend and L. N. Trefethen, An extension of Chebfun to two dimensions, SISC, 2013.
• A. Townsend, T. Trogdon, and S. Olver, Fast computation of Gauss quadrature nodes and weights on the
whole real line, to appear in IMA Numer. Anal., 2015.
• A. Townsend, The race to compute high-order Gauss quadrature, SIAM News, 2015.
• A. Townsend, A fast analysis-based discrete Hankel transform using asymptotics expansions, submitted,
2015.
• F. G. Tricomi, Sugli zeri dei polinomi sferici ed ultrasferici, Ann. Mat. Pura. Appl., 1950.
Alex Townsend @MIT
Download