1 Introduction

Despite being long-investigated in the literature, univariate polynomial interpolation still represents a prolific research topic (for an overview of the most recent results we refer to Ibrahimoglu 2016; Trefethen 2013).

We start by fixing some notations. Let \(\varOmega =[a,b]\subset {\mathbb {R}}\) be a bounded interval and \({\mathcal {X}}_{n+1}=\{x_i\}_{i=0,\dots ,n}\subset \varOmega \), \(n\in {\mathbb {N}}\) be a set of \(n+1\) distinct nodes sorted in increasing order. We denote by \({\mathbb {P}}_n\) the space of polynomials of degree at most n.

The classical recovering problem consists in finding an (unknown) function, say \(f:\varOmega \longrightarrow {\mathbb {R}}\), by imposing some conditions at \({\mathcal {X}}_{n+1}\). If we look for the polynomial \(P_{n,f}\in {\mathbb {P}}_n\) that satisfies the interpolation conditions

$$\begin{aligned} P_{n,f}(x_i)= f_i, \quad i=0,\ldots ,n, \end{aligned}$$
(1)

where \(\mathcal{F}_{n+1}= \{ f_i :=f(x_i)\}_{i=0, \ldots , n}\) is the set of function values, the recovering problem is an interpolation problem.

Using the monomial basis \(\mathrm {M}_n=\{1,x,\dots ,x^n\}\) of \({\mathbb {P}}_n\), the interpolating polynomial takes the form

$$\begin{aligned} P_{n,f}(x)=\sum _{i=0}^n{c_ix^i}, \end{aligned}$$

where the vector of coefficients \(\varvec{c}=(c_0,\dots ,c_n)^{\intercal }\) is determined by solving the linear system

$$\begin{aligned} V\varvec{c}=\varvec{f}, \end{aligned}$$
(2)

where \(V=V(x_0,\dots ,x_n) \in {\mathbb {R}}^{n+1} \times {\mathbb {R}}^{n+1}\) is the well-known Vandermonde matrix and \(\varvec{f}=(f_0,\dots ,f_n)^{\intercal }\). We remark that the linear system (2) admits a unique solution as long as the nodes are distinct.

The interpolating polynomial can be also expressed in the Lagrange basis \(\mathrm {L}_n=\{\ell _0,\dots ,\ell _n\}\), so that

$$\begin{aligned} P_{n,f}(x)=\sum _{i=0}^n{f_i\ell _i(x)},\quad x\in \varOmega , \end{aligned}$$

where

$$\begin{aligned} \ell _i(x):=\prod _{\begin{array}{c} j=0 \\ j\ne i \end{array}}^n {\frac{x-x_j}{x_i-x_j}},\quad i=0,\dots ,n,\;x\in \varOmega \end{aligned}$$

is the i-th elementary Lagrange polynomial which depends only on the set of nodes \({\mathcal {X}}_{n+1}\).

The conditioning of the interpolation process, as well as its stability, can be measured in terms of the so-called Lebesgue constant

$$\begin{aligned} \varLambda ({\mathcal {X}}_{n+1},\varOmega )=\max _{x\in \varOmega }\lambda ({\mathcal {X}}_{n+1};x), \end{aligned}$$

where \( \lambda ({\mathcal {X}}_{n+1};x)=\sum _{i=0}^n{|\ell _i(x)|},\;x\in \varOmega \), is the Lebesgue function. Indeed, letting \(f\in C(\varOmega )\), we have

$$\begin{aligned} \max _{x\in \varOmega }{|f(x)-P_{n,f}(x)|}\le (1+\varLambda ({\mathcal {X}}_{n+1},\varOmega ))E^{\star }_n(f), \end{aligned}$$

being \(E^{\star }_n(f)\) the best polynomial approximation error in the space \({\mathbb {P}}_n\) (cf., e.g., Rivlin 2003).

As well-known the Lebesgue constant in the case of equidistant nodes shows an exponential growth with n which implies the impossibility to use equispaced points for polynomial interpolation when n becomes larger and larger (cf. Brutman 1997).

Therefore, lots of efforts have been put in finding good or optimal sets of nodes, i.e., nodes whose correspondent Lebesgue constant has a controlled growth. Popular well-behaved nodes are the Chebyshev \({\mathcal {T}}_n\) and Chebyshev–Lobatto points \({\mathcal {U}}_{n+1}\), i.e.,

$$\begin{aligned} {\mathcal {T}}_n=\bigg \{\cos \bigg (\frac{(2j-1)\pi }{n}\bigg )\bigg \}_{j=1,\dots ,n}\qquad {\mathcal {U}}_{n+1}=\bigg \{\cos \bigg (\frac{j\pi }{n}\bigg )\bigg \}_{j=0,\dots ,n}, \end{aligned}$$

which have been extensively studied in the literature (see e.g. Rivlin 1974) and retain a logarithmic growth of the corresponding Lebesgue constant (Brutman 1978; McCabe and Phillips 1973).

Recently in De Marchi et al. (2021b), the authors introduced the set of \((\beta ,\gamma )\)-Chebyshev points of \(I=[-1,1]\), \(\beta ,\gamma \in {\mathbb {R}}\), \(\beta ,\gamma >0\), \(\beta +\gamma <2\), which can be considered as a generalization of classical Chebyshev nodes and are defined as follows

$$\begin{aligned} {\mathcal {U}}^{\beta ,\gamma }_{n+1}:=\bigg \{\cos \bigg ( \frac{(2-\beta -\gamma )j\pi }{2n}+\frac{\gamma \pi }{2}\bigg )\bigg \}_{j=0,\dots ,n}. \end{aligned}$$
(3)

This family of nodes, in fact, includes the sets \({\mathcal {T}}_{n+1}\) (\(\beta =\gamma =1/(n+1)\)) and \({\mathcal {U}}_{n+1}\) (\(\beta =\gamma =0\)) as particular instances. Furthermore, \(\varLambda ({\mathcal {U}}^{\beta ,\gamma }_{n+1},I)={\mathcal {O}}(\log {n})\) for small values of the parameters \(\beta ,\gamma \) (De Marchi et al. 2021b). Moreover, by taking the Kosloff Tal-Ezer (KTE) map (cf. Adcock and Platte 2016)

$$\begin{aligned} M_{\alpha }(x) =\frac{\sin (\alpha \pi x/2)}{\sin (\alpha \pi /2)},\quad x\in I, \end{aligned}$$
(4)

and the set of equispaced points in \(I^{\beta ,\gamma }=[-1+\beta ,1-\gamma ]\), say

$$\begin{aligned} {\mathcal {E}}^{\beta ,\gamma }_{n+1}= \bigg \{1-\gamma -\frac{(2-\beta -\gamma )j}{n}\bigg \}_{j=0,\dots ,n}, \end{aligned}$$

then \({\mathcal {U}}^{\beta ,\gamma }_{n+1}=M_1({\mathcal {E}}^{\beta ,\gamma }_{n+1})\).

In applications, very often, one only disposes of a given set of nodes along with the related function values, and resampling the unknown underlying function at a different well-behaved set of nodes, as in Berrut and Elefante (2020), might be unfeasible.

The mapped bases or Fake Nodes Approach (FNA), first introduced in De Marchi et al. (2020c), allows us to change the set of nodes without the need of resampling the function. Although here we are interested in the univariate polynomial interpolation case, we point out that such approach has been also extended to other settings and higher dimensions (Berrut et al. 2020; De Marchi et al. 2020d, 2021a, c).

We briefly recall the FNA construction. Let \(S:\varOmega \longrightarrow {\mathbb {R}}\) be an injective map and \(S(\varOmega )\subseteq {\widetilde{\varOmega }}\). Moreover, let \(P_{n,g}:{\widetilde{\varOmega }}\longrightarrow {\mathbb {R}}\) be the polynomial interpolating the set of function values \(\mathcal{F}_{n+1}\) at the set of fake nodes \(S({\mathcal {X}}_{n+1})\), with g being a function such that

Then, we can define the interpolant \(R^S_{n,f}\in \text {span} \{(S(x))^i, \; i=0,\dots ,n\}\) as

$$\begin{aligned} R^S_{n,f}(x) :=P_{n,g}(S(x)) = \sum _{i=0}^n{c_i^S S(x)^i},\quad x\in \varOmega , \end{aligned}$$

where the vector of coefficients \(\varvec{c}^S=(c_0^S,\dots ,c_n^S)^{\intercal }\) is determined by solving the linear system \(V^S\varvec{c}^S=\varvec{f}\), where \(V^S=V(S(x_0),\dots ,S(x_n))\) (cf. (2)). Furthermore, it has been shown the remarkable equivalence

$$\begin{aligned} \varLambda ^S({\mathcal {X}}_n,\varOmega ) = \varLambda (S({\mathcal {X}}_n),S(\varOmega )), \end{aligned}$$
(5)

where \(\varLambda ^S({\mathcal {X}}_n,\varOmega )=\max _{x\in \varOmega }\lambda ^S({\mathcal {X}}_{n+1};x)\) is the Lebesgue constant built upon the mapped Lagrange basis \(\mathrm {L}_n^S=\{\ell ^S_0,\dots ,\ell ^S_n\}\), where

$$\begin{aligned} \ell ^S_i(x):=\prod _{\begin{array}{c} j=0 \\ j\ne i \end{array}}^n {\frac{S(x)-S(x_j)}{S(x_i)-S(x_j)}},\quad i=0,\dots ,n,\;x\in \varOmega . \end{aligned}$$

The FNA has been successfully applied, using different maps, in mitigating both Runge’s (Runge 1901; Turetskii 1940) and Gibbs phenomenon, which arises in many contexts when the function to be recovered presents jump discontinuities (De Marchi et al. 2017, 2020a; Gottlieb and Shu 1997). Concerning the former, as we previously pointed out, the set of equispaced points \({\mathcal {E}}^{0,0}_{n+1}\) in I can be mapped into the set of Chebyshev–Lobatto points \({\mathcal {U}}_{n+1}\) by taking \(S=M_1\), which guarantees a stable interpolation process. Dealing with the latter, by adopting the S-Gibbs map, the function S is constructed in such a way that it is discontinuous at the jumps of the underlying function. While this strategy is successful in the treatment of the Gibbs phenomenon, the resulting set of fake nodes is not well-behaved and thus the interpolation process is unstable as n gets larger.

In this work, our aim is to ensure stability in the treatment of the Gibbs phenomenon in the FNA framework. Indeed, we want to show that, under certain assumptions, it is possible to construct a mapped polynomial basis that enjoys these two properties:

  1. 1.

    the basis functions are discontinuous at some chosen points, therefore the basis is suitable for preventing the appearance of the Gibbs phenomenon according to the FNA;

  2. 2.

    the interpolation process is stable, i.e., the Lebesgue constant related to the resulting set of fake nodes has controlled growth.

The paper is organized as follows. In Sect. 2, we analyze the behavior of the Lebesgue function corresponding to the S-Gibbs mapped basis in the limit case, i.e., when the magnitude of the shift goes to infinity. The setting of equispaced points is investigated in Sect. 3, where we provide the construction of a stable mapped basis obtained via the Gibbs–Runge-Avoiding Stable Polynomial Approximation (GRASPA) approach, which will be introduced later. In Sect. 4 we perform some numerical tests that confirm the theoretical findings. Finally, conclusions and future works will be discussed in Sect. 5.

2 On the conditioning related to the S-Gibbs map in the limit case

2.1 The case of a single discontinuity

Let \(\xi \in \mathring{\varOmega }\) be such that the two subsets of \({\mathcal {X}}_{n+1}\)

$$\begin{aligned} {\mathcal {X}}^1:=\{x_i\in {\mathcal {X}}_{n+1}\,|\, x_i \le \xi \},\quad {\mathcal {X}}^2:=\{x_i\in {\mathcal {X}}_{n+1}\,|\, x_i > \xi \}, \end{aligned}$$

satisfy

$$\begin{aligned} |{\mathcal {X}}^1|-|{\mathcal {X}}^2|\in \{-1,0,1\}. \end{aligned}$$
(6)

We also denote \(\varOmega ^1= [a,\xi ]\) and \(\varOmega ^2= ]\xi ,b]\).

Letting \(\kappa \in {\mathbb {R}},\;\kappa >0\), we consider then the map \(S_\kappa :\varOmega \longrightarrow {\mathbb {R}}\) as

$$\begin{aligned} S_\kappa (x)= {\left\{ \begin{array}{ll} x &{}\quad \text {if } x\in \varOmega ^1,\\ x+\kappa &{}\quad \text {if }x\in \varOmega ^2,\end{array}\right. } \end{aligned}$$
(7)

which corresponds to a general S-Gibbs map, introduced in De Marchi et al. (2020c), in the case of one discontinuity. Indeed, in view of (7), we refer to \(\xi \) as the discontinuity point.

In the following, we adopt the shortened notations

\(\varLambda ^\kappa ({\mathcal {X}}_{n+1},\varOmega ):=\varLambda ^{S_\kappa }({\mathcal {X}}_{n+1},\varOmega )\), \(\lambda ^\kappa ({\mathcal {X}}_{n+1};\cdot ):=\lambda ^{S_\kappa }({\mathcal {X}}_{n+1};\cdot )\) and \(\ell ^\kappa _i:=\ell ^{S_\kappa }_i\), \(i=0,\dots ,n\) (cf. Sect. 1).

We are interested in studying the limit

$$\begin{aligned} \varLambda ^{\infty }({\mathcal {X}}_{n+1},\varOmega ) = \lim _{\kappa \rightarrow \infty }{\varLambda ^\kappa ({\mathcal {X}}_{n+1},\varOmega )}. \end{aligned}$$

Without loss of generality, being n the polynomial degree, we can restrict our analysis to the following two cases:

  1. 1.

    The case where \(|{\mathcal {X}}^1|=|{\mathcal {X}}^2|\) (i.e. the odd case).

  2. 2.

    The case where \(|{\mathcal {X}}^1|=|{\mathcal {X}}^2|+1\) (i.e. the even case).

2.1.1 The odd case

Let be \(\eta ={\lfloor }\frac{n}{2}{\rfloor }\). It is straightforward to observe that if \(i\le \eta \) then \(x_i\in \varOmega ^1\), otherwise \(x_i\in \varOmega ^2\) if \(i> \eta \).

Let us suppose \(i\le \eta \). Then

$$\begin{aligned} \ell ^\kappa _i(x)&= \underbrace{\prod _{\begin{array}{c} j=0 \\ j\ne i \end{array}}^{\eta } {\frac{S_{\kappa }(x)-x_j}{x_i-x_j}}}_{A_i(x)}\underbrace{\prod _{j=\eta +1}^n{\frac{S_{\kappa }(x)-x_j-{\kappa }}{x_i-x_j-{\kappa }}}}_{B_i(x)}. \end{aligned}$$
(8)

Moreover, in view of (7), we have

(9)

Thus, we obtain

$$\begin{aligned} \ell ^{\infty }_i(x) :=\lim _{{\kappa }\rightarrow \infty }{\ell ^{\kappa }_i(x)}= {\left\{ \begin{array}{ll} \prod \limits _{\begin{array}{c} j=0 \\ j\ne i \end{array}}^{\eta } {\frac{x-x_j}{x_i-x_j}} &{}\quad \text {if } x\in \varOmega ^1.\\ 0 &{}\quad \text {if }x\in \varOmega ^2.\end{array}\right. } \end{aligned}$$

Indeed, as \({\kappa }\rightarrow \infty \), and asymptotically as \(1/{\kappa }\).

Taking now the case \(i> \eta \), analogous considerations lead us to

$$\begin{aligned} \ell ^{\infty }_i(x)= {\left\{ \begin{array}{ll} 0 &{}\quad \text {if } x\in \varOmega ^1,\\ \prod \limits _{\begin{array}{c} j=\eta +1\\ j\ne i \end{array}}^{n} {\frac{x-x_j}{x_i-x_j}}&\quad \text {if }x\in \varOmega ^2.\end{array}\right. } \end{aligned}$$

Therefore, we get

$$\begin{aligned} \lambda ^{\infty }({\mathcal {X}}_{n+1},x)= {\left\{ \begin{array}{ll} \lambda ({\mathcal {X}}^1,x) &{}\quad \text {if } x\in \varOmega ^1,\\ \lambda ({\mathcal {X}}^2,x) &{}\quad \text {if } x\in \varOmega ^2,\end{array}\right. } \end{aligned}$$

and, as a consequence,

$$\begin{aligned} \varLambda ^{\infty }({\mathcal {X}}_{n+1},\varOmega )=\max {\big \{\varLambda ({\mathcal {X}}^1,\varOmega ^1),\varLambda ({\mathcal {X}}^2,\varOmega ^2)\big \}}. \end{aligned}$$

2.1.2 The even case

In what follows, our aim is to replicate the analysis carried out in the odd case, eventually obtaining slightly different results, as we will discuss.

First, let now \(\eta =\frac{n}{2}\) and let us suppose \(i\le \frac{n}{2}\). The considerations in (8) and (9) still hold true, thus we proceed taking again the limit \({\kappa }\rightarrow \infty \). While , here we have

Therefore, by defining

$$\begin{aligned} r_i(x):=\underbrace{\prod \limits _{j=\eta +1}^n{(x-x_j)}}_{\omega _{\eta }(x)} \underbrace{\prod \limits _{\begin{array}{c} j=0 \\ j\ne i \end{array}}^{\eta }{\frac{1}{x_i-x_j}}}_{w_i}, \end{aligned}$$

as \({\kappa }\rightarrow \infty \) we get and

$$\begin{aligned} \ell ^{\infty }_i(x)= {\left\{ \begin{array}{ll} \prod \limits _{\begin{array}{c} j=0 \\ j\ne i \end{array}}^{\eta } {\frac{x-x_j}{x_i-x_j}} &{}\quad \text {if } x\in \varOmega ^1.\\ (-1)^{n/2}r_i(x) &{}\quad \text {if }x\in \varOmega ^2.\end{array}\right. } \end{aligned}$$

Remark 1

We point out that the function \(r_i\) consists of the nodal polynomial \(\omega _{\eta }\) built on \({\mathcal {X}}^2\) times the ith barycentric Lagrange weight \(w_i\) related to \({\mathcal {X}}^1\). As observed in Ghili and Iaccarino (2015), as n gets larger, the growth of \(r_i\) is directly linked to the choice of well-behaved nodes in \(\varOmega ^1\) and \(\varOmega ^2\). For instance, if the points of \({\mathcal {X}}^2\) are distributed according to the Chebyshev–Lobatto nodes, we have (cf. Salzer 1972)

$$\begin{aligned} \omega _\eta (x)\le 2^{-\frac{n}{2}+2}. \end{aligned}$$

The case \(i>\eta \) is similar to the odd case. In fact, letting then \(i>\eta \), we write

$$\begin{aligned} \ell ^{\kappa }_i(x)&= \underbrace{\prod _{j=0}^{\eta } {\frac{S_{\kappa }(x)-x_j}{x_i-x_j}}}_{C_i(x)}\underbrace{\prod _{\begin{array}{c} j=\eta +1 \\ j\ne i \end{array}}^n{\frac{S_{\kappa }(x)-x_j-{\kappa }}{x_i-x_j-{\kappa }}}}_{D_i(x)}. \end{aligned}$$

Thus, we have

Therefore, as \({\kappa }\rightarrow \infty \), and asymptotically as \(1/{\kappa }^2\), implying

$$\begin{aligned} \ell ^{\infty }_i(x)= {\left\{ \begin{array}{ll} 0 &{}\quad \text {if } x\in \varOmega ^1.\\ \prod \limits _{\begin{array}{c} j=\eta +1 \\ j\ne i \end{array}}^{n} {\frac{x-x_j}{x_i-x_j}}&\quad \text {if }x\in \varOmega ^2.\end{array}\right. } \end{aligned}$$

Finally, we obtain

$$\begin{aligned} \lambda ^{\infty }({\mathcal {X}}_{n+1},x)= {\left\{ \begin{array}{ll} \lambda ({\mathcal {X}}^1,x) &{}\quad \text {if } x\in \varOmega ^1,\\ \sum _{i=0}^{\eta }{|r_i(x)|}+\lambda ({\mathcal {X}}^2,x) &{}\quad \text {if } x\in \varOmega ^2\end{array}\right. } \end{aligned}$$

and

$$\begin{aligned} \varLambda ^{\infty }({\mathcal {X}}_{n+1},\varOmega )=\max {\big \{\varLambda ({\mathcal {X}}^1,\varOmega ^1),R({\mathcal {X}}^2,\varOmega ^2)\big \}}, \end{aligned}$$

where

$$\begin{aligned} R({\mathcal {X}}^2,\varOmega ^2):=\max _{x\in \varOmega ^2}{\bigg (\sum _{i=0}^{\eta }{|r_i(x)|}+\lambda ({\mathcal {X}}^2,x)\bigg )}. \end{aligned}$$

The results obtained in this section are summarized in the following theorem.

Theorem 1

Let \(\varOmega =[a,b]\subset {\mathbb {R}}\) be a bounded set and let \({\mathcal {X}}_{n+1}:=\{x_i\}_{i=0,\dots ,n}\subset \varOmega \), \(n\in {\mathbb {N}}\), be a set of distinct nodes, sorted in increasing order. Let \(\xi \in \varOmega \) be such that the two subsets

$$\begin{aligned} {\mathcal {X}}^1= \{x_i\in {\mathcal {X}}_n\,|\, x_i \le \xi \},\quad {\mathcal {X}}^2=\{x_i\in {\mathcal {X}}_n\,|\, x_i > \xi \}, \end{aligned}$$

satisfy one of the following properties.

  1. 1.

    \(|{\mathcal {X}}^1|=|{\mathcal {X}}^2|\) (i.e. the odd case);

  2. 2.

    \(|{\mathcal {X}}^1|=|{\mathcal {X}}^2|+1\) (i.e. the even case).

Moreover, let \(\varOmega ^1= [a,\xi ]\), \(\varOmega ^2= ]\xi ,b]\) and let \(S_{\kappa }:\varOmega \longrightarrow {\mathbb {R}}\), \({\kappa }\in {\mathbb {R}},\;{\kappa }>0\), be defined as

$$\begin{aligned} S_{\kappa }(x):={\left\{ \begin{array}{ll} x &{}\quad \text {if } x\in \varOmega ^1,\\ x+{\kappa } &{}\quad \text {if }x\in \varOmega ^2.\end{array}\right. } \end{aligned}$$

Furthermore, let \(\varLambda ^{\kappa }({\mathcal {X}}_{n+1},\varOmega )\) be the Lebesgue constant related to the mapped Lagrange basis \(\mathrm {L}^{\kappa }:=\{\ell _0^{\kappa },\dots ,\ell _n^{\kappa }\}\), where

$$\begin{aligned} \ell ^{\kappa }_i(x):=\prod _{\begin{array}{c} j=0 \\ j\ne i \end{array}}^n{\frac{S_{\kappa }(x)-S_{\kappa }(x_j)}{S_{\kappa }(x_i)-S_{\kappa }(x_j)}},\quad i=0,\dots ,n,\;x\in \varOmega . \end{aligned}$$

Then, we have

$$\begin{aligned} \lim _{{\kappa }\rightarrow \infty }{\varLambda ^{\kappa }({\mathcal {X}}_{n+1},\varOmega )}={\left\{ \begin{array}{ll} \max {\big \{\varLambda ({\mathcal {X}}^1,\varOmega ^1),\varLambda ({\mathcal {X}}^2,\varOmega ^2)\big \}} &{}\quad \text {in the odd case,}\\ \max {\big \{\varLambda ({\mathcal {X}}^1,\varOmega ^1),R({\mathcal {X}}^2,\varOmega ^2)\big \}} &{}\quad \text {in the even case,}\end{array}\right. } \end{aligned}$$

where

$$\begin{aligned} \begin{aligned}&R({\mathcal {X}}^2,\varOmega ^2)= \max _{x\in \varOmega ^2}{\bigg (\sum _{i=0}^{n/2}{|r_i(x)|}+\lambda ({\mathcal {X}}^2,x)\bigg )},\\&r_i(x)= \prod \limits _{j=n/2+1}^n{(x-x_j)}\prod \limits _{\begin{array}{c} j=0 \\ j\ne i \end{array}}^{n/2}{\frac{1}{x_i-x_j}}, \end{aligned} \end{aligned}$$

and \(\varLambda \), \(\lambda \) are the classical Lebesgue constant and function.

Proof

See the discussion in Sects. 2.1.1 and 2.1.2.\(\square \)

Remark 2

The assumption in (6) is crucial to provide a bounded Lebesgue constant \(\varLambda ^{\infty }({\mathcal {X}}_{n+1},\varOmega )\). Moreover, the role played by \({\mathcal {X}}_1\) and \({\mathcal {X}}_2\) may be switched in the even case, yielding to analogous results.

2.2 Dealing with multiple discontinuities

In what follows, we extend the analysis carried out in the previous subsection to the case where multiple discontinuities occur on \(\varOmega \). While presenting strong similarities when compared to the single discontinuity setting, here some limitations arise and some adjustments are needed.

Theorem 2

Let \(\varOmega =[a,b]\subset {\mathbb {R}}\) be a bounded set and let \({\mathcal {X}}_{n+1}:=\{x_i\}_{i=0,\dots ,n}\subset \varOmega \), \(n\in {\mathbb {N}}\), be a set of distinct nodes, sorted in increasing order. Let \(\xi _1<\dots <\xi _d\in \varOmega \setminus \{a,b\}\), \(d\in {\mathbb {N}}\), \(d\ge 2\) and let

$$\begin{aligned} {\mathcal {D}}:=\{\varOmega ^1,\dots ,\varOmega ^{d+1}\} \end{aligned}$$

be a collection of subsets of \(\varOmega \) such that \(\varOmega ^1= [a,\xi _1]\), \(\varOmega ^{d+1}=]\xi _d,b]\) and \(\varOmega ^i=]\xi _{i-1},\xi _i]\) for \(i=2,\dots ,d\).

Assume that

$$\begin{aligned} |{\mathcal {X}}^{\nu }|-|{\mathcal {X}}^{\tau }|\in \{-1,0,1\}, \end{aligned}$$

where , \(\nu ,\tau =1,\dots ,d+1\).

In view of (7), consider the map defined as

where \(\tau =1,\dots ,d+1\). Introducing then the notation \(\ell ^\kappa _{i,\mu }\) to denote the i-th Lagrange polynomial where \(x_i\in {\mathcal {X}}^{\mu }\), we have that

On the other hand, if \(\tau \ne \mu \) we obtain

where

$$\begin{aligned} C_{\mu ,\tau }=\prod _{\begin{array}{c} \nu =1 \\ \nu \ne \mu ,\tau \end{array}}^{d+1}\bigg |\frac{\tau -\nu }{\mu -\nu }\bigg |^{|{\mathcal {X}}^\nu |} \end{aligned}$$
(10)

and

$$\begin{aligned} r_{i,\mu ,\tau }(x):=\prod \limits _{x_j\in {\mathcal {X}}^{\tau }}{(x-x_j)}\prod \limits _{\begin{array}{c} x_j\in {\mathcal {X}}^{\mu } \\ j\ne i \end{array}}{\frac{1}{x_i-x_j}}. \end{aligned}$$

Proof

We can write

where

$$\begin{aligned} p_1(x)&:=\prod _{\begin{array}{c} \nu =1 \\ \nu \ne \mu ,\tau \end{array}}^{d+1}\prod _{x_j\in {\mathcal {X}}^{\nu }}\frac{x-x_j+(\tau -\nu )\kappa }{x_i-x_j+(\mu -\nu )\kappa },\\ p_2(x)&:=\prod _{\begin{array}{c} x_j\in {\mathcal {X}}^{\mu }\\ j\ne i \end{array}}\frac{x-x_j+(\tau -\nu )\kappa }{x_i-x_j} \prod _{x_j\in {\mathcal {X}}^{\tau }}\frac{x-x_j}{x_i-x_j+(\mu -\nu )\kappa }. \end{aligned}$$

Then, we take the limit as \(\kappa \rightarrow \infty \). If \(\tau =\mu \), then

$$\begin{aligned} \lim _{\kappa \rightarrow \infty }|p_1(x)|= 1,\qquad \lim _{\kappa \rightarrow \infty } |p_2(x)|= \prod _{\begin{array}{c} x_j\in {\mathcal {X}}^{\mu }\\ j\ne i \end{array}}\bigg |\frac{x-x_j}{x_i-x_j}\bigg |, \end{aligned}$$

which implies

If \(\tau \ne \mu \), we get immediately

$$\begin{aligned} \lim _{\kappa \rightarrow \infty } |p_1(x)| = \prod _{\begin{array}{c} \nu =1 \\ \nu \ne \mu ,\tau \end{array}}^{d+1}\bigg |\frac{\tau -\nu }{\mu -\nu }\bigg |^{|{\mathcal {X}}^\nu |}:=C_{\mu ,\tau }. \end{aligned}$$

Moreover, by defining

$$\begin{aligned} r_{i,\mu ,\tau }(x):=\prod \limits _{x_j\in {\mathcal {X}}^{\tau }}{(x-x_j)}\prod \limits _{\begin{array}{c} x_j\in {\mathcal {X}}^{\mu } \\ j\ne i \end{array}}{\frac{1}{x_i-x_j}}, \end{aligned}$$

we have

$$\begin{aligned} \lim _{\kappa \rightarrow \infty } |p_2(x)|= {\left\{ \begin{array}{ll} 0 \text { as } \kappa ^{-1} &{}\quad \text {if } |{\mathcal {X}}^{\tau }|=|{\mathcal {X}}^{\mu }|,\\ 0 \text { as } \kappa ^{-2} &{}\quad \text {if } |{\mathcal {X}}^{\tau }|=|{\mathcal {X}}^{\mu }|+1,\\ |r_{i,\mu ,\tau }(x)| &{}\quad \text {if } |{\mathcal {X}}^{\tau }|=|{\mathcal {X}}^{\mu }|-1.\end{array}\right. } \end{aligned}$$

As a consequence,

\(\square \)

Therefore, in the multiple discontinuities framework with \(d\ge 2\), we observe that the factor \(C_{\mu ,\tau }\) in (10) might be exponentially increasing (or decreasing) as n gets larger, and thus it might determine a possible fast asymptotic growth of the Lebesgue constant \({\varLambda ^{\infty }({\mathcal {X}}_{n+1},\varOmega )}\) (cf. Theorem 1). For example, in the case \(d=2\) we have

$$\begin{aligned} \begin{aligned}&C_{1,2} =2^{-|{\mathcal {X}}^3|},\;C_{3,2} = 2^{-|{\mathcal {X}}^1|},\; C_{2,1} = 2^{|{\mathcal {X}}^3|},\;C_{2,3} = 2^{|{\mathcal {X}}^1|},\;C_{1,3} = C_{3,1} = 1.\\ \end{aligned} \end{aligned}$$
(11)

In the following, we highlight the case where the nodes are equally distributed among the sets in \({\mathcal {D}}\).

Corollary 1

In the hypotheses of Theorem 2, if we restrict to the case

$$\begin{aligned} |{\mathcal {X}}^{\nu }|=|{\mathcal {X}}^{\tau }| \end{aligned}$$

for every \(\nu ,\tau =1,\dots ,d+1\), then

$$\begin{aligned} \lim _{{\kappa }\rightarrow \infty }{\varLambda ^{\kappa }({\mathcal {X}}_n,\varOmega )}=\max {\big \{\varLambda ({\mathcal {X}}^1,\varOmega ^1),\dots ,\varLambda ({\mathcal {X}}^{d+1},\varOmega ^{d+1})\big \}}. \end{aligned}$$

Proof

The thesis directly follows from the results of Theorem 2.\(\square \)

3 Working with equispaced nodes

From now, we assume to sample our underlying function at the set of equispaced points

$$\begin{aligned} {\mathcal {X}}_{n+1}= \bigg \{-a+\frac{(b-a)j}{n}\bigg \}_{j=0,\dots ,n}. \end{aligned}$$
(12)

Let \(d\ge 1\) and let \(\xi _1<\dots <\xi _{d}\), \({\mathcal {D}}=\{\varOmega ^1,\dots ,\varOmega ^{d+1}\}\), \({\mathcal {X}}^1,\dots ,{\mathcal {X}}^{d+1}\) be defined as in Theorem 2. Recalling what introduced in Sect. 1, it is easy to observe that for every \(i=1,\dots ,d+1\), by setting \(\xi _0=a\) and \(\xi _{d+1}=b\), there exists the affine map onto the interval \(I=[-1,1]\), \(F^{i}:\varOmega ^i\longrightarrow I\),

$$\begin{aligned} F^{i}(x):=\frac{2(x-\xi _{i-1})}{\xi _i-\xi _{i-1}}-1,\quad i=1,\dots ,d+1, \end{aligned}$$
(13)

and parameters \(\beta _i,\gamma _i\in {\mathbb {R}},\; \beta _i,\gamma _i>0, \beta _i+\gamma _i < 2\), such that

$$\begin{aligned} F^{i}\big ({\mathcal {X}}^i \big )={\mathcal {E}}^{\beta _i,\gamma _i}_{|{\mathcal {X}}^i|},\quad i=1,\dots ,d+1, \end{aligned}$$

which, composed with the KTE map (4) with \(\alpha =1\), gives

$$\begin{aligned} (M_1\circ F^{i})\big ({\mathcal {X}}^i \big )={\mathcal {U}}^{\beta _i,\gamma _i}_{|{\mathcal {X}}^i|},\quad i=1,\dots ,d+1. \end{aligned}$$
(14)

Then, by denoting the inverse of \(F^{i}\) as \(G^{i}\), i.e.,

$$\begin{aligned} G^{i}(x):=\frac{(\xi _i-\xi _{i-1})(x+1)}{2}+\xi _{i-1},\quad i=1,\dots ,d+1, \end{aligned}$$

we can define the Multiple KTE (MKTE) map on \(\varOmega \) with respect to the set \({\mathcal {D}}\) as

$$\begin{aligned} M^{\varOmega ,{\mathcal {D}}}_{\alpha }(x):=\sum _{i=1}^{d+1}{\chi ^{i}(x)\cdot \big ( G^{i}\circ M_{\alpha }\circ F^{i}\big )(x)},\quad x\in \varOmega , \end{aligned}$$
(15)

where \(\chi ^{i}(x)\) is the characteristic function related to the set \(\varOmega ^i\). \(M^{\varOmega , {\mathcal {D}}}_\alpha \) maps \(\varOmega \) into itself and it is a continuous and monotonically increasing function.

Therefore, when \(\alpha =1\),

$$\begin{aligned} \varLambda (M^{\varOmega ,{\mathcal {D}}}_1({\mathcal {X}}_{n+1})\cap \varOmega ^i,\varOmega ^i) = \varLambda ({\mathcal {U}}^{\beta _i,\gamma _i}_{|{\mathcal {X}}^i|},I),\quad i=1,\dots ,d+1. \end{aligned}$$
(16)

In other words, if we apply the mapping \(M^{\varOmega ,{\mathcal {D}}}_1\) to the set of equispaced nodes \({\mathcal {X}}_{n+1}\), then on every subset \(\varOmega ^i\) the Lebesgue constant corresponding to the mapped nodes that belong to \(\varOmega ^i\) can be fully understood in the framework of \((\beta ,\gamma )\)-Chebyshev nodes, \(i=1,\dots ,d+1\).

Then, considering the map

$$\begin{aligned} Q^{\varOmega ,{\mathcal {D}}}_{\kappa }:=\big (S_{\kappa }\circ M^{\varOmega ,{\mathcal {D}}}_1\big ), \end{aligned}$$
(17)

the resulting mapped basis

$$\begin{aligned} \mathrm {Q}^{\varOmega ,{\mathcal {D}}}_{\kappa ,n}=\{1,Q^{\varOmega ,{\mathcal {D}}}_{\kappa },\dots ,\big (Q^{\varOmega ,{\mathcal {D}}}_{\kappa }\big )^n\}, \end{aligned}$$
(18)

represents an effective choice for the interpolation at \({\mathcal {X}}_{n+1}\) of a function having jump discontinuities at \(\xi _1,\dots ,\xi _d\) in \(\varOmega \), as long as \(\beta _i,\gamma _i\) are small enough and \(\kappa \rightarrow \infty \). Indeed, \(Q^{\varOmega ,{\mathcal {D}}}_{\infty }\) provides the reduction of the Gibbs effect by virtue of \(S_{\infty }\), and mitigates possible local Runge’s effects thanks to the composition with \(M^{\varOmega ,{\mathcal {D}}}_1\), by constructing local well-behaved distributed nodes. We refer to this limit case as Gibbs–Runge-Avoiding Stable Polynomial Approximation (GRASPA) approach, to \(Q^{\varOmega ,{\mathcal {D}}}_{\infty }\) and \(\mathrm {Q}^{\varOmega ,{\mathcal {D}}}_{\infty ,n}\) as the GRASPA map and basis, respectively.

Thanks to Corollary 1 and Theorem 3 in De Marchi et al. (2021b), the following holds.

Proposition 1

Let \(\varOmega =[a,b]\subset {\mathbb {R}}\) be a bounded set and let \({\mathcal {X}}_{n+1}\) be as in (12). Let \(\xi _1<\dots <\xi _d\in \varOmega \setminus \{a,b\}\), \(d\in {\mathbb {N}}\), \(d\ge 2\) be the discontinuity points and let

$$\begin{aligned} {\mathcal {D}}:=\{\varOmega ^1,\dots ,\varOmega ^{d+1}\} \end{aligned}$$

be a collection of subsets of \(\varOmega \) such that \(\varOmega ^1= [a,\xi _1]\), \(\varOmega ^{d+1}=]\xi _d,b]\) and \(\varOmega ^i=]\xi _{i-1},\xi _i]\) for \(i=2,\dots ,d\). Moreover,

$$\begin{aligned} |{\mathcal {X}}^{\nu }|=|{\mathcal {X}}^{\tau }| \end{aligned}$$

for every \(\nu ,\tau =1,\dots ,d+1\). Then if the mapped points (14) \({\mathcal {U}}^{\beta _i,\gamma _i}_{|{\mathcal {X}}^i|},\) are such that \(\delta :=\max _{i,j} \{\beta _i,\gamma _j\}\) is bounded as

$$\begin{aligned} \delta < \frac{4}{\pi N^2 (2+\pi \log (N+1))}, \end{aligned}$$

with \(N=\max _\tau |{\mathcal {X}}^\tau |\), then

$$\begin{aligned} \lim _{{\kappa }\rightarrow \infty }{\varLambda ^{\kappa }({\mathcal {X}}_n,\varOmega )}={\mathcal {O}}\left( \log N \right) . \end{aligned}$$

Remark 3

In this section, we focused on the case where the nodes are equispaced in \(\varOmega \). However, we point out that the above approach may be applied to a general interpolation nodes set by mapping it to a set of equispaced nodes beforehand.

4 Numerics

Throughout this section, we consider \(\varOmega =[-1,1]\), the corresponding set of equispaced nodes \({\mathcal {X}}_{n+1}\) and, as an approximation of the limit case, \(\kappa =10{,}000\). We point out that any interval \(\varOmega =[a,b]\) might be considered, by taking the corresponding set of equispaced nodes. Indeed, the Lebesgue constant is invariant under invertible affine mapping of the domain (see e.g. Ibrahimoglu 2016, Section 2.1).

The tests make a comparison between our GRASPA approach, classical interpolation and S-Gibbs algorithm. A Python implementation for the mapped bases approach is available at De Marchi et al. (2020b).

4.1 Test with one discontinuity

Let us consider the function

$$\begin{aligned} f_1(x)= {\left\{ \begin{array}{ll} \frac{1}{25(2x+1)^2+1}-\frac{1}{2} &{}\quad \text {if}~ x\le 0,\\ \sin (2x)\cos (3x)+\frac{1}{2} &{}\quad \text {if}~ x> 0, \end{array}\right. }\quad x\in \varOmega , \end{aligned}$$

which is discontinuous at \(\xi =0\). Therefore, \({\mathcal {D}}=\{\varOmega ^1,\varOmega ^2\}\) with \(\varOmega ^1=[-1,\xi ],\varOmega ^2=]\xi ,1]\).

4.1.1 Case n odd

In this case, \(|{\mathcal {X}}^1|=|{\mathcal {X}}^2|=(n+1)/2\), \(M^{\varOmega ,{\mathcal {D}}}_1({\mathcal {X}}^1)\) and \(M^{\varOmega ,{\mathcal {D}}}_1({\mathcal {X}}^2)\) are distributed in \(\varOmega ^1\) and \(\varOmega ^2\) according to \({\mathcal {U}}^{0,\gamma _1}_{(n+1)/2}\) and \({\mathcal {U}}^{\beta _2,0}_{(n+1)/2}\), with \(\gamma _1=\beta _2=2/(n+1)\), with the Lebesgue constants \(\varLambda ({\mathcal {U}}^{0,\gamma _1}_{(n+1)/2},\varOmega )\) and \(\varLambda ({\mathcal {U}}^{\beta _2,0}_{(n+1)/2},\varOmega )\) growing logarithmically (cf. De Marchi et al. 2021b). Therefore, we expect a logarithmic growth also of the Lebesgue constant \(\varLambda ^{{\mathcal {Q}}^{\varOmega ,{\mathcal {D}}}_{\kappa }}({\mathcal {X}}_{n+1},\varOmega )\) constructed upon the mapped basis \(\mathrm {Q}^{\varOmega ,{\mathcal {D}}}_{\kappa ,n}\).

The results are shown in Figs. 1 and 2. In particular, letting \(\varXi =\{{\tilde{x}}_i= -1+2\frac{i}{99}\,:\,i=0,\dots ,99\}\) and \(t_i:=|\ell ^{{\mathcal {Q}}^{\varOmega ,{\mathcal {D}}}_{\kappa }}_i|\), in Fig. 2 (right) we display the matrix L, with \(L_{i,j}=t_i({\tilde{x}}_j)\).

In Fig. 3 we show some interpolation results concerning \(f_1\) with the above discussed approaches, whereas in Fig. 4 we display the Relative Maximum Absolute Error (RMAE) computed on a grid of 332 equispaced evaluation points.

Fig. 1
figure 1

The Lebesgue functions with \(n=23\). From left to right: classical approach, S-Gibbs interpolant and the GRASPA interpolant

Fig. 2
figure 2

Left: the Lebesgue constant. Classical approach in dots, S-Gibbs in dashed, GRASPA in solid line. Right: the matrix L for \(n=51\)

Fig. 3
figure 3

The function \(f_1\) in dashed red and the interpolant with \(n=23\) in black. From left to right: classical, S-Gibbs and GRASPA approach, respectively

Fig. 4
figure 4

The RMAE: classical approach in dots, S-Gibbs in dashed, GRASPA in solid line

As we can notice, the S-Gibbs map resolves the Gibbs phenomenon by splitting the interpolation problem in the two subintervals. However, if the Runge’s phenomenon takes place, the interpolating function diverges, but by means of the GRASPA map we could prevent the appearance of both.

4.1.2 Case n even

Here, \(M^{\varOmega ,{\mathcal {D}}}_1({\mathcal {X}}^1)\) and \(M^{\varOmega ,{\mathcal {D}}}_1({\mathcal {X}}^2)\) are distributed in \(\varOmega ^1\) and \(\varOmega ^2\) according to \({\mathcal {U}}^{0,0}_{n/2+1}\) and \({\mathcal {U}}^{\beta _2,0}_{n/2}\) respectively, with \(\beta _2=4/n\). In this case, we have a logarithmic growth of \(\varLambda ({\mathcal {U}}^{0,0}_{n/2+1},\varOmega )\) and a linear growth of \(\varLambda ({\mathcal {U}}^{\beta _2,0}_{n/2},\varOmega )\). Therefore, \(\varLambda ^{{\mathcal {Q}}^{\varOmega ,{\mathcal {D}}}_{\kappa }}({\mathcal {X}}_{n+1},\varOmega )\) is linearly growing.

Fig. 5
figure 5

The matrix L for \(n=51\). Left: without the usage of the map \(V_n\). Right: taking the mapping \(Q^{\varOmega ,{\mathcal {D}}}_{\kappa }\circ V_{n}\)

Fig. 6
figure 6

The Lebesgue constant (left) and the RMAE (right). Classical approach in dots, S-Gibbs in dashed, GRASPA in solid line (with the additional mapping \(V_n\))

To recover the logarithmic growth of the Lebesgue constant, we consider a further continuous map \(V_{n}\) on \(\varOmega \)

$$\begin{aligned} V_{n}(x)= {\left\{ \begin{array}{ll} x &{}\quad \text {if}~ -1\le x\le \xi ,\\ \frac{nx}{2(n-1)} &{}\quad \text {if}~ \xi <x\le 2/n,\\ \frac{nx}{n-1}-\frac{1}{n-1} &{}\quad \text {if}~ 2/n\le x \le 1, \end{array}\right. } \end{aligned}$$

with the purpose of moving the equispaced nodes \({\mathcal {X}}^2\) closer to \(\xi \). Indeed, by applying \(V_n\) the spacing between \(\xi \) and the first point is half the spacing between the others. Furthermore, we remark that \((M^{\varOmega ,{\mathcal {D}}}_1\circ V_{n})({\mathcal {X}}^2)\) is distributed in \(\varOmega ^2\) according to \({\mathcal {U}}^{\beta _2,0}_{n/2}\), with \(\beta _2=2/n\). Therefore, the map \(Q^{\varOmega ,{\mathcal {D}}}_{\kappa }\circ V_{n}\) yields to a logarithmic growth of the corresponding Lebesgue constant (see Fig. 5). As in the odd case, we achieve stability in interpolation of \(f_1\) as shown in Fig. 6.

4.2 Test with three discontinuities

Let us consider the function

$$\begin{aligned} f_2(x)= {\left\{ \begin{array}{ll} \frac{1}{25(4x+3)^2+1}-\frac{1}{2} &{}\quad \text {if}~ x\le -\frac{1}{2},\\ |4x-1| &{}\quad \text {if}~ 0<x\le \frac{1}{2},\\ \sin (2x)\cos (3x)+\frac{1}{2} &{}\quad \text {otherwise,} \end{array}\right. },\quad x\in \varOmega , \end{aligned}$$

which is discontinuous at \(\xi _1=-1/2\), \(\xi _2=0\) and \(\xi _3=1/2\).

As analyzed in Sect. 4.1.2, the usage of the GRASPA approach might lead to \((\beta ,\gamma )\)-Chebyshev points that do not present a logarithmic growth of the Lebesgue constant, being \(\beta \) or \(\gamma \) too large. In this test, we choose \(n=4j+1\), \(j=0,1,\dots \), so that there is no need of additional mappings for achieving a logarithmic growth of the Lebesgue constant (cf. Sect. 4.1.2).

In Figs. 789 and 10 , we display the obtained results.

Fig. 7
figure 7

The Lebesgue functions with \(n=29\). From left to right: classical approach, S-Gibbs interpolant and the GRASPA interpolant

Fig. 8
figure 8

The function \(f_2\) in dashed red and the interpolant with \(n=29\) in black. From left to right: classical, S-Gibbs and GRASPA approach, respectively

Fig. 9
figure 9

Left: the Lebesgue constant, classical approach in dots, S-Gibbs in dashed, GRASPA in solid line. Right: the matrix L for \(n=50\)

Fig. 10
figure 10

The RMAE concerning the interpolation of \(f_2\). Classical approach is in dots, the dashed line is S-Gibbs interpolant and the solid line is the GRASPA approach

Fig. 11
figure 11

Left: the Lebesgue constant of the interpolant related the GRASPA approach. Right: the matrix L for \(n=89\)

In Fig. 11, we show the diverging behavior of the Lebesgue constant related to the GRASPA approach for very high values of n. This is due to the fact that, being \(\kappa \) fixed, at a certain point the growth with n of \(C_{\mu ,\tau }\) overtakes the decreasing to zero of the term \(p_2\) when \(\kappa \) gets larger and larger (see Theorem 2).

5 Conclusions

In this paper, we presented a new mapped polynomial basis approach that substantially mitigates both Runge’s and Gibbs phenomena. This technique, named the Gibbs–Runge-Avoiding Stable Polynomial Approximation (GRASPA) approach, is built combining the limit case of the S-Gibbs Fake Nodes Approach (cf. Sect. 2) and the Kosloff–Tal-Ezer map (4). As a result, the so-constructed mapped polynomial basis turns out to be a stable and an effective choice for the interpolation of functions presenting jump discontinuities. Motivated by the promising results of the new approach, we are working on the extension to higher dimensions.