1 Introduction

In this work we are interested in the numerical approximation of \({\mathcal {L}}^{-\alpha }\), \(\alpha \in (0,1).\) Here \({\mathcal {L}}\) is a self-adjoint positive operator acting in an Hilbert space \({\mathcal {H}}\) in which the eigenfunctions of \({\mathcal {L}}\) form an orthonormal basis of \({\mathcal {H}},\) so that \({\mathcal {L}}^{-\alpha }\) can be written through the spectral decomposition of \({\mathcal {L}}\). In other words, for a given \(g\in {\mathcal {H}}\), we have

$$\begin{aligned} {\mathcal {L}}^{-\alpha }g=\sum _{j=1}^{+\infty }\mu _{j}^{-\alpha }\langle g, {\phi _{j}}\rangle {\phi _{j}} \end{aligned}$$
(1)

where \(\mu _{j}\) and \({\phi _{j}}\) are the eigenvalues and the eigenfunctions of \({\mathcal {L}},\) respectively, and \(\langle \cdot ,\cdot \rangle \) denotes the \({\mathcal {H}}\)-inner product. Throughout the paper we also assume \(\sigma (\mathcal {L})\subseteq [1,+\infty )\), where \(\sigma (\mathcal {L})\) denotes the spectrum of \({\mathcal {L}}\).

Applications of (1) include the numerical solution of fractional equations involving the anomalous diffusion, in which \({\mathcal {L}}\) is related to the Laplacian operator, and this is the main reason for which in recent years a lot of attention has been placed on the efficient approximation of fractional powers. Among the approaches recently introduced we quote here the methods based on the best uniform rational approximations of functions closely related to \(\lambda ^{-\alpha }\) that have been studied in [8,9,10,11]. Another class of methods relies on quadrature rules arising from the Dunford-Taylor integral representation of \( \lambda ^{-\alpha }\) [1,2,3,4, 6, 7, 19, 20]. Very recently, time stepping methods for a parabolic reformulation of fractional diffusion equations, proposed in [21], have been interpreted by Hofreither in [12] as rational approximations of \(\lambda ^{-\alpha }.\)

In this work, starting from the integral representation (see [5])

$$\begin{aligned} \mathcal {L}^{-\alpha }=\frac{2\sin (\alpha \pi )}{\pi }\int _{0}^{+\infty }t^{2\alpha -1}({\mathcal {I}}+t^{2}\mathcal {L})^{-1}dt,\qquad \alpha \in (0,1), \end{aligned}$$
(2)

where \({\mathcal {I}}\) is the identity operator in \({\mathcal {H}}\), we consider the trapezoidal rule applied to the double-exponential transform of the integrand function. We recall here that the method based on the single-exponential (SE) transform has been extensively studied in [6, 7], where the authors also provide reliable error estimates. The rate of convergence has been shown to be of type

$$\begin{aligned} \exp (-c\sqrt{n}), \end{aligned}$$
(3)

where n is closely related to the number of nodes. The double-exponential transform has been widely investigated in [14,15,16,17,18] for general scalar functions. In this work we show how to improve the existing error estimates for the function \(\lambda ^{-\alpha } \). We also extend the analysis to operators, showing that it is possible to reach a convergence rate of type

$$\begin{aligned} \exp \left( -c\sqrt{\frac{n}{\ln n}}\right) . \end{aligned}$$

While theoretically disadvantageous with respect to the single-exponential approach, we show that the double-exponential approach is actually faster at least for \(\alpha \in ( 1/2,1)\).

The paper is organized as follows. In Sect. 2 we make a short background concerning the trapezoidal rule with particular attention to functions that decay exponentially at infinity. In Sect. 3 we consider the trapezoidal rule combined with a double-exponential transform. Here the convergence analysis is derived for the approximation of the scalar function \(\lambda ^{-\alpha }\) and is then extended in Sects. 4 and 5 to the case of the operator \({ \mathcal {L}}^{-\alpha }.\) Some concluding remarks are finally reported in Sect. 6.

2 A General Convergence Result for the Trapezoidal Rule

Given a generic continuous function \(f:\mathbb {R}\rightarrow \mathbb {R}\), in this section we make a short background concerning the trapezoidal approximation

$$\begin{aligned} I(f)=\int _{-\infty }^{+\infty }f(x)dx\approx h\sum _{\ell =-\infty }^{+\infty }f(\ell h), \end{aligned}$$

where h is a suitable positive value. Given M and N positive integers, we denote the truncated trapezoidal rule by

$$\begin{aligned} T_{M,N,h}(f)=h\sum _{\ell =-M}^{N}f(\ell h). \end{aligned}$$

For the error we have

$$\begin{aligned} \mathcal {E}_{M,N,h}(f):=\left| I(f)-T_{M,N,h}(f)\right| \le \mathcal {E}_{D}+\mathcal {E}_{T_{L}}+\mathcal {E}_{T_{R}}, \end{aligned}$$

where

$$\begin{aligned} \mathcal {E}_{D}&=\left| \int _{-\infty }^{+\infty }f(x)dx-h\sum _{\ell =-\infty }^{+\infty }f(\ell h)\right| , \\ \mathcal {E}_{T_{L}}&=h\sum _{\ell =-\infty }^{-M-1}\left| f(\ell h)\right| ,\qquad \mathcal {E}_{T_{R}}=h\sum _{\ell =N+1}^{+\infty }\left| f(\ell h)\right| . \end{aligned}$$

The quantities \(\mathcal {E}_{D}\) and \(\mathcal {E}_{T}:=\mathcal {E}_{T_{L}}+\mathcal {E}_{T_{R}}\) are referred to as the discretization error and the truncation error, respectively.

Definition 1

[13, Definition 2.12] For \(d>0,\) let \(\mathcal {D}_{d}\) be the infinite strip domain of width 2d given by

$$\begin{aligned} \mathcal {D}_{d} = \{ \zeta \in \mathbb {C}:\, |{\text {Im}}(\zeta ) |<d \}. \end{aligned}$$

Let \(B(\mathcal {D}_{d})\) be the set of functions analytic in \(\mathcal {D}_{d} \) that satisfy

$$\begin{aligned} \int _{-d}^{d} |f(x+i\eta ) |d\eta =\mathcal {O}(|x|^{a}),\quad x\rightarrow \pm \infty ,\quad 0\le a<1, \end{aligned}$$

and

$$\begin{aligned} \mathcal {N}(f,d)= \lim _{\eta \rightarrow d^{-}}\left\{ \int _{-\infty }^{+\infty } |f(x+i\eta ) |dx+\int _{-\infty }^{+\infty } |f(x-i\eta ) |dx\right\} <+\infty . \end{aligned}$$

The next theorem gives an estimate for the discretization error of the trapezoidal rule when applied to functions in \(B(\mathcal {D}_{d})\).

Theorem 1

[13, Theorem 2.20] Assume \(f\in B(\mathcal {D}_{d})\). Then

$$\begin{aligned} \mathcal {E}_{D}\le \frac{\mathcal {N}(f,d)}{2\sinh (\pi d/h)}e^{-\pi d/h}. \end{aligned}$$
(4)

Theorem 2

Assume \(f\in B(\mathcal {D}_{d})\) and that there are positive constants \(\beta ,\gamma \) and C such that

$$\begin{aligned} |f(x) |\le C\left\{ \begin{array}{ll} {\exp (\beta x )}, &{} x<0, \\ \exp (-\gamma x), &{} x\ge 0. \end{array} \right. \end{aligned}$$
(5)

Then,

$$\begin{aligned} \mathcal {E}_{M,N,h}(f)\le \frac{N(f,d)}{2\sinh (\pi d/h)}e^{-\pi d/h}+\frac{ C}{\beta }e^{-\beta Mh}+\frac{C}{\gamma }e^{-\gamma Nh}. \end{aligned}$$
(6)

Proof

By (5) we immediately have

$$\begin{aligned} \mathcal {E}_{T_{L}}\le \frac{C}{\beta }e^{-\beta Mh},\quad \mathcal {E} _{T_{R}}\le \frac{C}{\gamma }e^{-\gamma Nh}. \end{aligned}$$

Using Theorem 1 we obtain (6). \(\square \)

The above result states that for functions that decay exponentially for \( x\rightarrow \pm \infty \) it may be possible to have exponential convergence after a proper selection of h. When working with the more general situation

$$\begin{aligned} I(g):=\int _{a}^{b}g(t)dt, \end{aligned}$$
(7)

one can consider a conformal map

$$\begin{aligned} \psi :(-\infty ,+\infty )\rightarrow (a,b), \end{aligned}$$

and, through the change of variable \(t=\psi (x)\), transform (7) to

$$\begin{aligned} I(g_{\psi }):=\int _{-\infty }^{+\infty }g_{\psi }(x)dx,\qquad g_{\psi }(x)=g(\psi (x))\psi ^{\prime }(x). \end{aligned}$$

A suitable choice of the mapping \(\psi \) may allow to work with a function \( g_{\psi }\) that fulfills the hypothesis of Theorem 2 so that I(g) can be evaluated with an error that decays exponentially.

Since the aim of the paper is the computation of \(\mathcal {L}^{-\alpha }\) with \(\sigma (\mathcal {L})\subseteq [1,+\infty ),\) for \(\lambda \ge 1 \) we consider now the integral representation (2)

$$\begin{aligned} \lambda ^{-\alpha }=\frac{2\sin (\alpha \pi )}{\pi }\int _{0}^{+\infty }t^{2\alpha -1}(1+t^{2}\lambda )^{-1}dt,\qquad \alpha \in (0,1). \end{aligned}$$
(8)

Defining

$$\begin{aligned} g_{\lambda }(t):=t^{2\alpha -1}(1+t^{2}\lambda )^{-1}, \end{aligned}$$
(9)

and a change of variable \(t=\psi (x)\), \(\psi :(-\infty ,+\infty )\rightarrow (0,+\infty )\), let

$$\begin{aligned} g_{\lambda ,\psi }(x)=g_{\lambda }(\psi (x))\psi ^{\prime }(x). \end{aligned}$$
(10)

Let moreover

$$\begin{aligned} \mathcal {Q}_{M,N,h}^{\alpha }(g_{\lambda ,\psi })=\frac{2\sin (\alpha \pi )}{ \pi }h\sum _{\ell =-M}^{N}g_{\lambda ,\psi }(\ell h) \end{aligned}$$

be the truncated trapezoidal rule for the computation of \(\lambda ^{-\alpha } \), that is, for the computation of

$$\begin{aligned} \frac{2\sin (\alpha \pi )}{\pi }\int _{0}^{+\infty }g_{\lambda }(t)dt=\frac{ 2\sin (\alpha \pi )}{\pi }\int _{-\infty }^{+\infty }g_{\lambda ,\psi }(x)dx. \end{aligned}$$

We denote the error by

$$\begin{aligned} E_{M,N,h}(\lambda )&=\left| \lambda ^{-\alpha }-\mathcal {Q} _{M,N,h}^{\alpha }(g_{\lambda ,\psi })\right| \nonumber \\&=\frac{2\sin (\alpha \pi )}{\pi }\mathcal {E}_{M,N,h}(g_{\lambda ,\psi }), \end{aligned}$$
(11)

and for operator argument

$$\begin{aligned} E_{M,N,h}(\mathcal {L})=\left\| {\mathcal {L}}^{-\alpha }-\mathcal {Q} _{M,N,h}^{\alpha }(g_{{\mathcal {L}},\psi })\right\| _{\mathcal {H} \rightarrow \mathcal {H}}. \end{aligned}$$
(12)

3 Double-Exponential Transformation

The DE transform we use here is given by

$$\begin{aligned} \psi _{DE}(x)= {\tau ^{-1/2} }\exp \left( \frac{\pi }{2}\sinh (x)\right) , \qquad \tau >0. \end{aligned}$$
(13)

We consider in (8) the change of variable

$$\begin{aligned} \tau t^{2}= \tau \left( \psi _{DE}(x)\right) ^{2}=\exp (\pi \sinh (x)),\qquad \tau >0. \end{aligned}$$

The function involved in this case is

$$\begin{aligned} g_{\lambda ,\psi _{DE}}(x)&=\frac{\pi }{2}\tau ^{1-\alpha }\frac{\exp (\alpha \pi \sinh (x))}{\tau +\lambda \exp (\pi \sinh (x))}\cosh (x) \nonumber \\&=\frac{\pi }{2}\lambda ^{-\alpha }\frac{\left( \lambda /\tau \exp (\pi \sinh (x))\right) ^{\alpha }}{1+\lambda /\tau \exp (\pi \sinh (x))}\cosh (x), \end{aligned}$$
(14)

and we employ the trapezoidal rule to compute

$$\begin{aligned} \lambda ^{-\alpha }=\frac{2\sin (\alpha \pi )}{\pi }\int _{-\infty }^{+\infty }g_{\lambda ,\psi _{DE}}(x)dx. \end{aligned}$$

The parameter \(\tau \) needs to be selected in some way and the analysis is provided in Sect. 5.4. Its introduction is motivated by the fact that, when moving from \(\lambda \) to \(\mathcal {L}\), the method (the choice of M, N and h) and the error estimates have to be derived by working uniformly in the interval \([1,+\infty )\) containing \(\sigma (\mathcal {L})\). As in the SE case applied to (8), the function \(g_{\lambda ,\psi _{DE}}(x)\) exhibits a fast decay for \(x\rightarrow \pm \infty \) (see [7]), but the definition of the strip of analyticity is now much more difficult to handle since everything now depends on \(\lambda \) and \(\tau \).

3.1 Asymptotic Behavior of the Integrand Function

In order to apply Theorem 2 we need to study \(|g_{\lambda ,\psi _{DE}}(x+i\eta ) |\). From (14) we have

$$\begin{aligned} |g_{\lambda ,\psi _{DE}}(x+i\eta )|=\frac{\pi }{2} \lambda ^{-\alpha } \left|\frac{\left( \lambda /\tau \exp (\pi \sinh (x+i\eta ))\right) ^{\alpha }}{1+\lambda /\tau \exp (\pi \sinh (x+i\eta ))} \right||\cosh (x+i\eta ) |. \end{aligned}$$

After simple manipulations based on standard relations we find

$$\begin{aligned} \left| \cosh (x+i\eta )\right| =\sqrt{\cosh ^{2}x-\sin ^{2}\eta }, \end{aligned}$$

and therefore

$$\begin{aligned} \left| \cosh (x+i\eta )\right| \le \cosh x. \end{aligned}$$

Moreover

$$\begin{aligned} \left| \left( \lambda /\tau \exp (\pi \sinh (x+i\eta ))\right) ^{\alpha }\right| =\left( \frac{\lambda }{\tau }\right) ^{\alpha }\left| \exp (\alpha \pi \sinh x\cos \eta ))\right| . \end{aligned}$$

In addition, we can bound the denominator using the results given in [15, p. 388], that is,

$$\begin{aligned} \left| \frac{1}{1+\lambda /\tau \exp (\pi \sinh (x+i\eta ))}\right| \le \frac{1}{1+\lambda /\tau \exp (\pi \sinh x\cos \eta )\cos (\pi /2\sin \eta )}. \end{aligned}$$

From the above relations we find

$$\begin{aligned} \left| g_{\lambda ,\psi _{DE}}(x+i\eta )\right| \le \frac{\pi }{2} \lambda ^{-\alpha }\frac{\cosh x}{\cos (\pi /2\sin \eta )}G_{\alpha }(x,\eta ), \end{aligned}$$

where

$$\begin{aligned} G_{\alpha }(x,\eta )=\frac{\left( \lambda /\tau \exp (\pi \sinh x\cos \eta )\right) ^{\alpha }}{1+\lambda /\tau \exp (\pi \sinh x\cos \eta )}. \end{aligned}$$

Let \(x^{*}\) be such that

$$\begin{aligned} \pi \sinh x^{*}\cos \eta =\ln (\tau /\lambda ); \end{aligned}$$

we have

$$\begin{aligned} G_{\alpha }(x,\eta )\le \left\{ \begin{array}{ll} (\lambda /\tau )^{\alpha }\exp (\alpha \pi \cos \eta \sinh x), &{}\quad x\le x^{*}, \\ (\lambda /\tau )^{\alpha -1}\exp (-(1-\alpha )\pi \cos \eta \sinh x), &{}\quad x>x^{*}. \end{array} \right. \end{aligned}$$
(15)

3.2 Error Estimate for the Scalar Case

The bound (15) implies that

$$\begin{aligned} \mathcal {N}\left( g_{\lambda ,\psi _{DE}},d\right)&=\lim _{\eta \rightarrow d^{-}}\left\{ \int _{-\infty }^{+\infty }\left| g_{\lambda ,\psi _{DE}}(x+i\eta )\right| dx+\int _{-\infty }^{+\infty }\left| g_{\lambda ,\psi _{DE}}(x-i\eta )\right| dx\right\} \\&\le \lim _{\eta \rightarrow d^{-}}\pi \lambda ^{-\alpha }\left\{ \frac{1}{ \cos (\pi /2\sin \eta )}\int _{-\infty }^{+\infty }G_{\alpha }(x,\eta )\cosh xdx\right\} \\&\le \lim _{\eta \rightarrow d^{-}}\frac{\pi \lambda ^{-\alpha }}{\cos (\pi /2\sin \eta )}\left\{ (\lambda /\tau )^{\alpha }\int _{-\infty }^{x^{*}}\exp (\alpha \pi \cos \eta \sinh x)\cosh x\,dx\right. \\&\quad +\left. (\lambda /\tau )^{\alpha -1}\int _{x^{*}}^{+\infty }\exp (-(1-\alpha )\pi \cos \eta \sinh x)\cosh x\,dx\right\} \\&\le \frac{1}{\alpha (1-\alpha )}\frac{2}{\cos d\cos (\pi /2\sin d)} \lambda ^{-\alpha }. \end{aligned}$$

In addition, assuming \(d=d(\lambda ,\tau )<\pi /2\), it can be observed that

$$\begin{aligned} \int _{-d(\lambda ,\tau )}^{d(\lambda ,\tau )} |g_{\lambda ,\psi _{DE}}(x+i\eta ) |d\eta&\le \frac{\pi }{2}\lambda ^{-\alpha }\int _{-d(\lambda ,\tau )}^{d(\lambda ,\tau )}\frac{G_{\alpha }(x,\eta )\cosh x}{\cos (\pi /2\sin \eta )}d\eta \\&=\mathcal {O}(1)\quad \text {for }x\rightarrow \pm \infty . \end{aligned}$$

Using Theorem 1, for the discretization error we have

$$\begin{aligned} \left| \int _{-\infty }^{+\infty }g_{\lambda ,\psi _{DE}}(x)dx-h\sum _{\ell =-\infty }^{+\infty }g_{\lambda ,\psi _{DE}}(\ell h)\right| \le \xi (d)\frac{1}{\alpha (1-\alpha )}\lambda ^{-\alpha } \frac{e^{-\pi d/h}}{2\sinh (\pi d/h)}, \end{aligned}$$

where

$$\begin{aligned} \xi (d)=\frac{2}{{\cos d\cos (\pi /2\sin d)}}. \end{aligned}$$
(17)

The remaining task is to estimate the truncation error. Using (15) we obtain

$$\begin{aligned} h\sum \limits _{\ell =-\infty }^{-M-1}\left| g_{\lambda ,\psi _{DE}}(\ell h)\right|&\le \frac{\pi }{2}\tau ^{-\alpha }h\sum \limits _{\ell =-\infty }^{-M-1}\exp (\alpha \pi \sinh (\ell h))\cosh (\ell h) \\&\le \frac{\pi }{2}\tau ^{-\alpha }\int _{-\infty }^{-Mh}\exp (\alpha \pi \sinh x)\cosh (x)dx \\&\le \frac{\tau ^{-\alpha }}{2\alpha }\exp \left( -\alpha \pi \sinh (Mh)\right) \\&\le \frac{\tau ^{-\alpha }}{2\alpha }\exp \left( \frac{\alpha \pi }{2} \right) \exp \left( -\frac{\alpha \pi }{2}\exp (Mh)\right) . \end{aligned}$$

Similarly,

$$\begin{aligned} h\sum \limits _{\ell =N+1}^{+\infty }\left| g_{\lambda ,\psi _{DE}}(\ell h)\right|&\le \frac{\pi }{2}\lambda ^{-1}\tau ^{1-\alpha }h\sum \limits _{\ell =N+1}^{+\infty }\exp (-(1-\alpha )\pi \sinh (\ell h))\cosh (\ell h) \\&\le \frac{\pi }{2}\lambda ^{-1}\tau ^{1-\alpha }h\int _{Nh}^{+\infty }\exp (-(1-\alpha )\pi \sinh x)\cosh (x)dx \\&\le \frac{\lambda ^{-1}\tau ^{1-\alpha }}{2(1-\alpha )}\exp \left( \frac{ (1-\alpha )\pi }{2}\right) \exp \left( -\frac{(1-\alpha )\pi }{2}\exp (Nh)\right) . \end{aligned}$$

The above results are summarized as follows.

Proposition 3

Using the double-exponential transform, for the quadrature error it holds

$$\begin{aligned} \mathcal {E}_{M,N,h}(g_{\lambda ,\psi _{DE}})&\le \frac{1}{\alpha (1-\alpha )}\xi (d)\lambda ^{-\alpha }\frac{e^{-\pi d/h}}{2\sinh (\pi d/h)}+ \end{aligned}$$
(18)
$$\begin{aligned}&\frac{\tau ^{-\alpha }}{2\alpha }\exp \left( \frac{\alpha \pi }{2}\right) \exp \left( -\frac{\alpha \pi }{2}\exp (Mh)\right) + \end{aligned}$$
(19)
$$\begin{aligned}&\frac{\lambda ^{-1}\tau ^{1-\alpha }}{2(1-\alpha )}\exp \left( \frac{ (1-\alpha )\pi }{2}\right) \exp \left( -\frac{(1-\alpha )\pi }{2}\exp (Nh)\right) , \end{aligned}$$
(20)

where \(\xi (d)\) is defined by (17).

Defining

$$\begin{aligned} h=\ln \left( \frac{4dn}{\mu }\right) \frac{1}{n},\quad \text {for }\quad n\ge \frac{\mu e}{4d},\quad \mu =\min (\alpha ,1-\alpha ) \end{aligned}$$
(21)

as in [15, Theorem 2.14], we first observe that (see (18))

$$\begin{aligned} \frac{\exp \left( -\frac{\pi d}{h}\right) }{2\sinh \left( \frac{\pi d}{h} \right) }\le \frac{1}{1-e^{-\frac{\pi }{2}\mu e}}\exp \left( \frac{-2\pi dn }{\ln \left( \frac{4dn}{\mu }\right) }\right) . \end{aligned}$$
(22)

Setting \(M=N=n\), the choice of h as in (21) leads to a truncation error that decays faster than the discretization one, because for an arbitrary constant c (see (19)-(20))

$$\begin{aligned} \exp \left( -c\exp \left( nh\right) \right) =\exp \left( -\frac{4cdn}{\mu } \right) . \end{aligned}$$

As consequence the idea is to assume the discretization error as estimator for the global quadrature error, that is, using (18) and (22),

$$\begin{aligned} \mathcal {E}_{n,n,h}(g_{\lambda ,\psi _{DE}})\approx K_{\alpha }\xi (d)\lambda ^{-\alpha }\exp \left( \frac{ -2\pi dn}{\ln \left( \frac{4dn}{\mu }\right) }\right) , \end{aligned}$$
(23)

where

$$\begin{aligned} K_{\alpha }=\frac{1}{\alpha (1-\alpha )}\frac{1}{1-e^{-\frac{\pi }{2}\mu e}}. \end{aligned}$$
(24)

Formula (23) is very similar to the one given in [15, Theorem 2.14], that reads

$$\begin{aligned} \mathcal {\hat{E}}_{M,N,h}(g_{\lambda ,\psi _{DE}})\approx \frac{\tau ^{-\alpha }}{\mu }\alpha (1-\alpha )\left( K_{\alpha }\xi (d)+e^{\frac{\pi }{ 2}\nu }\right) \exp \left( \frac{-2\pi dn}{\ln \left( \frac{4dn}{\mu } \right) }\right) \end{aligned}$$
(25)

where \(\nu =\max \left( \alpha ,1-\alpha \right) \) and \(M=n\), \(N=n-\chi \) (or viceversa depending on \(\alpha \)), where \(\chi >0\) is defined in order to equalize the contribute of the truncation errors [15, Theorem 2.11]. The important difference is given by the factor \(\lambda ^{-\alpha }\) that replaces \(\tau ^{-\alpha }\), and this is crucial to correctly handle the case of \(\lambda \rightarrow +\infty \). In this situation the error of the trapezoidal rule goes 0 because \(g_{\lambda ,\psi _{DE}}(x)\rightarrow 0\) as \(\lambda \rightarrow +\infty \) (see (14)). Anyway, as we shall see, \( d\rightarrow 0\) as \(\lambda \rightarrow +\infty \), so that the exponential term itself is not able to reproduce this situation. An example is given in Fig. 1 in which we consider \(\lambda =10^{12}\) and \(\tau =100.\)

Fig. 1
figure 1

Error for the trapezoidal rule applied with the double-exponential transform (error DE), estimates (23) and (25) versus the number of inversions, for the computation of \(\lambda ^{-\alpha }\) with \(\lambda =10^{12}\) and \(\tau =100\)

4 The Poles of the Integrand Function

All the analysis presented so far is based on the assumption that the integrand function

$$\begin{aligned} g_{\lambda ,\psi _{DE}}(x)=\frac{\pi }{2}\tau ^{1-\alpha }\frac{\exp \left( \alpha \pi \sinh x\right) }{\tau +\lambda \exp \left( \pi \sinh x\right) } \cosh x \end{aligned}$$

is analytic in the strip \(\mathcal {D}_{d}\), for a certain \(d=d(\lambda ,\tau )\). Therefore we have to study the poles of this function, that is, we have to study the equation

$$\begin{aligned} \tau +\lambda \exp \left( \pi \sinh x\right) =0. \end{aligned}$$

We have

$$\begin{aligned} \exp \left( \pi \sinh x\right)&=\frac{\tau }{\lambda }e^{i\pi }, \\ \sinh x&=\frac{1}{\pi }\ln \frac{\tau }{\lambda }+i(2k+1),\quad k\in \mathbb {Z}. \end{aligned}$$

By solving the above equation for each k, we obtain the complete set of poles. Assuming to work with the principal value of the logarithm and taking \(k=0\), we obtain the poles closest to the real axis \(x_{0}\) and its conjugate \(\overline{x_{0}}\), where

$$\begin{aligned} x_{0}&=\sinh ^{-1}\left( \frac{1}{\pi }\ln \frac{\tau }{\lambda }+i\right) \nonumber \\&=\ln \left( \frac{1}{\pi }\ln \frac{\tau }{\lambda }+i+\sqrt{\left( \frac{1 }{\pi }\ln \frac{\tau }{\lambda }\right) ^{2}+2i\frac{1}{\pi }\ln \frac{\tau }{\lambda }}\right) . \end{aligned}$$
(26)

In order to apply the bound on the strip we have to define

$$\begin{aligned} d=d(\lambda ,\tau )=r{\text {Im}}x_{0},\quad 0<r<1. \end{aligned}$$
(27)

The introduction of the factor r is necessary to avoid \({\xi }{ (d)\rightarrow +\infty }\) as \({\text {Im}}x_{0}\rightarrow \pi /2\), which verifies for \(\lambda \rightarrow \tau \) (see (17)).

4.1 Asymptotic Behaviors

Setting

$$\begin{aligned} s=\frac{1}{\pi }\ln \frac{\lambda }{\tau }, \end{aligned}$$

we have

$$\begin{aligned} \frac{1}{\pi }\ln \frac{\tau }{\lambda }=-s, \end{aligned}$$

and therefore we can write (26) as

$$\begin{aligned} x_{0}=\ln \left( s\left( -1+\frac{i}{s}+\sqrt{1-\frac{2i}{s}}\right) \right) . \end{aligned}$$

Assuming \(\lambda \gg \tau \), that is, \(s\gg 1\), and using

$$\begin{aligned} \sqrt{1-x}\approx 1-\frac{1}{2}x-\frac{1}{8}x^{2}-\frac{1}{16}x^{3},\quad x\approx 0, \end{aligned}$$
(28)

we obtain

$$\begin{aligned} \sqrt{1-\frac{2i}{s}}\approx 1-\frac{i}{s}+\frac{1}{2s^{2}}+\frac{i}{2s^{3}}. \end{aligned}$$

Using also \(\ln (1+x)\approx x\),

$$\begin{aligned} x_{0}&\approx \ln \left( s\left( -1+\frac{i}{s}+1-\frac{i}{s}+\frac{1}{ 2s^{2}}+\frac{i}{2s^{3}}\right) \right) \\&=\ln \left( s\left( \frac{1}{2s^{2}}+\frac{i}{2s^{3}}\right) \right) \\&=\ln \left( \frac{1}{2s}\right) +\ln \left( 1+\frac{i}{s}\right) \\&\approx \ln \left( \frac{1}{2s}\right) +\frac{i}{s}. \end{aligned}$$

Therefore, for \(\lambda \gg \tau \),

$$\begin{aligned} {\text {Im}}x_{0}\approx \frac{1}{s}=\frac{\pi }{\ln \frac{\lambda }{\tau }}. \end{aligned}$$
(29)

Assume now \(\lambda =1\) and \(\tau \gg 1\). By (26) we have

$$\begin{aligned} x_{0}=\ln \left( \frac{1}{\pi }\ln \tau +i+\sqrt{\left( \frac{1}{\pi }\ln \tau \right) ^{2}+2i\frac{1}{\pi }\ln \tau }\right) . \end{aligned}$$

Setting

$$\begin{aligned} s=\frac{1}{\pi }\ln \tau , \end{aligned}$$

we have

$$\begin{aligned} x_{0}&=\ln \left( s\left( 1+\frac{i}{s}+\sqrt{1+\frac{2i}{s}}\right) \right) \\&\approx \ln \left( s\left( 1+\frac{i}{s}+1+\frac{i}{s}\right) \right) \\&=\ln \left( 2s\left( 1+\frac{i}{s}\right) \right) \\&\approx \ln \left( 2s\right) +\frac{i}{s}, \end{aligned}$$

that finally leads to

$$\begin{aligned} {\text {Im}}x_{0}\approx \frac{1}{s}=\frac{\pi }{\ln \tau }. \end{aligned}$$
(30)

5 The Minimax Problem

Let us define the function

$$\begin{aligned} \varphi (\lambda ,\tau )=\xi (d)\lambda ^{-\alpha }\exp \left( \frac{-2\pi dn }{\ln \left( \frac{4dn}{\mu }\right) }\right) ,\quad d=d(\lambda ,\tau ), \end{aligned}$$

representing the \((\lambda ,\tau )\)-dependent factor of the error estimate given by (23), that is,

$$\begin{aligned} \mathcal {E}_{n,n,h}(g_{\lambda ,\psi _{DE}})\approx K_{\alpha }\varphi (\lambda ,\tau ), \end{aligned}$$

where \(K_{\alpha }\) is defined by (24). Since our aim is to work with a self-adjoint operator with spectrum contained in \([1, +\infty )\) the problem consists in defining properly the parameter \(\tau .\) This can be done by solving

$$\begin{aligned} \min _{\tau \ge 1}\max _{\lambda \ge 1}\varphi (\lambda ,\tau ). \end{aligned}$$
(31)

As for the true error, experimentally one observes that \(\tau \) must be taken much greater than 1, independently of \(\alpha \). Therefore, from now on the analysis will be based on the assumption \(\tau \gg 1\). Regarding the function \(\varphi (\lambda ,\tau )\), by taking \(d=d(\lambda ,\tau )\) as in (27) and n sufficiently large, again, one experimentally observes that with respect to \(\lambda \) the function initially decreases, reaches a local minimum (for \(\lambda =\tau \) in which \(d=r\pi /2\)), then a local maximum (much greater than \(\tau \)), and finally goes to 0 for \(\lambda \rightarrow +\infty \) (see Fig. 2). In this view, denoting by \(\overline{ \lambda }\) the local maximum, for n sufficiently large the problem (31) reduces to the solution of

$$\begin{aligned} \varphi (1,\tau )=\varphi (\overline{\lambda },\tau ). \end{aligned}$$
(32)

5.1 Evaluating the Local Maximum

Since \(0<d\le r\pi /2\), \(0<r<1\), we have

$$\begin{aligned} 0<C\le \cos d\cos \left( \frac{\pi }{2}\sin d\right) <1, \end{aligned}$$

where C is a constant depending on r. Therefore by (17),

$$\begin{aligned} 2 < \xi (d)\le \frac{2}{C}, \end{aligned}$$

so that we neglect the contribution of this function in what follows.

Since the maximum is seen to be much larger than \(\tau \), we consider the approximation (29). Therefore we have to solve

$$\begin{aligned} \frac{d}{d\lambda }\lambda ^{-\alpha }\exp \left( -\frac{2\pi r\frac{\pi }{ \ln \frac{\lambda }{\tau }}n}{\ln \left( \frac{4}{\mu }nr\frac{\pi }{\ln \frac{\lambda }{\tau }}\right) }\right) =0, \end{aligned}$$

that, after some manipulation leads to

$$\begin{aligned} \frac{d}{d\lambda }\lambda ^{-\alpha }\exp \left( -\frac{c_{1}n}{\ln \frac{ \lambda }{\tau }\,q(\lambda )}\right) =0, \end{aligned}$$

where

$$\begin{aligned} c_{1}=2\pi ^{2}r,\quad q(\lambda )=\ln \left( c_{2}n\right) -\ln \left( \ln \frac{\lambda }{\tau }\right) ,\quad c_{2}=\frac{4}{\mu }\pi r. \end{aligned}$$
(33)

We find the equation

$$\begin{aligned} -\alpha \lambda ^{-1}-\frac{d}{d\lambda }\left( \frac{c_{1}n}{\ln \frac{ \lambda }{\tau } \, q(\lambda ) }\right) =0, \end{aligned}$$

and since

$$\begin{aligned} \frac{d}{d\lambda }\left( \frac{c_{1}n}{\ln \frac{\lambda }{\tau } \, q(\lambda ) }\right)&=\frac{c_{1}n}{\lambda }\frac{1-q(\lambda )}{\left( \ln \frac{\lambda }{\tau }\right) ^{2}q(\lambda )^{2}}, \end{aligned}$$

we finally have to solve

$$\begin{aligned} \alpha +c_{1}n\frac{1-q(\lambda )}{\left( \ln \frac{\lambda }{\tau }\right) ^{2}q(\lambda )^{2}}=0. \end{aligned}$$
(34)

For large n we have

$$\begin{aligned} q(\lambda )&\approx \ln \left( c_{2}n\right) , \\ \frac{q(\lambda )-1}{q(\lambda )^{2}}&\approx \frac{1}{q(\lambda )}\approx \frac{1}{\ln \left( c_{2}n\right) }, \end{aligned}$$

so that the solution of (34) can be approximated by

$$\begin{aligned} \lambda ^{*}=\tau \exp \left( \sqrt{\frac{c_{1}n}{\alpha \ln \left( c_{2}n\right) }}\right) . \end{aligned}$$
(35)

For any given \(\tau \ge 1,\) it can be observed experimentally that \(\lambda ^{*}\) is a very good approximation of the local maximum (see Fig. 2).

Fig. 2
figure 2

Plot of the function \(\varphi (\lambda ,\tau ^{*})\) for \(n=40\) and \(\alpha =1/2\). The asterisk represents the approximation of the local maximum given by (35), that is, the point \(\left( \lambda ^{*},\varphi (\lambda ^{*},\tau ^{*})\right) \). The diamond represents the approximation of \(\varphi (\lambda ^{*}, \tau ^{*})\) stated in (38). Finally the circle is the approximation of \(\varphi (1,\tau ^{*})\) given in (39)

We also remark that the assumption on n stated in (21), that leads to the error estimate (23), is automatically fulfilled for \(\lambda =\lambda ^{*}\), at least for \(\alpha \) not too small. Indeed, using (27) and (29) we first observe that

$$\begin{aligned} d(\lambda ^{*},\tau )\approx \frac{r\pi }{\ln \frac{\lambda ^{*}}{ \tau }}=r\pi \sqrt{\frac{\alpha \ln \left( c_{2}n\right) }{c_{1}n}}. \end{aligned}$$
(36)

Then by (33), using \(\mu \le 1/2\) and assuming for instance \(0.9<r<1,\) after some simple computation we find

$$\begin{aligned} \frac{\mu e}{4d(\lambda ^{*},\tau )}&\approx \frac{\mu e}{4\pi r}\sqrt{ \frac{c_{1}n}{\alpha \ln \left( c_{2}n\right) }} \\&\le \frac{1}{3}\sqrt{\frac{n}{\alpha }}. \end{aligned}$$

Therefore the condition (21) holds true for \(n\ge 1/(9\alpha ).\)

5.2 The Error at the Local Maximum

By (36) clearly \(d(\lambda ^{*},\tau )\rightarrow 0\) for \( n\rightarrow +\infty \), and therefore from (17) we deduce that \(\xi (d(\lambda ^{*},\tau ))\rightarrow 2\) for \(n\rightarrow +\infty \). As consequence

$$\begin{aligned} \varphi (\lambda ^{*},\tau )\approx 2\left( \lambda ^{*}\right) ^{-\alpha }\exp \left( \frac{-2\pi d(\lambda ^{*},\tau )n}{\ln \left( \frac{4d(\lambda ^{*},\tau )n}{\mu }\right) }\right) . \end{aligned}$$

By defining

$$\begin{aligned} s_{n}=\sqrt{\frac{c_{1}n}{\alpha \ln \left( c_{2}n\right) }}, \end{aligned}$$
(37)

from (35) and (36) we have

$$\begin{aligned} \lambda ^{*}&=\tau \exp \left( s_{n} \right) , \\ d(\lambda ^{*},\tau )&\approx \frac{r\pi }{s_{n}}, \end{aligned}$$

and hence, after some computation

$$\begin{aligned} \left( \lambda ^{*}\right) ^{-\alpha }\exp \left( \frac{-2\pi d(\lambda ^{*},\tau )n}{\ln \left( \frac{4d(\lambda ^{*},\tau )n}{\mu }\right) }\right)&\approx \tau ^{-\alpha }\exp \left( -{\alpha }s_{n}\right) \exp \left( \frac{-2\pi \frac{ r\pi }{s_{n}}n}{\ln \left( \frac{ 4\frac{r\pi }{s_{n}}n}{\mu }\right) }\right) \\&=\tau ^{-\alpha }\exp \left( -{\alpha }\left( s_{n}+\frac{c_{1}n}{ \alpha s_{n}\ln \left( \frac{c_{2}n}{s_{n}}\right) }\right) \right) . \end{aligned}$$

By (37) we have

$$\begin{aligned} s_{n}+\frac{c_{1}n}{\alpha s_{n}\ln \left( \frac{c_{2}n}{s_{n}} \right) }&=\sqrt{\frac{c_{1}n}{\alpha \ln \left( c_{2}n\right) }}+\frac{c_{1}n}{ \sqrt{\frac{\alpha c_{1}n}{\ln \left( c_{2}n\right) }}\ln \left( \frac{c_{2}n}{s_{n}}\right) } \\&=\sqrt{\frac{c_{1}n}{\alpha \ln \left( c_{2}n\right) }}\left( 1+\frac{\ln \left( c_{2}n\right) }{\ln \left( \frac{c_{2}n}{s_{n}}\right) } \right) \\&\approx 3\sqrt{\frac{c_{1}n}{\alpha \ln \left( c_{2}n\right) }}, \end{aligned}$$

because

$$\begin{aligned} \frac{\ln \left( c_{2}n\right) }{\ln \left( \frac{c_{2}n}{s_{n} }\right) }\rightarrow 2\quad \text { for }\quad n\rightarrow +\infty . \end{aligned}$$

Joining the above approximations we finally obtain

$$\begin{aligned} \varphi (\lambda ^{*},\tau )&\approx 2\tau ^{-\alpha }\exp \left( -3 \sqrt{\alpha }\sqrt{\frac{c_{1}n}{\ln \left( c_{2}n\right) }}\right) \nonumber \\&=2\tau ^{-\alpha }\exp \left( -3 \alpha s_{n}\right) . \end{aligned}$$
(38)

5.3 Error at \(\lambda =1\)

By (30), that is,

$$\begin{aligned} d(1,\tau )\approx r\frac{\pi }{\ln \tau },\quad \tau \gg 1, \end{aligned}$$

we have again \(\xi (d(1,\tau ))\approx 2\) and therefore

$$\begin{aligned} \varphi (1,\tau )\approx 2\exp \left( \frac{-2\pi d(1,\tau )n}{\ln \left( \frac{4d(1,\tau )n}{\mu }\right) }\right) . \end{aligned}$$

Using (33) we find

$$\begin{aligned} \varphi (1,\tau )&\approx 2\exp \left( -\frac{2\pi r\frac{\pi }{\ln \tau }n }{\ln \left( \frac{4}{\mu }nr\frac{\pi }{\ln \tau }\right) }\right) \nonumber \\&=2\exp \left( -\frac{c_{1}n}{\ln \tau \left( \ln \left( c_{2}n\right) -\ln \left( \ln \tau \right) \right) }\right) \nonumber \\&\approx 2\exp \left( -\frac{c_{1}n}{\ln \tau \ln \left( c_{2}n\right) } \right) \nonumber \\&=2\exp \left( -\frac{\alpha s_{n}^{2}}{\ln \tau }\right) . \end{aligned}$$
(39)

5.4 Approximating the Optimal Value for \(\tau \)

We need to solve (32) for \(\tau .\) Using the approximations (39) and (38) we impose

$$\begin{aligned} \exp \left( -\frac{\alpha s_{n}^{2}}{\ln \tau }\right)&=\tau ^{-\alpha }\exp \left( -3 {\alpha }s_{n}\right) \\&=\exp \left( -3{\alpha }s_{n}-\alpha \ln \tau \right) , \end{aligned}$$

that is,

$$\begin{aligned} -\frac{\alpha s_{n}^{2}}{\ln \tau }=-3{\alpha }s_{n}-\alpha \ln \tau . \end{aligned}$$

Solving the above equation we find

$$\begin{aligned} \ln \tau&=\frac{\left( -3+\sqrt{13}\right) s_{n}}{2} \\&\approx 0.3 s_{n}, \end{aligned}$$

so that

$$\begin{aligned} \tau ^{*}=\exp \left( 0.3 s_{n} \right) \end{aligned}$$
(40)

represents an approximate solution of (32).

Fig. 3
figure 3

Error for the trapezoidal rule applied with the double-exponential transform (error DE), with the single-exponential transform (error SE) and error estimate given by (42)

In Fig. 2 we plot the function \(\varphi (\lambda ,\tau ^{*})\) for \(\lambda \in [1,10^{20}]\), in an example in which \(n=40\), \( \alpha =1/2\), and \(\tau ^{*}\cong 84.4\) defined by (40). Moreover we show the results of the approximations (35), (38) and (39), for \(\tau =\tau ^{*}\). Clearly the ideal situation would be to have \(\tau ^{*}\) such that \(\varphi (1,\tau ^{*})=\varphi (\overline{ \lambda },\tau ^{*})\), but notwithstanding all the approximations used, the results are fairly good and allow to have a simple expression for \(\tau ^{*}\).

By using (40) in (38) we obtain

$$\begin{aligned} \varphi (\lambda ^{*},\tau ^{*})\approx 2\exp \left( -3.3\sqrt{ \alpha }\sqrt{\frac{c_{1}n}{\ln \left( c_{2}n\right) }}\right) . \end{aligned}$$
(41)

Remembering that by (11)

$$\begin{aligned} E_{n,n,h}(\mathcal {L})\le 2\frac{\sin \left( \alpha \pi \right) }{\pi } \max _{\lambda \ge 1}\mathcal {E}_{n,n,h}(g_{\mathcal {\lambda },\psi _{DE}}), \end{aligned}$$

using (41) we finally obtain the error estimate

$$\begin{aligned} E_{n,n,h}(\mathcal {L})\approx \overline{K}_{\alpha }\exp \left( -3.3\sqrt{ \alpha }\sqrt{\frac{c_{1}n}{\ln \left( c_{2}n\right) }}\right) , \end{aligned}$$
(42)

where

$$\begin{aligned} \overline{K}_{\alpha }&=4\frac{\sin \left( \alpha \pi \right) }{\pi } K_{\alpha } \\&=4\frac{\sin \left( \alpha \pi \right) }{\pi }\frac{1}{\alpha (1-\alpha )} \frac{1}{1-e^{-\frac{\pi }{2}\mu e}}. \end{aligned}$$

In Fig. 3 we show the behavior of the method for the computation of \(\mathcal {L}^{-\alpha }\), where \(\mathcal {L}\) is the artificial operator

$$\begin{aligned} \mathcal {L}= [ { \mathop {\mathrm {diag}}(1, 2,\dots ,100) }]^{8},\quad \sigma (\mathcal {L}) \subseteq [1,10^{16}], \end{aligned}$$

together with the estimate (42). For comparison, in the same pictures we also plot the error of the SE approach. As mentioned in the introduction, the DE approach appears to be faster for \(1/2< \alpha <1.\)

Finally, we also consider the case of \(\mathcal {L}\) equal to the operator obtained by applying the three point finite difference discretization to the one dimensional Laplacian on \((0,\pi ),\) with Dirichlet boundary conditions. In Fig. 4 we show the results obtained by considering a uniform mesh with \(N=200\) internal points.

Fig. 4
figure 4

Spectral norm of the error of the method applied to the computation of \(\mathcal {L}^{-\alpha },\) where \(\mathcal {L}\) is the discrete one dimensional Laplacian

6 Conclusions

In this work we have analyzed the behavior of the trapezoidal rule for the computation of \(\mathcal {L}^{-\alpha }\), in connection with the double-exponential transformations. All the analysis has been based on the assumption of \(\mathcal {L}\) unbounded, so that the results can be applied even to discrete operators, with spectrum arbitrarily large, without the need to know its amplitude, that is, the largest eigenvalue. In particular we have introduced new error estimates for the scalar and the operator case for the double-exponential transform. The sharp estimate obtained for the scalar case has been fundamental for the proper selection of the parameter \(\tau \) that is necessary to obtain good results also for the operator case.