Introduction Computation of the coefficients Validation Conclusion
Rigorous Uniform Approximation of D-finite Functions Alexandre Benoit 1 , Mioara Jolde¸s 1
and Marc Mezzarobba
CNRS, INRIA, UPMC (France) 2
3
2
Uppsala University (Sweden)
ENS de Lyon, CNRS, INRIA (France)
POLSYS Seminar February 17, 2012
3
Introduction Computation of the coefficients Validation Conclusion
I Introduction
2 / 32
Introduction Computation of the coefficients Validation Conclusion
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 = ar y (r) + ar−1 y (r−1) + · · · + a0 y = 0,
ai ∈ Q[x].
(1)
3 / 32
Introduction Computation of the coefficients Validation Conclusion
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 = ar y (r) + ar−1 y (r−1) + · · · + a0 y = 0,
ai ∈ Q[x].
(1)
Examples f (x) = exp(x)
↔
{f 0 − f = 0, f (0) = 1}.
3 / 32
Introduction Computation of the coefficients Validation Conclusion
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 = ar y (r) + ar−1 y (r−1) + · · · + a0 y = 0,
ai ∈ Q[x].
(1)
Examples f (x) = exp(x) ↔ {f 0 − f = 0, f (0) = 1}. cos, arccos, Airy functions, Bessel functions, ...
3 / 32
Introduction Computation of the coefficients Validation Conclusion
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 = ar y (r) + ar−1 y (r−1) + · · · + a0 y = 0,
ai ∈ Q[x].
(1)
Examples f (x) = exp(x) ↔ {f 0 − f = 0, f (0) = 1}. cos, arccos, Airy functions, Bessel functions, ... About 60% of Abramowitz & Stegun
3 / 32
Introduction Computation of the coefficients Validation Conclusion
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 = ar y (r) + ar−1 y (r−1) + · · · + a0 y = 0,
ai ∈ Q[x].
(1)
Differential equation + initial conditions = Data Structure
Examples f (x) = exp(x) ↔ {f 0 − f = 0, f (0) = 1}. cos, arccos, Airy functions, Bessel functions, ... About 60% of Abramowitz & Stegun
3 / 32
Introduction Computation of the coefficients Validation Conclusion
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 = ar y (r) + ar−1 y (r−1) + · · · + a0 y = 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 X
fi xi
i=0
3 / 32
Introduction Computation of the coefficients Validation Conclusion
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 R such that |p(x) − f (x)| < R for all x in [−1, 1].
4 / 32
Introduction Computation of the coefficients Validation Conclusion
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 R such that |p(x) − f (x)| < R 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
4 / 32
Introduction Computation of the coefficients Validation Conclusion
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
5 / 32
Introduction Computation of the coefficients Validation Conclusion
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
5 / 32
Introduction Computation of the coefficients Validation Conclusion
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
5 / 32
Introduction Computation of the coefficients Validation Conclusion
Recall: Basic Properties of Chebyshev Polynomials Tn (cos(θ)) = cos(nθ)
6 / 32
Introduction Computation of the coefficients Validation Conclusion
Recall: Basic Properties of Chebyshev Polynomials Tn (cos(θ)) = cos(nθ) Z
1
−1
0 Tn (x)Tm (x) √ π dx = π 1 − x2 2
Tn+1 (x) = 2xTn (x) − Tn−1 (x)
if m 6= n if m = 0 otherwise
(1 − x2 )Tn00 (x) − xTn0 (x) + n2 Tn (x)
6 / 32
Introduction Computation of the coefficients Validation Conclusion
Recall: Basic Properties of Chebyshev Polynomials Tn (cos(θ)) = cos(nθ) Z
1
−1
0 Tn (x)Tm (x) √ π dx = π 1 − x2 2
Tn+1 (x) = 2xTn (x) − Tn−1 (x)
if m 6= n if m = 0 otherwise
(1 − x2 )Tn00 (x) − xTn0 (x) + n2 Tn (x)
T0 (x) = 1 T1 (x) = x
bn/2c
Tn (x) =
X k=0
(−1)k 2n−2k−1
n − k n−2k n T2 (x) = 2x2 − 1 x n−k k T3 (x) = 4x3 − 3x T4 (x) = 8x4 − 8x2 + 1 6 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series vs Taylor Series I
Two approximations of a function f : by Taylor series f=
or by Chebyshev series +∞ X
cn x n ,
+∞ X
f=
f (n) (0) , cn = n!
tn Tn (x),
n=−∞
n=0
tn =
1 π
Z
1
f (t) Tn (t) √ dt. 1 − t2 −1
7 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series vs Taylor Series I: Example
ex − (1 + 12 x2 + 16 x3 + 0.01
−1
−1/2
1 4 24 x )
ex − (1,2660T0 (x) + 1,1303T1 (x) + 0,2714T2 (x) + 0,0443T3 (x) + 0,0054T4 (x)) x 1/2
1
−0.01
8 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev truncations are near-best
Let f be continuous on [−1, 1] with degree n Chebyshev truncation fn and best approximant pn (the polynomial of degree at most n that minimizes kf − pk∞ = sup−16x61 |f (x) − p(x)|), n > 1. Then kf − fn k∞ 6
4+ |
4 kf − pn k∞ . log(n + 1) π2 {z } Λn
9 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev truncations are near-best
Let f be continuous on [−1, 1] with degree n Chebyshev truncation fn and best approximant pn (the polynomial of degree at most n that minimizes kf − pk∞ = sup−16x61 |f (x) − p(x)|), n > 1. Then kf − fn k∞ 6
4+ |
4 kf − pn k∞ . log(n + 1) π2 {z } Λn
Λ10 = 4.93... → we lose at most 3 bits Λ30 = 5.37... → we lose at most 3 bits Λ100 = 5.87... → we lose at most 3 bits Λ1000 = 6.80... → we lose at most 3 bits
9 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev truncations are near-best : Example
ex − (1,2660T0 (x) + 1,1303T1 (x) + 0,2714T2 (x) + 0,0443T3 (x) + 0,0054T4 (x))
5.10−3
−1
−1/2
1/2 −5.10−3
1
x ex − (1.0000 + 0.9973x +0.4988x2 + 0.1773x3 +0.0441x4 )
Chebyshev truncation of degree 4 Best approximant of degree 4
10 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series vs Taylor Series II Convergence Domains : For Taylor series: disc centered at x0 = 0 which avoids all the singularities of f
11 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series vs Taylor Series II Convergence Domains : For Taylor series: disc centered at x0 = 0 which avoids all the singularities of f
Taylor series can not converge over entire [−1,1] unless all singularities lie outside the unit circle.
11 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series vs Taylor Series II 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.
11 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series vs Taylor Series II 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. X Chebyshev series converge over entire [−1,1] as soon as there are no real singularities in [−1,1]. 11 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series vs Taylor Series II: Example
Approximation of arctan(2x) by Taylor expansion of degree 1 1.5 1 0.5 x −1
−0.5
0
0.5
−0.5 −1 −1.5
arctan(2x) Taylor approximation
12 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series vs Taylor Series II: Example
Approximation of arctan(2x) by Chebyshev expansion of degree 1 1.5 1 0.5 x −1
−0.5
0
0.5
1
−0.5 −1 −1.5
arctan(2x) Taylor approximation Chebyshev approximation
12 / 32
Introduction Computation of the coefficients Validation Conclusion
Previous Work Computation of the Chebyshev coefficients for D-finite functions L´anczos (1938) – τ method Clenshaw (1957) – iterative computation like Miller Recurrence relation Fox & Parker (1968) – small orders, link with Clenshaw Paszkowski (1975) – general case Geddes (1977), Rebillard (1998), Benoit & Salvy (2009) – symbolic computation Interval arithmetic using truncated Chebyshev expansions Kaucher & Miranker (1984) – ultra-arithmetic Brisebarre & Jolde¸s (2010) – ChebModels 13 / 32
Introduction Computation of the coefficients Validation Conclusion
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 R such that |f (x) − p(x)| < R, x ∈ [−1,1] in O(d) arithmetic operations.
14 / 32
Introduction Computation of the coefficients Validation Conclusion
II Computation of the coefficients
15 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series of D-finite Functions Theorem (60’s, BenoitJoldesMezzarobba12) P
un Tn (x) is solution of a linear differential equation with polynomial coefficients iff the sequence un is cancelled by a linear recurrence with polynomial coefficients.
16 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series of D-finite Functions Theorem (60’s, BenoitJoldesMezzarobba12) P
un Tn (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 computation of the coefficients P 1 n x Taylor: exp = n! un Rec: un+1 = n+1 u0 = 1
1/0! = 1
u1 = 1
1/1! = 1
u2 = 0,5
1/2! = 0,5
.. . u50 ≈ 3,28.10−65
.. . 1/50! ≈ 3,28.10−65 16 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series of D-finite Functions Theorem (60’s, BenoitJoldesMezzarobba12) P
un Tn (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 computation of the coefficients P 1 n x Taylor: exp = n! un Rec: un+1 = n+1
P Chebyshev: exp = In (1)Tn (x) Rec: un+1 = −2nun + un−1
1/0! = 1
u0 = 1,266
I0 (1) ≈ 1,266
u1 = 1
1/1! = 1
u1 = 0,565
I1 (1) ≈ 0,565
u2 = 0,5
1/2! = 0,5
u2 ≈ 0,136
I2 (1) ≈ 0,136
u0 = 1
.. . u50 ≈ 3,28.10−65
.. .
.. .
.. .
1/50! ≈ 3,28.10−65 16 / 32
Introduction Computation of the coefficients Validation Conclusion
Chebyshev Series of D-finite Functions Theorem (60’s, BenoitJoldesMezzarobba12) P
un Tn (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 computation of the coefficients P 1 n x Taylor: exp = n! un Rec: un+1 = n+1
P Chebyshev: exp = In (1)Tn (x) Rec: un+1 = −2nun + un−1
1/0! = 1
u0 = 1,266
I0 (1) ≈ 1,266
u1 = 1
1/1! = 1
u1 = 0,565
I1 (1) ≈ 0,565
u2 = 0,5
1/2! = 0,5
u2 ≈ 0,136
I2 (1) ≈ 0,136
u0 = 1
.. . u50 ≈ 3,28.10−65
.. . 1/50! ≈ 3,28.10−65
.. . u50 ≈ 4,450.1067
.. . I50 (1) ≈ 2,934.10−80 16 / 32
Introduction Computation of the coefficients Validation Conclusion
Convergent and Divergent Solutions of the Recurrence
Study of the Chebyshev recurrence If un is solution, then there exists another solution vn ∼ u1n
Newton polygon of a Chebyshev recurrence
n
κ−2 = · · · = κ2 κ−3 κ3 S
17 / 32
Introduction Computation of the coefficients Validation Conclusion
Convergent and Divergent Solutions of the Recurrence
Study of the Chebyshev recurrence
Newton polygon of a Chebyshev recurrence
n
If un is solution, then there exists another solution vn ∼ u1n
κ−2 = · · · = κ2 κ−3 κ3 S
For the recurrence un+1 + 2nun − un−1 Two independent solutions are In (1) ∼
1 (2n)!
and Kn (1) ∼ (2n)!
17 / 32
Introduction Computation of the coefficients Validation Conclusion
Convergent and Divergent Solutions of the Recurrence
Study of the Chebyshev recurrence
Newton polygon of a Chebyshev recurrence
n
If un is solution, then there exists another solution vn ∼ u1n
κ−2 = · · · = κ2 κ−3 κ3 S
For the recurrence un+1 + 2nun − un−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 uN = 0 and uN −1 = 1 and compute the first coefficients using the recurrence backwards Normalize u with the initial condition of the recurrence
17 / 32
Introduction Computation of the coefficients Validation Conclusion
Back to exp Example y(x) = ex =
u0 u1 u2
P∞
n=−∞ cn
cn+1 + 2n cn − cn−1 = 0
Tn (x)
c0 c1 c2 .. .
.. .
u50 u51 u52
c50 c51 c52
18 / 32
Introduction Computation of the coefficients Validation Conclusion
Back to exp Example y(x) = ex =
u0 u1 u2
P∞
n=−∞ cn
cn+1 + 2n cn − cn−1 = 0
Tn (x)
c0 c1 c2 .. .
u50 u51 = u52 =
1 0
.. .
c50 c51 c52
18 / 32
Introduction Computation of the coefficients Validation Conclusion
Back to exp Example y(x) = ex =
u0 u1 u2
P∞
n=−∞ cn
cn+1 + 2n cn − cn−1 = 0
Tn (x)
c0 c1 c2 .. .
u50 ≈ u51 = u52 =
1,02 · 102 1 0
.. .
c50 c51 c52
18 / 32
Introduction Computation of the coefficients Validation Conclusion
Back to exp Example y(x) = ex =
P∞
n=−∞ cn
u0 u1 u2 ≈ −4,72 · 1080 .. . u50 ≈ u51 = u52 =
1,02 · 102 1 0
cn+1 + 2n cn − cn−1 = 0
Tn (x)
c0 c1 c2
.. .
c50 c51 c52
18 / 32
Introduction Computation of the coefficients Validation Conclusion
Back to exp Example y(x) = ex =
P∞
n=−∞ cn
u0 u1 ≈ 1,96 · 1081 u2 ≈ −4,72 · 1080 .. . u50 ≈ u51 = u52 =
1,02 · 102 1 0
cn+1 + 2n cn − cn−1 = 0
Tn (x)
c0 c1 c2
.. .
c50 c51 c52
18 / 32
Introduction Computation of the coefficients Validation Conclusion
Back to exp Example y(x) = ex =
P∞
n=−∞ cn
u0 ≈ −4,40 · 1081 u1 ≈ 1,96 · 1081 u2 ≈ −4,72 · 1080 .. . u50 ≈ u51 = u52 =
1,02 · 102 1 0
cn+1 + 2n cn − cn−1 = 0
Tn (x)
c0 c1 c2
.. .
c50 c51 c52
18 / 32
Introduction Computation of the coefficients Validation Conclusion
Back to exp Example y(x) = ex =
P∞
n=−∞ cn
u0 ≈ −4,40 · 1081 u1 ≈ 1,96 · 1081 u2 ≈ −4,72 · 1080 .. . u50 ≈ u51 = u52 = S=
1,02 · 102 1 0 50 X
cn+1 + 2n cn − cn−1 = 0
Tn (x)
c0 c1 c2
.. .
c50 c51 c52
un Tn (0) ≈ −3,48 · 1081
n=−50
18 / 32
Introduction Computation of the coefficients Validation Conclusion
Back to exp Example y(x) = ex =
P∞
n=−∞ cn
u0 ≈ −4,40 · 1081 u1 ≈ 1,96 · 1081 u2 ≈ −4,72 · 1080 .. . u50 ≈ u51 = u52 = S=
cn := un /S
1,02 · 102 1 0 50 X
cn+1 + 2n cn − cn−1 = 0
Tn (x)
c0 ≈ 1,27 c1 ≈ −5,65 · 10−1 c2 ≈ 1,36 · 10−1 .. . c50 ≈ c51 ≈ c52 ≈
2,93 · 10−80 2,88 · 10−82 0
un Tn (0) ≈ −3,48 · 1081
n=−50
18 / 32
Introduction Computation of the coefficients Validation Conclusion
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
19 / 32
Introduction Computation of the coefficients Validation Conclusion
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 Theorem This algorithm runs in O(N ) arithmetic operations 19 / 32
Introduction Computation of the coefficients Validation Conclusion
Quality of polynomial approximations 1.5e–142 4e–52
2e–97 1e–142
2e–52
x/2 √e x+16
–1 –0.8 –0.6 –0.4 –0.2
1e–97
0.2 0.4 0.6 0.8 x
1
–1 –0.8 –0.6 –0.4 –0.2
5e–143 0.2 0.4 0.6 0.8 x
1
0.2 0.4 0.6 0.8 x
1
0.2 0.4 0.6 0.8 x
1
0.2 0.4 x 0.6 0.8
1
–5e–143
–1e–97
–2e–52
–1 –0.8 –0.6 –0.4 –0.2
–1e–142 –2e–97
–4e–52
–1.5e–142
8e–44
4e–168 1e–102
6e–44
3 cos x − sin x 2
4e–44
2e–168
5e–103
2e–44 –1 –0.8 –0.6 –0.4 –0.2 –2e–44
0.2 0.4 0.6 0.8 x
1
–1 –0.8 –0.6 –0.4 –0.2 0
0.2 0.4 0.6 0.8 x
1
–5e–103
–4e–44 –6e–44
–2e–168
–1e–102 –4e–168
–8e–44
1e–23
8e–16
3e–08
6e–16
2e–08
5e–24
4e–16 1e–08 –1 –0.8 –0.6 –0.4 –0.2
e1/(1+2x
2
–1 –0.8 –0.6 –0.4 –0.2 0
0.2 0.4 x 0.6 0.8
) –1e–08
1
2e–16 –1 –0.8 –0.6 –0.4 –0.2 0 –2e–16
0.2 0.4 x 0.6 0.8
–4e–16 –2e–08
–1 –0.8 –0.6 –0.4 –0.2 0 –5e–24
–6e–16
–3e–08
–8e–16
–4e–08
–1e–15
degree = 30
1
degree = 60
–1e–23
degree = 90
20 / 32
Introduction Computation of the coefficients Validation Conclusion
III Validation
21 / 32
Introduction Computation of the coefficients Validation Conclusion
Our Work
Given a linear differential equation with polynomial coefficients, boundary conditions and an integer d X 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 R such that |f (x) − p(x)| < R, x ∈ [−1,1] in O(d) arithmetic operations.
22 / 32
Introduction Computation of the coefficients Validation Conclusion
Fixed Point Theorem Applied to a Differential Equation
f is solution of y 0 (x) − a(x)y(x) = 0, with y(0) = y0 , if and only if f is a fixed point of τ defined by Z t τ (y)(t) = y0 + a(x)y(x)dx. 0
23 / 32
Introduction Computation of the coefficients Validation Conclusion
Fixed Point Theorem Applied to a Differential Equation
f is solution of y 0 (x) − a(x)y(x) = 0, with y(0) = y0 , if and only if f is a fixed point of τ defined by Z t τ (y)(t) = y0 + a(x)y(x)dx. 0
For all rational functions a(x), if
kakj∞ < 1 then ∀i > j, τ i is a contraction map. j!
23 / 32
Introduction Computation of the coefficients Validation Conclusion
Compute a Sharp Bound
For all rational functions a(x), if
kakj∞ < 1 then ∀i > j, τ i is a contraction map. j!
24 / 32
Introduction Computation of the coefficients Validation Conclusion
Compute a Sharp Bound
For all rational functions a(x), if
kakj∞ < 1 then ∀i > j, τ i is a contraction map. j!
Given p, find i, pi and Ri such that τ i (B(p,R)) ⊂ B(pi ,Ri ) ⊂ B(p,R)
24 / 32
Introduction Computation of the coefficients Validation Conclusion
Compute a Sharp Bound For all rational functions a(x), if
kakj∞ < 1 then ∀i > j, τ i is a contraction map. j!
Given p, find i, pi and Ri such that τ i (B(p,R)) ⊂ B(pi ,Ri ) ⊂ B(p,R)
R p
Ri pi τi
24 / 32
Introduction Computation of the coefficients Validation Conclusion
Compute a Sharp Bound For all rational functions a(x), if
kakj∞ < 1 then ∀i > j, τ i is a contraction map. j!
Given p, find i, pi and Ri such that τ i (B(p,R)) ⊂ B(pi ,Ri ) ⊂ B(p,R)
R p τi
Ri
f ∈ B(p, R) =⇒ f = τ i (f ) ∈ B(pi , Ri )
pi
kf − pk∞ 6 kf − pi k∞ + kp − pi k∞ 6 Ri + kp − pi k∞ 6 R 24 / 32
Introduction Computation of the coefficients Validation Conclusion
Algorithm for a Differential Equation of Order 1 Given p and τ find i, pi and Ri such that τ i (B(p,R)) ⊂ B(pi ,Ri ) ⊂ B(p,R)
Algorithm (Find R) p0 := p i
while i! < kak∞ Compute pi (t) a rigorous approximation of y0 + Mi = kτ (pi−1 ) − pi k∞
Rt
Return R=
kpi − pk∞ + 1−
Pi
j=1
Mj
0
a(x)pi−1 (x)dx
kakj∞ j!
kaki∞ i!
25 / 32
Introduction Computation of the coefficients Validation Conclusion
Algorithm for a Differential Equation of Order 1 Given p and τ find i, pi and Ri such that τ i (B(p,R)) ⊂ B(pi ,Ri ) ⊂ B(p,R)
Algorithm (Find R) p0 := p i
while i! < kak∞ Compute pi (t) a rigorous approximation of y0 + Mi = kτ (pi−1 ) − pi k∞
Rt
Return R=
kpi − pk∞ + 1−
Ri =
Pi
j=1
Mj
0
a(x)pi−1 (x)dx
kakj∞ j!
kaki∞ i!
i j X kak∞ Mj |t|i i + kak∞ R j! i! j=1 25 / 32
Introduction Computation of the coefficients Validation Conclusion
General Algorithm Algorithm INPUT: a differential equation L = y (r) + ar−1 y (r−1) + · · · + a0 y and initial conditions y r−1 , . . . ,y 0 and a polynomial p OUTPUT: a real R > 0 such that ky − pk∞ < R (r−1)
(1)
(0)
p0 := p; p0 = p0 ; . . . ; p0
= p(r−1)
r−1
Compute A > max kak k∞ k=0
for i = 0,1, . . . while γi := (r−1)
pi+1
:= y (r−1) (0) +
for k from r − 2 to 0
Ai e i! t
Z
6
1 2 (r−1)
ar−1 pi
(r−2)
+ ar−2 pi
(0)
+ · · · + a0 pi
0
(k)
Compute pi+1 := y (k) (0) +
x
Z 0
(k+1)
pi+1
α := reA+1
(r−1) Compute βi 6 p(r−1) − pi
∞
Return
α+βi 1−γi 26 / 32
Introduction Computation of the coefficients Validation Conclusion
General Algorithm Algorithm INPUT: a differential equation L = y (r) + ar−1 y (r−1) + · · · + a0 y and initial conditions y r−1 , . . . ,y 0 and a polynomial p OUTPUT: a real such that (r−1)
(1)
(0)
p0 := p; p0 = p0 ; . . . ; p0
= p(r−1)
r−1
Compute A > max kak k∞
O(1) arithmetic operations
k=0
for i = 0,1, . . . while γi := (r−1)
pi+1
:= y (r−1) (0) +
for k from r − 2 to 0
Ai e i! t
Z
6
1 2 (r−1)
ar−1 pi
(r−2)
+ ar−2 pi
(0)
+ · · · + a0 pi
0
(k)
Compute pi+1 := y (k) (0) +
x
Z 0
(k+1)
pi+1
α := reA+1
(r−1) Compute βi 6 p(r−1) − pi
∞
Return
α+βi 1−γi 26 / 32
Introduction Computation of the coefficients Validation Conclusion
General Algorithm Algorithm INPUT: a differential equation L = y (r) + ar−1 y (r−1) + · · · + a0 y and initial conditions y r−1 , . . . ,y 0 and a polynomial p OUTPUT: a real such that (r−1)
(1)
(0)
p0 := p; p0 = p0 ; . . . ; p0
= p(r−1)
r−1
Compute A > max kak k∞
O(1) arithmetic operations
k=0
for i = 0,1, . . . while γi := (r−1)
pi+1
:= y (r−1) (0) +
for k from r − 2 to 0
Ai e i! t
Z
6
1 2 (r−1)
ar−1 pi
(r−2)
+ ar−2 pi
(0)
+ · · · + a0 pi
O(d)
0
(k)
Compute pi+1 := y (k) (0) +
x
Z 0
(k+1)
pi+1
α := reA+1
(r−1) Compute βi 6 p(r−1) − pi
∞
Return
α+βi 1−γi 26 / 32
Introduction Computation of the coefficients Validation Conclusion
General Algorithm Algorithm INPUT: a differential equation L = y (r) + ar−1 y (r−1) + · · · + a0 y and initial conditions y r−1 , . . . ,y 0 and a polynomial p OUTPUT: a real such that (r−1)
(1)
(0)
p0 := p; p0 = p0 ; . . . ; p0
= p(r−1)
r−1
Compute A > max kak k∞
O(1) arithmetic operations
k=0
for i = 0,1, . . . while γi := (r−1)
pi+1
:= y (r−1) (0) +
for k from r − 2 to 0
Ai e i! t
Z
6
1 2 (r−1)
ar−1 pi
(r−2)
+ ar−2 pi
(0)
+ · · · + a0 pi
O(d)
0
(k)
Compute pi+1 := y (k) (0) +
x
Z 0
(k+1)
pi+1
O(d) arithmetic operations
α := reA+1
(r−1) Compute βi 6 p(r−1) − pi
∞
Return
α+βi 1−γi 26 / 32
Introduction Computation of the coefficients Validation Conclusion
General Algorithm Algorithm INPUT: a differential equation L = y (r) + ar−1 y (r−1) + · · · + a0 y and initial conditions y r−1 , . . . ,y 0 and a polynomial p OUTPUT: a real such that (r−1)
(1)
(0)
p0 := p; p0 = p0 ; . . . ; p0
= p(r−1)
r−1
Compute A > max kak k∞
O(1) arithmetic operations
k=0
for i = 0,1, . . . while γi := (r−1)
pi+1
:= y (r−1) (0) +
for k from r − 2 to 0
Ai e i! t
Z
6
1 2 (r−1)
ar−1 pi
(r−2)
+ ar−2 pi
(0)
+ · · · + a0 pi
O(d)
0
(k)
Compute pi+1 := y (k) (0) +
x
Z 0
(k+1)
pi+1
O(d) arithmetic operations
α := reA+1
(r−1) Compute βi 6 p(r−1) − pi
∞
Return
O(d) arithmetic operations
α+βi 1−γi 26 / 32
Introduction Computation of the coefficients Validation Conclusion
IV Conclusion
27 / 32
Introduction Computation of the coefficients Validation Conclusion
Our Work
Given a linear differential equation with polynomial coefficients, boundary conditions and an integer d X Compute a polynomial approximation p on [−1,1] of degree d of the solution f in the Chebyshev basis in O(d) arithmetic operations. X Compute a sharp bound R such that |f (x) − p(x)| < R, x ∈ [−1,1] in O(d) arithmetic operations.
28 / 32
Introduction Computation of the coefficients Validation Conclusion
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 R of the approximation with the second algorithm return the pair P, R
29 / 32
Introduction Computation of the coefficients Validation Conclusion
Quality of Bounds
log10 x/2 √e x+16
3 cos x−sin x 2
e1/(1+2x
2
)
(bounds computed) ky−pk∞
4,8
0,58
0, 57
3,1
3,7
4,1
0,57 0,56 0,56 degree = 30 degree = 60 degree = 90
30 / 32
Introduction Computation of the coefficients Validation Conclusion
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 .
31 / 32
Introduction Computation of the coefficients Validation Conclusion
Perspectives
A faster, more robust and public version of the code
32 / 32
Introduction Computation of the coefficients Validation Conclusion
Perspectives
A faster, more robust and public version of the code What about other expansions (Gegenbauer polynomials, Hermite polynomials, Laguerre polynomials)?
32 / 32
Introduction Computation of the coefficients Validation Conclusion
Perspectives
A faster, more robust and public version of the code What about other expansions (Gegenbauer polynomials, Hermite polynomials, Laguerre polynomials)? What about the solution of non linear differential equation (ex: tan(x))? Newton method instead of use of recurrence relation
32 / 32