Rigorous Uniform Approximation of D-finite Functions Mioara Joldes - - PowerPoint PPT Presentation

rigorous uniform approximation of d finite functions
SMART_READER_LITE
LIVE PREVIEW

Rigorous Uniform Approximation of D-finite Functions Mioara Joldes - - PowerPoint PPT Presentation

Rigorous Uniform Approximation of D-finite Functions Mioara Joldes Joint work with Alexandre Benoit , Marc Mezzarobba Ecole Normale Sup erieure de Lyon, Ar enaire Team, Laboratoire de lInformatique du Parall


slide-1
SLIDE 1

Rigorous Uniform Approximation

  • f D-finite Functions

Mioara Joldes∗

Joint work with

Alexandre Benoit∗∗, Marc Mezzarobba∗∗

∗ ´ Ecole Normale Sup´ erieure de Lyon, Ar´ enaire Team, Laboratoire de l’Informatique du Parall´ elisme ∗∗INRIA Roquencourt, Algorithms Team 1 / 20

slide-2
SLIDE 2

D-finite Functions

Definition A function y : R → R is D-finite if it is solution of a (homogeneous) linear differential equation with polynomial coefficients: L · y = ary(r) + ar−1y(r−1) + · · · + a0y = 0, ai ∈ Q[x]. (1)

2 / 20

slide-3
SLIDE 3

D-finite Functions

Definition A function y : R → R is D-finite if it is solution of a (homogeneous) linear differential equation with polynomial coefficients: L · y = ary(r) + ar−1y(r−1) + · · · + a0y = 0, ai ∈ Q[x]. (1) Examples f(x) = exp(x) ↔ {f ′ − f = 0, f(0) = 1}.

2 / 20

slide-4
SLIDE 4

D-finite Functions

Definition A function y : R → R is D-finite if it is solution of a (homogeneous) linear differential equation with polynomial coefficients: L · y = ary(r) + ar−1y(r−1) + · · · + a0y = 0, ai ∈ Q[x]. (1) Examples f(x) = exp(x) ↔ {f ′ − f = 0, f(0) = 1}. cos, arccos, Airy functions, Bessel functions, ...

2 / 20

slide-5
SLIDE 5

D-finite Functions

Definition A function y : R → R is D-finite if it is solution of a (homogeneous) linear differential equation with polynomial coefficients: L · y = ary(r) + ar−1y(r−1) + · · · + a0y = 0, ai ∈ Q[x]. (1) Examples f(x) = exp(x) ↔ {f ′ − f = 0, f(0) = 1}. cos, arccos, Airy functions, Bessel functions, ... About 60% of Abramowitz & Stegun

2 / 20

slide-6
SLIDE 6

D-finite Functions

Definition A function y : R → R is D-finite if it is solution of a (homogeneous) linear differential equation with polynomial coefficients: L · y = ary(r) + ar−1y(r−1) + · · · + a0y = 0, ai ∈ Q[x]. (1) Differential equation + initial conditions = Data Structure Examples f(x) = exp(x) ↔ {f ′ − f = 0, f(0) = 1}. cos, arccos, Airy functions, Bessel functions, ... About 60% of Abramowitz & Stegun

2 / 20

slide-7
SLIDE 7

D-finite Functions

Definition A function y : R → R is D-finite if it is solution of a (homogeneous) linear differential equation with polynomial coefficients: L · y = ary(r) + ar−1y(r−1) + · · · + a0y = 0, ai ∈ Q[x]. (1) Differential equation + initial conditions = Data Structure How can we approximate a D-finite function f? Polynomial approximation: f(x) ≈

n

  • i=0

fixi

2 / 20

slide-8
SLIDE 8

Uniform Approximation of D-finite Functions

Problem Given an integer d, and a D-finite function f specified by a differential equation with polynomial coefficients and suitable boundary conditions, find the coefficients of a polynomial p(x) of degree d and a “small” bound B such that |p(x) − f(x)| < B for all x in [−1, 1].

3 / 20

slide-9
SLIDE 9

Uniform Approximation of D-finite Functions

Problem Given an integer d, and a D-finite function f specified by a differential equation with polynomial coefficients and suitable boundary conditions, find the coefficients of a polynomial p(x) of degree d and a “small” bound B such that |p(x) − f(x)| < B for all x in [−1, 1]. Applications: Repeated evaluation on a line segment Plot Numerical integration Computation of minimax approximation polynomials using the Remez algorithm

3 / 20

slide-10
SLIDE 10

Rigorous Uniform Approximation of D-finite Functions

Why?

Get the correct answer, not an “almost” correct one Bridge the gap between scientific computing and pure mathematics - speed and reliability

4 / 20

slide-11
SLIDE 11

Rigorous Uniform Approximation of D-finite Functions

Why?

Get the correct answer, not an “almost” correct one Bridge the gap between scientific computing and pure mathematics - speed and reliability

How?

Use Floating-Point as support for fast computations Bound roundoff, discretization, truncation errors in numerical algorithms Compute enclosures instead of approximations

4 / 20

slide-12
SLIDE 12

Rigorous Uniform Approximation of D-finite Functions

Why?

Get the correct answer, not an “almost” correct one Bridge the gap between scientific computing and pure mathematics - speed and reliability

How?

Use Floating-Point as support for fast computations Bound roundoff, discretization, truncation errors in numerical algorithms Compute enclosures instead of approximations

What?

Interval arithmetic

4 / 20

slide-13
SLIDE 13

Chebyshev Series vs Taylor Series I

Two approximations of f: by Taylor series f =

+∞

  • n=0

cnxn, cn = f (n)(0) n! ,

  • r by Chebyshev series

f =

+∞

  • n=−∞

tnTn(x), tn = 1 π 1

−1

Tn(t) f(t) √ 1 − t2 dt. Basic properties of Chebyshev polynomials Tn(cos(θ)) = cos(nθ) 1

−1

Tn(x)Tm(x) √ 1 − x2 dx =    if m = n π if m = 0

π 2

  • therwise

Tn+1 = 2xTn − Tn−1 T0(x) = 1 T1(x) = x T2(x) = 2x2 − 1 T3(x) = 4x3 − 3x

5 / 20

slide-14
SLIDE 14

Chebyshev Series vs Taylor Series I

Two approximations of f: by Taylor series f =

+∞

  • n=0

cnxn, cn = f (n)(0) n! ,

  • r by Chebyshev series

f =

+∞

  • n=−∞

tnTn(x), tn = 1 π 1

−1

Tn(t) f(t) √ 1 − t2 dt. −1 −0.5 0.5 1 x −0.05 −0.025 0.025 0.05 Error of approximation for exp(x)

Taylor expansion

  • f order 3

Chebyshev expansion

  • f order 3

5 / 20

slide-15
SLIDE 15

Chebyshev Series vs Taylor Series II

x Bad approximation outside its circle of convergence −1 −0.5 0.5 1 −1.5 −1 −0.5 0.5 1 1.5 arctan(2x) Taylor approximation

6 / 20

slide-16
SLIDE 16

Chebyshev Series vs Taylor Series II

x Approximation of arctan(2x) by Chebyshev expansion of degree 11 −1 −0.5 0.5 1 −1.5 −1 −0.5 0.5 1 1.5 arctan(2x) Chebyshev approximation Taylor approximation

6 / 20

slide-17
SLIDE 17

Chebyshev Series vs Taylor Series III

Convergence Domains : For Taylor series: disc centered at x0 = 0 which avoids all the singularities of f For Chebyshev series: elliptic disc with foci at ±1 which avoids all the singularities of f

7 / 20

slide-18
SLIDE 18

Chebyshev Series vs Taylor Series III

Convergence Domains : For Taylor series: disc centered at x0 = 0 which avoids all the singularities of f For Chebyshev series: elliptic disc with foci at ±1 which avoids all the singularities of f Taylor series can not converge over entire [−1, 1] unless all singularities lie outside the unit circle.

7 / 20

slide-19
SLIDE 19

Chebyshev Series vs Taylor Series III

Convergence Domains : For Taylor series: disc centered at x0 = 0 which avoids all the singularities of f For Chebyshev series: elliptic disc with foci at ±1 which avoids all the singularities of f Taylor series can not converge over entire [−1, 1] unless all singularities lie outside the unit circle. Chebyshev series converge over entire [−1, 1] as soon as there are no real singularities in [−1, 1].

7 / 20

slide-20
SLIDE 20

Chebyshev Series vs Taylor Series IV

Truncation Error : Taylor series, Lagrange formula: ∀x ∈ [−1, 1], ∃ξ ∈ [−1, 1] s.t. f(x) − T(x) = f (n+1)(ξ) (n + 1)! (x − x0)n+1.

8 / 20

slide-21
SLIDE 21

Chebyshev Series vs Taylor Series IV

Truncation Error : Taylor series, Lagrange formula: ∀x ∈ [−1, 1], ∃ξ ∈ [−1, 1] s.t. f(x) − T(x) = f (n+1)(ξ) (n + 1)! (x − x0)n+1. Chebyshev series, Bernstein-like formula: ∀x ∈ [−1, 1], ∃ξ ∈ [−1, 1] s.t. f(x) − P(x) = f (n+1)(ξ) 2n(n + 1)!.

8 / 20

slide-22
SLIDE 22

Chebyshev Series vs Taylor Series IV

Truncation Error : Taylor series, Lagrange formula: ∀x ∈ [−1, 1], ∃ξ ∈ [−1, 1] s.t. f(x) − T(x) = f (n+1)(ξ) (n + 1)! (x − x0)n+1. Chebyshev series, Bernstein-like formula: ∀x ∈ [−1, 1], ∃ξ ∈ [−1, 1] s.t. f(x) − P(x) = f (n+1)(ξ) 2n(n + 1)!. [] We should have an improvement of 2n in the width of the Chebyshev truncation error.

8 / 20

slide-23
SLIDE 23

Quality of approximation of truncated Chebyshev series compared to best polynomial approximation

It is well-known that truncated Chebyshev series πd(f) are near-best uniform approximations [Chap 5.5, Mason & Handscomb 2003].

9 / 20

slide-24
SLIDE 24

Quality of approximation of truncated Chebyshev series compared to best polynomial approximation

It is well-known that truncated Chebyshev series πd(f) are near-best uniform approximations [Chap 5.5, Mason & Handscomb 2003]. Let p∗

d is the polynomial of degree at most d that minimizes

f − p∞ = sup−1≤x≤1 |f(x) − p(x)|.

9 / 20

slide-25
SLIDE 25

Quality of approximation of truncated Chebyshev series compared to best polynomial approximation

It is well-known that truncated Chebyshev series πd(f) are near-best uniform approximations [Chap 5.5, Mason & Handscomb 2003]. Let p∗

d is the polynomial of degree at most d that minimizes

f − p∞ = sup−1≤x≤1 |f(x) − p(x)|. f − πd(f)∞ 4 π2 log d + O(1)

  • Λd

f − p∗

d∞

(2)

9 / 20

slide-26
SLIDE 26

Quality of approximation of truncated Chebyshev series compared to best polynomial approximation

It is well-known that truncated Chebyshev series πd(f) are near-best uniform approximations [Chap 5.5, Mason & Handscomb 2003]. Let p∗

d is the polynomial of degree at most d that minimizes

f − p∞ = sup−1≤x≤1 |f(x) − p(x)|. f − πd(f)∞ 4 π2 log d + O(1)

  • Λd

f − p∗

d∞

(2) Λ10 = 2.22... → we lose at most 2 bits Λ30 = 2.65... → we lose at most 2 bits Λ100 = 3.13... → we lose at most 3 bits Λ500 = 3.78... → we lose at most 3 bits

9 / 20

slide-27
SLIDE 27

Previous Work

Computation of the Chebyshev coefficients for D-finite functions

Using a relation between coefficients Clenshaw (1957) Using the recurrence relation between the coefficients Fox-Parker (1968) The tau method of Lanczos (1938), Ortiz (1969-1993)

Validation:

Kaucher-Miranker (1984) Monomial basis: Verified integration of Taylor Models (Makino & Berz, 1998)

10 / 20

slide-28
SLIDE 28

Our Work

Given a linear differential equation with polynomial coefficients, boundary conditions and an integer d Compute a polynomial approximation p on [−1, 1] of degree d of the solution f in the Chebyshev basis in O(d) arithmetic operations. Compute a sharp bound B such that |f(x) − p(x)| < B, x ∈ [−1, 1] in O(d) arithmetic operations.

11 / 20

slide-29
SLIDE 29

Chebyshev Series of D-finite Functions

Theorem (60’s, BenoitJoldesMezzarobba11) unTn(x) is solution of a linear differential equation with polynomial coefficients iff the sequence un is cancelled by a linear recurrence with polynomial coefficients.

12 / 20

slide-30
SLIDE 30

Chebyshev Series of D-finite Functions

Theorem (60’s, BenoitJoldesMezzarobba11) unTn(x) is solution of a linear differential equation with polynomial coefficients iff the sequence un is cancelled by a linear recurrence with polynomial coefficients. Recurrence relation + good initial conditions ⇒ Fast numerical computa- tion of the coefficients

Taylor: exp = 1

n!xn

Rec: u(n + 1) = u(n)

n+1

u(0) = 1 1/0! = 1 u(1) = 1 1/1! = 1 u(2) = 0, 5 1/2! = 0, 5 . . . . . . u(50) ≈ 3, 28.10−65 1/50! ≈ 3, 28.10−65

12 / 20

slide-31
SLIDE 31

Chebyshev Series of D-finite Functions

Theorem (60’s, BenoitJoldesMezzarobba11) unTn(x) is solution of a linear differential equation with polynomial coefficients iff the sequence un is cancelled by a linear recurrence with polynomial coefficients. Recurrence relation + good initial conditions ⇒ Fast numerical computa- tion of the coefficients

Taylor: exp = 1

n!xn

Rec: u(n + 1) = u(n)

n+1

u(0) = 1 1/0! = 1 u(1) = 1 1/1! = 1 u(2) = 0, 5 1/2! = 0, 5 . . . . . . u(50) ≈ 3, 28.10−65 1/50! ≈ 3, 28.10−65 Chebyshev: exp = In(1)Tn(x) Rec: u(n + 1) = −2nu(n) + u(n − 1) u(0) = 1, 266 I0(1) ≈ 1, 266 u(1) = 0, 565 I1(1) ≈ 0, 565 u(2) ≈ 0, 136 I2(1) ≈ 0, 136 . . . . . .

12 / 20

slide-32
SLIDE 32

Chebyshev Series of D-finite Functions

Theorem (60’s, BenoitJoldesMezzarobba11) unTn(x) is solution of a linear differential equation with polynomial coefficients iff the sequence un is cancelled by a linear recurrence with polynomial coefficients. Recurrence relation + good initial conditions ⇒ Fast numerical computa- tion of the coefficients

Taylor: exp = 1

n!xn

Rec: u(n + 1) = u(n)

n+1

u(0) = 1 1/0! = 1 u(1) = 1 1/1! = 1 u(2) = 0, 5 1/2! = 0, 5 . . . . . . u(50) ≈ 3, 28.10−65 1/50! ≈ 3, 28.10−65 Chebyshev: exp = In(1)Tn(x) Rec: u(n + 1) = −2nu(n) + u(n − 1) u(0) = 1, 266 I0(1) ≈ 1, 266 u(1) = 0, 565 I1(1) ≈ 0, 565 u(2) ≈ 0, 136 I2(1) ≈ 0, 136 . . . . . . u(50) ≈ 4, 450.1067 I50(1) ≈ 2, 934.10−80

12 / 20

slide-33
SLIDE 33

Convergent and Divergent Solutions of the Recurrence

Study of the Chebyshev recurrence If u(n) is solution, then there exists another solution v(n) ∼

1 u(n)

S n κ−3 κ−2 = · · · = κ2 κ3

Newton polygon of a Chebyshev recurrence

13 / 20

slide-34
SLIDE 34

Convergent and Divergent Solutions of the Recurrence

Study of the Chebyshev recurrence If u(n) is solution, then there exists another solution v(n) ∼

1 u(n)

S n κ−3 κ−2 = · · · = κ2 κ3

Newton polygon of a Chebyshev recurrence

For the recurrence u(n + 1) + 2nu(n) − u(n − 1) Two independent solutions are In(1) ∼

1 (2n)! and Kn(1) ∼ (2n)!

13 / 20

slide-35
SLIDE 35

Convergent and Divergent Solutions of the Recurrence

Study of the Chebyshev recurrence If u(n) is solution, then there exists another solution v(n) ∼

1 u(n)

S n κ−3 κ−2 = · · · = κ2 κ3

Newton polygon of a Chebyshev recurrence

For the recurrence u(n + 1) + 2nu(n) − u(n − 1) Two independent solutions are In(1) ∼

1 (2n)! and Kn(1) ∼ (2n)!

Miller’s algorithm To compute the first N coefficients of the most convergent solution of a recurrence relation of order 2 Initialize u(N) = 0 and u(N − 1) = 1 and compute the first coefficients using the recurrence backwards Normalize u with the initial condition of the recurrence

13 / 20

slide-36
SLIDE 36

Algorithm for Computing the Coefficients

Algorithm Input: a differential equation of order r with boundary conditions Output: a polynomial approximation of degree N of the solution compute the Chebyshev recurrence of order 2s ≥ 2r for i from 1 to s

using the recurrence relation backwards, compute the first N coefficients of the sequence u[i] starting with the initial conditions

  • u[i](N + 2s), · · · , u[i](N + i), · · · , u[i](N + 1)
  • = (0, · · · , 1, · · · , 0)

combine the s sequences u[i] according to the r boundary conditions and the s − r symmetry relations

14 / 20

slide-37
SLIDE 37

Example: Back to exp

u(52) = 0 I52(1) ≈ 2, 77.10−84 u(51) = 1 I51(1) ≈ 2, 88.10−82 u(50) = −102 I50(1) ≈ 2, 93.10−80 . . . . . . u(2) ≈ −4, 72.1080 I2(1) ≈ 0, 14 u(1) ≈ 1, 96.1081 I1(1) ≈ −0, 57 u(0) ≈ −4, 4.1081 I0(1) ≈ 1, 27

15 / 20

slide-38
SLIDE 38

Example: Back to exp

u(52) = 0 I52(1) ≈ 2, 77.10−84 u(51) = 1 I51(1) ≈ 2, 88.10−82 u(50) = −102 I50(1) ≈ 2, 93.10−80 . . . . . . u(2) ≈ −4, 72.1080 I2(1) ≈ 0, 14 u(1) ≈ 1, 96.1081 I1(1) ≈ −0, 57 u(0) ≈ −4, 4.1081 I0(1) ≈ 1, 27 C =

50

  • n=−50

u(n)Tn(0) ≈ −3, 48.1081

15 / 20

slide-39
SLIDE 39

Example: Back to exp

u(52) C = 0 I52(1) ≈ 2, 77.10−84 u(51) C ≈ −2, 88.10−82 I51(1) ≈ 2, 88.10−82 u(50) C ≈ 2, 93.10−80 I50(1) ≈ 2, 93.10−80 . . . . . . u(2) C ≈ 0, 14 I2(1) ≈ 0, 14 u(1) C ≈ −0, 57 I1(1) ≈ −0, 57 u(0) C ≈ 1.27 I0(1) ≈ 1, 27 C =

50

  • n=−50

u(n)Tn(0) ≈ −3, 48.1081

15 / 20

slide-40
SLIDE 40

Our Work

Given a linear differential equation with polynomial coefficients, boundary conditions and an integer d Compute a polynomial approximation p on [−1, 1] of degree d of the solution f in the Chebyshev basis in O(d) arithmetic operations. Compute a sharp bound B such that |f(x) − p(x)| < B, x ∈ [−1, 1] in O(d) arithmetic operations.

16 / 20

slide-41
SLIDE 41

Validation

Fixed Point Theorem Applied to a Differential Equation: f is solution of y′(x) − a(x)y(x) = 0, with y(0) = y0, if and only if f is a fixed point of τ defined by τ(y)(t) = y0 + t a(x)y(x)dx.

17 / 20

slide-42
SLIDE 42

Validation

Fixed Point Theorem Applied to a Differential Equation: f is solution of y′(x) − a(x)y(x) = 0, with y(0) = y0, if and only if f is a fixed point of τ defined by τ(y)(t) = y0 + t a(x)y(x)dx. For all rational functions a(x), if aj

j! < 1 then ∀i j, τ i is a contraction map.

17 / 20

slide-43
SLIDE 43

Algorithm for a Differential Equation of Order 1

Given p, compute a sharp bound B such that |f(x) − p(x)| < B, x ∈ [−1, 1]. Algorithm (Find B) p0 := p while i! < ai

Compute pi(t) a rigorous approximation of τ(pi−1) = t

0 a(x)pi−1(x)dx s.t. τ(pi−1) − pi∞ < M.

Return B = pi − p∞ + M i

j=1 aj−1

j!

1 − ai

i!

18 / 20

slide-44
SLIDE 44

Final Algorithm

Algorithm INPUT: Differential equation with boundary conditions and a degree d OUTPUT: a polynomial approximation of degree d and a bound Compute an approximation P of degree d of the solution with the first algorithm Compute the bound B of the approximation with the second algorithm. return the pair P, B

19 / 20

slide-45
SLIDE 45

Random Example

Example (x + 5)y(3)(x) + (−x3 − 5x2 + 4x + 5)y(2)(x) + (6x3 + 6 + 3x)y(1)(x) + (−3x3 − x2 − 2x + 4)y(x) = 0, y(0) = −6, y(1)(0) = 1, y(2)(0) = −2 Compute coefficients of polynomial of degree 30. Validated bound: 0.58 · 10−14.

20 / 20