79
Numerical Integration with the double exponential method Pascal Molin Universit´ e Paris 7 December 7 2016

Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

  • Upload
    others

  • View
    8

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Numerical Integration with the doubleexponential method

Pascal Molin

Universite Paris 7

December 7 2016

Page 2: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Numerical integration

Number-theory context, want

• fast quadrature

• high precision (100 – 1000 digits)• rational recognition• algebraic dependencies, LLL

• robust scheme• little knowledge of the integrand• yet can assume holomorphicity around path

• rigorous evaluation• non-vanishing, inequalities• algebraic

Page 3: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Digits matter

Closed form is not always the best answer

maple > int(x*sin(x)/(1+cos(x)^2), x = 0 .. Pi);

− dilog

(√2 + 1 + i

1 +√

2

)+ dilog

(−−√

2− 1 + i

1 +√

2

)− dilog

(−−√

2 + 1 + i√2− 1

)

+ dilog

(−1 + i +

√2√

2− 1

)+ arctan

((1 +√

2)−1

− arctan

((√2− 1

)−1)

π + i ln(

1 +√

2)

π + 1/2 π2

Page 4: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Digits matter

Closed form is not always the best answer

maple > int(x*sin(x)/(1+cos(x)^2), x = 0 .. Pi);

gp > intnum(x=0,Pi ,x*sin(x)/(1+ cos(x)^2))

time = 13 ms.

%1 = 2.467401100272339654708622749969037783828424851810

1976627632693961518636709387861570677553877848752081045

646137448039

Page 5: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Digits matter

Closed form is not always the best answer

maple > int(x*sin(x)/(1+cos(x)^2), x = 0 .. Pi);

gp > intnum(x=0,Pi ,x*sin(x)/(1+ cos(x)^2))

time = 13 ms.

%1 = 2.467401100272339654708622749969037783828424851810

1976627632693961518636709387861570677553877848752081045

646137448039

+ PSLQ algorithm (integer relations with precomputed values)

gp > Pi^2/4

%1 = 2.467401100272339654708622749969037783828424851810

1976566033373440550112056048013107504433509296380579560

064784435058

Page 6: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Classical quadrature schemes

• Trapeze sums better than rectangles !error = O(n−2) for n evaluations

• Simpson, Newton-Cotes degree d spline interpolation on eachsubintervalerror = O(n−2d ) for nd evaluations

• Romberg convergence accelerationerror = O(n−2k) for 2k/2n evaluations (k steps)

• Gauss-Legendre interpolation at n chosen points, exact ondegree 2n− 1 polynomialserror = O(2−2n)

Page 7: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method

[Takahasi&Mori,1973]

• trapezoidal method over R for doubly-exponential decay|g(x)| 6 Me−e|x|

h ≈ 1D ≈ log D

heuristic : D digits with O(D logD) points

• changes of variable to obtain DE decay

0

0

0

0

−1 1

−∞

−∞

−∞∞

∞x = sinh(t)

x = et−e−t

t = sinh(u)

t = tanh(u)

|g(x)| 6 Me−e|x|

| f (x)| 6 Me−|x|, x ∈ R

| f (x)| 6 Me−x, x > 0

| f (x)| 6 M(1 + |x|)−α, x ∈ R

| f (x)| 6 M, x ∈ [−1, 1]

Page 8: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Empirics

[Bailey 2005] best quadrature scheme for number theory(speed + accuracy)

• fast

gp > \p100

gp > 4* intnum(x=0,1,x*log(x+1))

time = 14 ms.

%2 = 1.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

gp > 4* intnumgauss(x=0,1,x*log(x+1))

time = 19 ms.

%3 = 1.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

• accurate

• robust

Page 9: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Empirics

[Bailey 2005] best quadrature scheme for number theory(speed + accuracy)

• fast

gp > \p 1000

realprecision = 1001 significant digits (1000 digits

displayed)

gp > intnum(x=0,1,x*log(x+1));

time = 3,246 ms.

gp > intnumgauss(x=0,1,x*log(x+1));

*** Warning: increasing stack size to 32000000.

*** Warning: increasing stack size to 64000000.

*** Warning: increasing stack size to 128000000.

*** Warning: increasing stack size to 256000000.

time = 30 ,423 ms.

• accurate

• robust

Page 10: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Empirics

[Bailey 2005] best quadrature scheme for number theory(speed + accuracy)

• fast

• accurate

gp > intnum(x=0,1,x*log(x))

time = 14 ms.

%1 = -0.25000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

00000000000000

gp > intnumgauss(x=0,1,x*log(x))

time = 19 ms.

%2 = -0.25000000448649530558757830200299989514057330235

6835605745518959212321987270474757122932173702286501430

74963128606435

• robust

Page 11: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Empirics

[Bailey 2005] best quadrature scheme for number theory(speed + accuracy)

• fast

• accurate

gp > intnum(x=0,1,sqrt(1-x^2)) * 4/Pi

time = 5 ms.

%1 = 1.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

• robust

Page 12: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Empirics

[Bailey 2005] best quadrature scheme for number theory(speed + accuracy)

• fast

• accurate

gp > intnum(x=0,1,sqrt(1-x^2)) * 4/Pi

time = 5 ms.

%1 = 1.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

gp > intnumgauss(x=0,1,sqrt(1-x^2)) * 4/Pi

time = 18 ms.

%1 = 1.000000286463908470354375633627249273003797220743

2167639511533708680221900564078271532895898313322892930

763641691204

• robust

Page 13: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Empirics

[Bailey 2005] best quadrature scheme for number theory(speed + accuracy)

• fast

• accurate

• robust

gp > intnum(x=0,1,log(x)^2)

time = 14 ms.

%1 = 2.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

Page 14: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Empirics

[Bailey 2005] best quadrature scheme for number theory(speed + accuracy)

• fast

• accurate

• robust

gp > intnum(x=0,1,log(x)^2)

time = 14 ms.

%1 = 2.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

gp > intnumgauss(x=0,1,log(x)^2)

time = 20 ms.

%1 = 1.998170459969516682680365932684925456223320054322

9711947692188636817125658226006547163057700016844660462

689430885953

Page 15: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Empirics

[Bailey 2005] best quadrature scheme for number theory(speed + accuracy)

• fast

• accurate

• robust

gp > intnum(x = 0, [oo , -I], x^2*sin(x))

time = 29 ms.

%1 = -2.00000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

0000000000000

Page 16: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Bugs ?

• singularities near path

gp > \p100

gp > intnum(x=-oo ,oo ,1/(1+x^2)) / Pi

time = 16 ms.

%2 = 1.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

•∫ +∞−∞ 6= limX→∞

∫ X−X

Page 17: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Bugs ?

• singularities near path

gp > \p100

gp > intnum(x=-oo ,oo ,1/(1+x^2)) / Pi

time = 16 ms.

%2 = 1.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

gp > intnum(t=-oo ,oo ,1/(1+(t+10) ^2)) / Pi

time = 16 ms.

%1 = 0.999999999999876739612997768794457195527823511776

3458420119197269929116675799604762796484496038848214401

177797163801

•∫ +∞−∞ 6= limX→∞

∫ X−X

Page 18: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Bugs ?

• singularities near path

•∫ +∞−∞ 6= limX→∞

∫ X−X

gp > intnum(x=[-oo ,2],[oo ,2],exp(-x^2)) / sqrt(Pi)

time = 14 ms.

%1 = 1.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

Page 19: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Bugs ?

• singularities near path

•∫ +∞−∞ 6= limX→∞

∫ X−X

gp > intnum(x=[-oo ,2],[oo ,2],exp(-x^2)) / sqrt(Pi)

time = 14 ms.

%1 = 1.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

gp > exp ( -20^2)

%1 = 1.915169596714005695019839778654264350742092776222

4476815510803711208823236786880029753900707165845733104

968501416357E-174

Page 20: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Bugs ?

• singularities near path

•∫ +∞−∞ 6= limX→∞

∫ X−X

gp > intnum(x=[-oo ,2],[oo ,2],exp(-x^2)) / sqrt(Pi)

time = 14 ms.

%1 = 1.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

gp > intnum(x=-20,20,exp(-x^2)) / sqrt(Pi)

time = 12 ms.

%1 = 1.000000000000002171913128719400151168160573203252

0043625063044171387297015982259875406312344525643336088

293798898199

Page 21: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Bugs ?

• singularities near path

•∫ +∞−∞ 6= limX→∞

∫ X−X

gp > intnum(x=[-oo ,2],[oo ,2],exp(-x^2)) / sqrt(Pi)

time = 14 ms.

%1 = 1.000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000

000000000000

gp > intnum(x=-50,50,exp(-x^2)) / sqrt(Pi)

time = 12 ms.

%1 = 1.006443542467627139937375144219884765922069561414

6399507808257263295706810888904251228004775028119537486

495559341342

Page 22: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Goal : rigorous convergence

TheoremLet f : [−1, 1]→ C such that f has holomorphic continuation

to B(0, 2) = {|z | < 2}. Then

∣∣∣∣∣∫ 1

−1f (x)dx −

n

∑k=−n

wk f (xk)

∣∣∣∣∣ 6 8 supB(0,2)

|f | 2−10n

log(n+2) (1)

for xk , wk given by

xk = tanh(sinh(kh)) and wk =h cosh(kh)

cosh(sinh(kh))2(2)

where h = log(n+2)n+2+2/7 log(n)

.

Page 23: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Comparison with Gauss

TheoremLet f : [−1, 1]→ C such that f has holomorphic continuation

to B(0, 2) = {|z | < 2}. Then

∣∣∣∣∣∫ 1

−1f (x)dx −

n

∑k=−n

wk f (xk)

∣∣∣∣∣ 6(

π supD(0,2)

|f |)

2−2n (3)

for xk , wk given by

Pn(xk) = 0 and wk =−2

(n+ 1)P ′n(xk)Pn+1(xk)(4)

where Pn are Legendre polynomials

{P0(x) = 0,P1(x) = 1

(k + 1)Pk+1(x) = (2k + 1)xPk(x)− kPk−1(x)(5)

Page 24: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Comparison with Gauss

Integral of usual functions to D digits.

method Gauss DE

# points D D logDcost points D3 logD D2 logD

cost integral D2 log2 D D2 log3 D

many nice integrals XX Xsingle nice integral X XX

unknown behaviour 5 X

Page 25: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Theory

Page 26: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Poisson formula

g(x) = O(x−2), g ∈ C 2(R), g(X ) =∫

Re−2iπXtg(t)dt

∑k∈Z

g(k) = ∑k∈Z

g(k)

h ∑|k |>n

g(kh)

︸ ︷︷ ︸¬

+ hn

∑k=−n

g(kh) =∫

Rg + ∑

k∈Z∗g(

k

h)

︸ ︷︷ ︸­

h nh−nh

Page 27: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Poisson formula

g(x) = O(x−2), g ∈ C 2(R), g(X ) =∫

Re−2iπXtg(t)dt

∑k∈Z

g(k) = ∑k∈Z

g(k)

h ∑|k |>n

g(kh)

︸ ︷︷ ︸¬

+ hn

∑k=−n

g(kh) =∫

Rg + ∑

k∈Z∗g(

k

h)

︸ ︷︷ ︸­

Errors ¬(nh) and ­( 1h ).

Summation interesting when both g and g vanish quickly(exponentially).

Page 28: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Poisson summation

• g(x) = sin xx , g(x) = 1[− 1

2π , 12π ]

∑k

sin(k)

k=∫

R

sin(x)

xdt

¬(nh) + ­(h) 6 e−D ⇒ n ≈ eD

• g(x) = e−x2, g(x) = e−πx2

¬(nh) + ­(h) 6 e−D ⇒ n ≈ D

π

• g(x) = e−a cosh(x), g(x) = 2Ki2πx (a) ∼ e−π2x√x

¬(nh) + ­(h) 6 e−D ⇒ n ≈ D log(D)

π2

Page 29: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Poisson summation

• g(x) = sin xx , g(x) = 1[− 1

2π , 12π ]

∑k

sin(mk)

k=∫

R

sin(mx)

xdt for m = 1, . . . 6

¬(nh) + ­(h) 6 e−D ⇒ n ≈ eD

• g(x) = e−x2, g(x) = e−πx2

¬(nh) + ­(h) 6 e−D ⇒ n ≈ D

π

• g(x) = e−a cosh(x), g(x) = 2Ki2πx (a) ∼ e−π2x√x

¬(nh) + ­(h) 6 e−D ⇒ n ≈ D log(D)

π2

Page 30: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Bad news I

g and g cannot have both arbitrary decay.

Theorem (Uncertainty principle)

Let g : R→ R with g 6= 0.

If

{g(x) = O(e−α1|x |β1

)

g(x) = O(e−α2|x |β2)

then1

β1+

1

β2> 1.

In particular

¬ + ­ 6 e−D ⇒ n > D1

β1+ 1

β2 .

Optimal case : the gaussian g(x) = exp(−σx2).

Page 31: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Paley-Wiener theory

The decay of g corresponds to the regularity of g :

• g has finite support ⇔ g entire of order 6 1

• g has more than exponential decay ⇒ g entire

• g holomorphic on a strip R + i [−t, t] ⇒ g(x) = O(e−2πtx )

Page 32: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Control of g

TheoremIf g : R→ C has holomorphic continuation to a strip

∆τ = R + i [−τ, τ] such that

• ‖g(· − iτ)‖1 + ‖g(·+ iτ)‖1 = M2(τ) < ∞ ;

• g(x ± it)→x→±∞ 0 uniformly on t < τ ;

then |g(x)| 6 M2(τ)e−2πτ|x |.

Page 33: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Control of g

TheoremIf g : R→ C has holomorphic continuation to a strip

∆τ = R + i [−τ, τ] such that

• ‖g(· − iτ)‖1 + ‖g(·+ iτ)‖1 = M2(τ) < ∞ ;

• g(x ± it)→x→±∞ 0 uniformly on t < τ ;

then |g(x)| 6 M2(τ)e−2πτ|x |.

e−2iπxtg(t)

e2πxτ · e−2iπxtg(t + iτ )

iτ−∞ ∞

R

Page 34: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Control of g

TheoremIf g : R→ C has holomorphic continuation to a strip

∆τ = R + i [−τ, τ] such that

• ‖g(· − iτ)‖1 + ‖g(·+ iτ)‖1 = M2(τ) < ∞ ;

• g(x ± it)→x→±∞ 0 uniformly on t < τ ;

then |g(x)| 6 M2(τ)e−2πτ|x |.

Goal : find best decay for g such that it remains holomorphic ona strip.

Page 35: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Bad news II

TheoremeIf g : R→ C satisfies

• |g(x)| 6 M1e−αeβ|x |

on R (DE) ;

• g has bounded holomorphic continuation on a strip ∆τ withβτ > π

2

then g = 0.

In particular

• cannot expect more than DE decay for g

• for DE functions : ¬ + ­ 6 e−D ⇒ n > D log(D)π2

Page 36: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Good news

DE decay extends near the axis.

Theorem (Phragmen-Lindelof)

If g is holomorphic on a strip ∆τ and satisfies

• |g | = O(e−αeβ|x |) sur R ;

• |g | 6 M sur ∆τ ;

then for all t < τ, |g(x ± it)| 6 Me−αteβ|x |

, with

αt = α(cos(βt)− sin(βt)tan(βτ)

).

→ easy to control g from DE hypothesis

Page 37: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Main theorem

Let g : R→ R such that

1 g has analytic continuation to a strip ∆τ = R + i ]− τ, τ[ ;

2 |g(x)| 6 M1e−αeβ|x |

on R with α, β > 0 ;

3 |g(z)| 6 M2 on ∆τ ;

then for any D > 0 there are explicit values n, h with

n ∼ (D + logM2) log(D + logM1)

2πτβand h ∼ 2πτ

D + logM2

such that∣∣∣∣∣∫

Rg − h

n

∑k=−n

g(kh)

∣∣∣∣∣ 6 ¬ + ­ 6 e−D .

Page 38: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

∆′τ

I

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

ϕ(∆τ) ⊂ ∆′τ

f holomorphic on ∆′τ.

Page 39: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

| f (x)| 6 M1e−α|x|β−∞ ∞

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

ϕ(t) = sinh(t) =et − e−t

2

ϕ′(t) = cosh(t)

f holomorphic on ∆′τ.

Page 40: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

τsin(τ)

∆′τ

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

ϕ(t) = sinh(t) =et − e−t

2

ϕ′(t) = cosh(t)

f holomorphic on ∆′τ.

Page 41: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

τsin(τ)

| f (z)| 6 M2eA|z|γ

| f (x)| 6 M1e−α|x|β

∆′τ

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

ϕ(t) = sinh(sinh(t))

ϕ′(t) = cosh(t) cosh(sinh(t))

f holomorphic on ∆′τ.

Page 42: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

| f (x)| 6 M11+|x|α−∞ ∞

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

ϕ(t) = sinh(sinh(t))

ϕ′(t) = cosh(t) cosh(sinh(t))

f holomorphic on ∆′τ.

Page 43: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

−∞ ∞

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

ϕ(t) = tanh(λ sinh(t))

ϕ′(t) =λ cosh(t)

cosh2(λ sinh(t))

f holomorphic on ∆′τ.

Page 44: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

−∞ ∞

| f (x)| 6 M1(1+|x|)α

| f (z)| 6 M′2

(1+|z|)1+γYm(τ)

Xm(τ)

∆′τ

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

ϕ(t) = tanh(λ sinh(t))

ϕ′(t) =λ cosh(t)

cosh2(λ sinh(t))

f holomorphic on ∆′τ.

Page 45: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

| f | 6 M1

a b

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

ϕ(t) = et−αe−βt

ϕ′(t) = (1 + αβe−βt)ϕ(t)

f holomorphic on ∆′τ.

Page 46: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

ϕ(t) = et−αe−βt

ϕ′(t) = (1 + αβe−βt)ϕ(t)

f holomorphic on ∆′τ.

Page 47: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

| f | 6 M1

| f | 6 M2

Ym(τ)

Xm(τ)a b

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

f holomorphic on ∆′τ.

Page 48: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

| f | 6 M1e−αxβ

0 ∞

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

f holomorphic on ∆′τ.

Page 49: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

f holomorphic on ∆′τ.

Page 50: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

DE method : regularity hypothesis

Problem :

f , ¬ ’, ­ ’

| f | 6 M1e−αxβ

| f (z)| 6 M2eλ|z|∆′τ

τ

−Xm

0 ∞

DE setting :

g = f (ϕ).ϕ′, ¬ , ­

iτ∆τR

f holomorphic on ∆′τ.

Page 51: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Summary

τsin(τ)

| f (z)| 6 M2eA|z|γ

| f (x)| 6 M1e−α|x|β

∆′τ

−∞ ∞

| f (x)| 6 M1(1+|x|)α

| f (z)| 6 M′2

(1+|z|)1+γYm(τ)

Xm(τ)

∆′τ

| f | 6 M1e−αxβ

| f (z)| 6 M2eλ|z|∆′τ

τ

−Xm

0 ∞ | f | 6 M1

| f | 6 M2

Ym(τ)

Xm(τ)a b

Under these hypothesis, DE method rigorously evaluates∫f to

D digits using O(D logD2πτ ) points.

Page 52: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Use cases

Page 53: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

A list of integrals

z ∆′τ∫R

dz1+z2 sh(sh(t)) poles /∈ ∆′τ X

∫R

dz1+(z−10)2 sh(sh(t)) pole ∈ ∆′τ, τ > 0.04 5

∫ 100−100

dz1+z2 100 th(π

2 sh(t)) pole ∈ ∆′τ, τ > 0.06 5∫

Re−z

2dz

1+e iz−1 sh(t) pole ∈ ∆′τ, ∀τ 5∫

RΓ(1 + iz)dz sh(t) Γ→ ∞ for τ < 0 5

∫Re− ch(z)+i ch(2z) dz t huge L1(R± iτ) 5

∫R

sin(z)dzz sh(sh(t)) sin(iet) explodes 5

Page 54: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Well placed poles

−∞ ∞

Page 55: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

A list of integrals

z ∆′τ∫R

dz1+z2 sh(sh(t)) poles /∈ ∆′τ X

∫R

dz1+(z−10)2 sh(sh(t)) pole ∈ ∆′τ, τ > 0.04 5

∫ 100−100

dz1+z2 100 th(π

2 sh(t)) pole ∈ ∆′τ, τ > 0.06 5∫

Re−z

2dz

1+e iz−1 sh(t) pole ∈ ∆′τ, ∀τ 5∫

RΓ(1 + iz)dz sh(t) Γ→ ∞ for τ < 0 5

∫Re− ch(z)+i ch(2z) dz t huge L1(R± iτ) 5

∫R

sin(z)dzz sh(sh(t)) sin(iet) explodes 5

Page 56: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Small tau value

−∞ ∞

Page 57: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Small tau value

? \p1000

realprecision = 1001 significant digits (1000

digits displayed)

? f(z)=1/(1+z^2);

? D=1000* log (10);

? show(asinh(asinh (10+I)))

%6 = 1.8198999017302092895 + 0.03132601926270185771*I

? tau =0.03;h=pas_h_shsh(tau ,1,1,D);show(h)

%7 = 8.183792956273686739 E-5

? n=ceil(asinh(asinh (2*10^1000+10))/h);show(n)

%8 = 103077

? Pi-integration_shsh(z->f(z-10),h,n,1)

%9 = 7.729969385579881748 E -1001

Page 58: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

A list of integrals

z ∆′τ∫R

dz1+z2 sh(sh(t)) poles /∈ ∆′τ X

∫R

dz1+(z−10)2 sh(sh(t)) pole ∈ ∆′τ, τ > 0.04 5

∫ 100−100

dz1+z2 100 th(π

2 sh(t)) pole ∈ ∆′τ, τ > 0.06 5

∫R

e−z2

dz1+e iz−1 sh(t) pole ∈ ∆′τ, ∀τ 5

∫R

Γ(1 + iz)dz sh(t) Γ→ ∞ for τ < 0 5∫

Re− ch(z)+i ch(2z) dz t huge L1(R± iτ) 5

∫R

sin(z)dzz sh(sh(t)) sin(iet) explodes 5

Page 59: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

A list of integrals

z ∆′τ∫R

dz1+z2 sh(sh(t)) poles /∈ ∆′τ X

∫R

dz1+(z−10)2 sh(sh(t)) pole ∈ ∆′τ, τ > 0.04 5

∫ 100−100

dz1+z2 100 th(π

2 sh(t)) pole ∈ ∆′τ, τ > 0.06 5∫

Re−z

2dz

1+e iz−1 sh(t) pole ∈ ∆′τ, ∀τ 5

∫R

Γ(1 + iz)dz sh(t) Γ→ ∞ for τ < 0 5∫

Re− ch(z)+i ch(2z) dz t huge L1(R± iτ) 5

∫R

sin(z)dzz sh(sh(t)) sin(iet) explodes 5

Page 60: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Line of poles

Page 61: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

A list of integrals

z ∆′τ∫R

dz1+z2 sh(sh(t)) poles /∈ ∆′τ X

∫R

dz1+(z−10)2 sh(sh(t)) pole ∈ ∆′τ, τ > 0.04 5

∫ 100−100

dz1+z2 100 th(π

2 sh(t)) pole ∈ ∆′τ, τ > 0.06 5∫

Re−z

2dz

1+e iz−1 sh(t) pole ∈ ∆′τ, ∀τ 5∫

RΓ(1 + iz)dz sh(t) Γ→ ∞ for τ < 0 5

∫Re− ch(z)+i ch(2z) dz t huge L1(R± iτ) 5

∫R

sin(z)dzz sh(sh(t)) sin(iet) explodes 5

Page 62: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

A list of integrals

z ∆′τ∫R

dz1+z2 sh(sh(t)) poles /∈ ∆′τ X

∫R

dz1+(z−10)2 sh(sh(t)) pole ∈ ∆′τ, τ > 0.04 5

∫ 100−100

dz1+z2 100 th(π

2 sh(t)) pole ∈ ∆′τ, τ > 0.06 5∫

Re−z

2dz

1+e iz−1 sh(t) pole ∈ ∆′τ, ∀τ 5∫

RΓ(1 + iz)dz sh(t) Γ→ ∞ for τ < 0 5

∫Re− ch(z)+i ch(2z) dz t huge L1(R± iτ) 5

∫R

sin(z)dzz sh(sh(t)) sin(iet) explodes 5

Page 63: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Extensions

Page 64: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Meromorphic functions

If has a pole ρ ∈ ∆τ, with residue rρ :

g(X ) =∫

R±iτe−2iπτXtg(t)dt + 2iπe∓2iπXρrρ

For f∣∣∣∣∣∣ ∑k∈Z∗

g(k

h)− 2iπ ∑

ρ∈Zτ

∑ϕ−1(ρ)

εz rρ

e−εz2iπz/h − 1

∣∣∣∣∣∣6 2M1

e2πτ/h − 1

where εz is the sign of Im z .

Page 65: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Taking residues into account

? \p1000

realprecision = 1001 significant digits (1000

digits displayed)

? f(z)=1/(1+z^2);

? tau=Pi/2.2;

? h=2*Pi*tau /(1000* log (10)+log(2/cos(tau)));show(h)

%6 = 0.003892182386142456451

? n=ceil(asinh(asinh (2*10^1000))/h)

%7 = 2168

? Pi-integration_shsh(f,h,n,1)

%8 = 0.E-1001

? diff=Pi -integration_shsh(z->f(z-15),h,n,1);show(diff

)

%9 = 2.988841749810731359 E-14

? Rho =[15+I,15-I];Res=[-I/2,I/2];

? diff+poles_shsh(Rho ,Res ,h)

%11 = -2.9500027961671405652 E -1002 + 0.E -1014*I

Page 66: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

A list of integrals

z ∆′τ∫R

dz1+z2 sh(sh(t)) poles /∈ ∆′τ X

∫R

dz1+(z−10)2 sh(sh(t)) pole ∈ ∆′τ, τ > 0.04 X

∫ 100−100

dz1+z2 100 th(π

2 sh(t)) pole ∈ ∆′τ, τ > 0.06 X∫

Re−z

2dz

1+e iz−1 sh(t) pole ∈ ∆′τ, ∀τ X∫

RΓ(1 + iz)dz sh(t) Γ→ ∞ for τ < 0 5

∫Re− ch(z)+i ch(2z) dz t huge L1(R± iτ) 5

∫R

sin(z)dzz sh(sh(t)) sin(iet) explodes 5

Page 67: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Shifting path

δ

θ

→∞→ 0

→ 0

gamma function onvertical lines

Page 68: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Shifting path

δ

θ

gamma function onvertical lines

integrate on themiddle of a nicestrip

Page 69: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

A list of integrals

z ∆′τ∫R

dz1+z2 sh(sh(t)) poles /∈ ∆′τ X

∫R

dz1+(z−10)2 sh(sh(t)) pole ∈ ∆′τ, τ > 0.04 X

∫ 100−100

dz1+z2 100 th(π

2 sh(t)) pole ∈ ∆′τ, τ > 0.06 X∫

Re−z

2dz

1+e iz−1 sh(t) pole ∈ ∆′τ, ∀τ X∫

RΓ(1 + iz)dz sh(t) Γ→ ∞ for τ < 0 X

∫Re− ch(z)+i ch(2z) dz t huge L1(R± iτ) X

∫R

sin(z)dzz sh(sh(t)) sin(iet) explodes 5

Page 70: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Examples

Page 71: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Error function

erfc(x) =−iπ

e−x2∫

R

e−z2

z − ixdz

erfc(x) =hx

πe−x

2

(1

x2+ 2 ∑

k>1

e−k2h2

k2h2 + x2

)+

2

1− e2πx/h +O(e−π2/h2)

comparison with MPFR

gp/mpfr

1 10 100 1000 10000

value

100

1000

10000

pre

cis

ion

−6

−4

−2

0

2

4MPFR 50 times faster

integration 400 times faster

Page 72: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Error function

erfc(x) =−iπ

e−x2∫

R

e−z2

z − ixdz

erfc(x) =hx

πe−x

2

(1

x2+ 2 ∑

k>1

e−k2h2

k2h2 + x2

)+

2

1− e2πx/h +O(e−π2/h2)

comparison with MPFR

gp/mpfr

1 10 100 1000 10000

value

100

1000

10000

pre

cis

ion

−6

−4

−2

0

2

4MPFR 50 times faster

integration 400 times faster

Page 73: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Incomplete gamma function

Γinc(s, x) =∫ ∞x tse−t dt

t for s ∈ C and x /∈ R−.

X

0

Page 74: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Incomplete gamma function

Γinc(s, x) =∫ ∞x tse−t dt

t for s ∈ C and x /∈ R−.

X

τ

0

Page 75: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Incomplete gamma function

Γinc(s, x) =∫ ∞x tse−t dt

t for s ∈ C and x /∈ R−.

X τ

0

Page 76: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Incomplete gamma function

Γinc(s, x) =∫ ∞x tse−t dt

t for s ∈ C and x /∈ R−.

X

0

Page 77: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Incomplete gamma functionΓinc(s, x) =

∫ ∞x tse−t dt

t for s ∈ C and x /∈ R−.

τ

0

∣∣ts−1e−t∣∣ 6 M(X, τ, s) explicite

Γinc(s,X ) to prec D using n ∼ 2D logDπ2 evaluations.

Page 78: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

Conclusion

• DE integration is not always the best method (betterconvergence for Gauss, provided big precomputations and wellknown integrand)

• still very easy to implement and nice convergence

• rigorous integration possible with basic bounds on theintegrand

• otherwise efficient heuristic procedures (guess the error termfrom first iterations)

Page 79: Numerical Integration with the double exponential methodpascal.molin/pdf/1612oldenburg.pdf · Numerical integration Number-theory context, want • fast quadrature • high precision

References

Hidetosi Takahasi and Masatake Mori.

Double exponential formulas for numerical integration.

Kyoto University. Research Institute for Mathematical Sciences.Publications, 9 :721–741, 1973.

Masatake Mori.

Discovery of the double exponential transformation and its developments.

Publ. Res. Inst. Math. Sci., 41(4) :897–935, 2005.

David H. Bailey, Karthik Jeyabalan, and Xiaoye S. Li.

A comparison of three high-precision quadrature schemes.

Experiment. Math., 14(3) :317–329, 2005.

Pascal Molin.

Numerical integration and L functions computations.

Theses, Universite Sciences et Technologies - Bordeaux I, October 2010.