Approximating the pth root by composite rational functions
Best rational approximation to the th root
A landmark result of rational approximation theory states that the pth root on can be approximated by type rational functions with root-exponential accuracy. (By contrast, polynomials can only converge algebraically.) Specifically, there exist rational functions of type such that asymptotically as ,
where the constants were worked out by Stahl [3].
For example, here is the error curve of the minimax rational approximant of type to the cube root, shown on a semilogx scale. It has the famous equioscillation property at $5+5+2=12$ points:
p = 3;
f = chebfun(@(x)x^(1/p),[0 1],'splitting','on');
[~,~,r] = minimax(f,5,5);
xx = logspace(-15,0,1000)';
semilogx(xx,f(xx)-r(xx)), grid on
title('absolute error of type (5,5) minimax approximant')
Approximation by composite rational functions
In [1], Gawlik examined rational approximations of obtained by composing rational functions of lower degree. One example is the function defined recursively by
where is a parameter and
is a rational function of type , and the scaled function has the property that the relative error equioscillates at $2^k+1$ points on . For details, see [1,2]. Here is an illustration.
alp = 0.03; alpini = alp; % approximation on $[alp^p,1]$
rr = @(x)1;
for kk = 1:3
mu = ((alp-alp^p)/((p-1)*(1-alp)))^(1/p);
rr = @(x) 1/p*((p-1)*mu*rr(x) + x./(mu*rr(x)).^(p-1));
alp = p*alp / ((p-1)*mu + mu^(1-p)*alp^p);
end
y = @(x)2*alp/(1+alp)*rr(x);
xx = logspace(log10(alpini^p),0,1000);
relerr = (y(xx)-f(xx))./(f(xx));
semilogx(xx,relerr), grid on
title(['relative error of composite approximant, k=3, \alpha=',num2str(alpini)])
Instead of the relative error, we might be interested in the absolute error, for example when approximation at or near is of interest. How does it look? Here is a plot including much smaller values of .
xx = logspace(-15,0,1000);
abserr = y(xx)-f(xx);
semilogx(xx,abserr),grid on
LS = 'linestyle'; IN = 'interpreter'; LT = 'latex';
CO = 'color'; FS = 'fontsize'; MS = 'markersize';
line([alpini^p alpini^p],norm(abserr,inf)*[-1 0.5],LS,'--',CO,'r')
text(alpini^p*1.1,-norm(abserr,inf),'$\alpha^p$',IN,LT,FS,18,CO,'r')
title(['absolute error of composite approximant, k=3, \alpha=',num2str(alpini)])
The error is oscillating with growing amplitude on as expected, and it takes the smallest values near . On , the error grows towards , but stays bounded.
The picture looks quite different if we start with a different value of . For example with a larger ,
alp = 0.1; alpini = alp;
rr = @(x)1;
for kk = 1:3
mu = ((alp-alp^p)/((p-1)*(1-alp)))^(1/p);
rr = @(x) 1/p*((p-1)*mu*rr(x) + x./(mu*rr(x)).^(p-1));
alp = p*alp / ((p-1)*mu + mu^(1-p)*alp^p);
end
y2 = @(x)2*alp/(1+alp)*rr(x);
xx = logspace(-15,0,1000);
abserr2 = y2(xx)-f(xx);
hold off, semilogx(xx,abserr2), grid on
line([alpini^p alpini^p],norm(abserr,inf)*[-1 0.5],LS,'--',CO,'r')
text(alpini^p*1.1,-norm(abserr,inf),'$\alpha^p$',IN,LT,FS,18,CO,'r')
title(['absolute error of composite approximant, k=3, \alpha=',num2str(alpini)])
Here is a run with a smaller .
alp = 0.01; alpini = alp;
rr = @(x)1;
for kk = 1:3
mu = ((alp-alp^p)/((p-1)*(1-alp)))^(1/p);
rr = @(x) 1/p*((p-1)*mu*rr(x) + x./(mu*rr(x)).^(p-1));
alp = p*alp / ((p-1)*mu + mu^(1-p)*alp^p);
end
y3 = @(x)2*alp/(1+alp)*rr(x);
xx = logspace(-15,0,1000);
abserr3 = y3(xx)-f(xx);
hold off, semilogx(xx,abserr3), grid on
line([alpini^p alpini^p],norm(abserr,inf)*[-1 0.5],LS,'--',CO,'r')
text(alpini^p*1.1,-norm(abserr,inf),'$\alpha^p$',IN,LT,FS,18,CO,'r')
title(['absolute error of composite approximant, k=3, \alpha=',num2str(alpini)])
The maximum absolute error is attained at either or . In [2] we showed that by balancing the errors at these endpoints we obtain a good composite rational approximant to . How does the convergence compare with minimax? With respect to the degree, it is of course worse. The rational approximants are of type . For example, let's compare minimax with the first approximant above.
[~,~,r,err] = minimax(f,9,8);
minimaxerr = r(xx)-f(xx);
hold off, semilogx(xx,abserr), grid on
hold on
semilogx(xx,minimaxerr)
text(xx(20),abserr(1)+4e-3,'composite',IN,LT,CO,'b')
text(xx(20),minimaxerr(1)+4e-3,'minimax',IN,LT,CO,'r')
title('composite vs. minimax approximants type (9,8), absolute error')
hold offTrial interpolant too far from optimal...
Trying AAA-Lawson-based initialization...
It can be shown that with respect to the degree, the composite rational approximant converges almost "pth root exponentially", that is, the error scales roughly like where is the degree. More precisely, we obtain the bound
where is a positive constant depending on , is the degree of , and
But we claim that composite approximants are still interesting, because they can be generated using very few parameters---only parameters are used to express a rational function of degree $3^k$. For example, here is a convergence comparison with respect to the degrees of freedom. With a double exponential convergence with respect to , composite rational approximants eventually outperform minimax.
k = 10; % max. number of compositions
n = 1:30;
stahl = exp(-2*pi*sqrt(n))*4^(1+1/p)*sin(pi/p); % Stahl's minimax estimate
semilogy(2*n,stahl,'.-',MS,12)
grid on, hold on
nn = p.^(0:k);
exponent = log(p/(p-1))*log(2) / (log(2*p/(p-1))*log(p)); % exponent obtained in [2]
b = 3; % experimental constant
semilogy(p*(1:k+1),exp(-b*nn.^exponent)*10,'.-',MS,12);
xlabel('degrees of freedom'), ylabel('error')
text(p*(k/2),exp(-b*nn(1)^(1/exponent)),'composite',FS,12)
text(40,stahl(end)*10,'minimax',FS,12)
This makes composite rational approximants attractive in e.g. computing functions at a matrix argument, for which the efficiency gain can be exponential as compared to the minimax approximant. For details, see [2].
References
[1] E. S. Gawlik, Rational minimax iterations for computing the matrix th root, arXiv:1903.06268, 2019.
[2] E. S. Gawlik and Y. Nakatsukasa, Approximating the th root by composite rational functions, arXiv:1906.11326, 2019.
[3] H. Stahl. Best uniform rational approximation of on , Acta Math., 190 (2003), 241-306