next up previous
Next: An application: Solving a Up: A fast solver for Previous: The algorithm


Timings and stability issues

We made an implementation of the algorithm in matlab 4. For the interpolation points we tried roots of unity, equal spaced and Chebyshev interpolation points. As can be seen in the next figures, roots of unity give us the most accurate results.

Instead of using the superfast version of the rational interpolation solver we used the $ O(n^2)$ algorithm, however, even when we use this complexity our algorithm is even faster than $ O(n\sqrt {n})$, and can therefore be considered to be superfast. The reason why we prefer to use the $ O(n^2)$ univariate interpolation solver instead of the $ O(n\log^2(n))$ version, is because $ O(n\log^2(n))\approx \alpha\;
n\log^2(n)+O(n)$ and $ \alpha$ is a quite large constant. Therefor the $ O(n^2)$ version will in fact be faster then the $ O(n\log^2(n))$ version for not too large values of $ n$. To find a unique solution we had to insert some more conditions on the polynomials, we chose to find polynomials which are monic with regard to the variable $ x$ in $ p(x,y)$.

The data of the tests we performed were randomly generated, i.e., the matrices $ \Phi$ and $ \Psi$ are randomly generated within $ [0,1]$. For the first figure the interpolation points are the roots of unity.

Figure 1 shows us the 1-norm of the residual generated by the algorithm. For a fixed size always five problems of the same dimension were considered. You can see that for problems up to the size of two million the error stays within the range of the acceptable. The residual that we calculated here is an absolute residual, and is the 1-norm of the matrix $ M$ which consists of the following values:

$\displaystyle M_{i,j}=\left(p(\omega_i,\xi_j)\Phi_{i,j}+q(\omega_i,\xi_j)\Psi_{i,j}\right)_{i\in
I,j\in J} $

Figure 1: Norm-1 of the absolute residual for roots of unity.
\includegraphics[scale=0.7]{norm1res}

When dealing with other kinds of interpolation points, it is very important to choose a good representation of the polynomials. When using a representation in an orthogonal basis satisfying a three terms recurrence, the complexity of the algorithm does not change (only the constant factor may increase a bit (This factor corresponds with $ \beta$ in 6)), but the accuracy can increase dramatically. We performed tests on equal spaced interpolation points, with the standard basis and the Chebyshev basis, the second basis gave a solution which was more accurate, up to a factor $ 2$, i.e., when the first only had 4 accurate digits the second had about 8 accurate digits. This means that it is extremely important to take a good basis representation, to get accurate results.

Another obvious example that states our assumptions here above, is the following. We consider the same interpolation problem, which we try to solve now in Chebyshev interpolation points generated in the interval $ [0,1]$. Figure 2 corresponds to the solution of this problem when using the standard basis representation. The residual that is displayed is again the absolute residual.

Figure 2: Norm-1 for Chebyshev interpolation points, and the standard polynomial representation.
\includegraphics[scale=0.7]{standerr}

As can immediately be seen in the graph, very quick all the significant digits are lost, and the error keeps growing, in this case, with this polynomial representation the algorithm does not work at all. In Figure 3 the same problems are solved, but now, instead of presenting the polynomials in the standard basis we present them in the Chebyshev basis, this adaptation in the algorithm, does not increase the complexity, but dramatically increases the numerical stability, as the figure clearly shows.

Figure 3: Norm-1 for Chebyshev interpolation points, and the Chebyshev polynomial representation.
\includegraphics[scale=0.7]{cheberr}

These final examples show once more that it is very important to choose a good basis representation for the polynomials, in order to get accurate results.

We will now briefly deduce the asymptotic complexity of the algorithm that we use (when using the superfast rational interpolation approach, the complexity is of course even smaller). We assume that the rational interpolation solver is of order $ O(n^2)$. The first step consists of solving $ (d_2+1)$ interpolation problems of order $ (2d_1+1)$. The next step consists of solving $ 2(d_1+1)$ interpolation problems of order $ (d_2+1)$, this gives us as complexity, when we take

$\displaystyle \approx \beta\; n^2 + O(n)$ (6)

( and we neglect the term $ O(n)$):


    $\displaystyle \beta (d_2+1)\left((2d_1+1)^2\right)+2(d_1+1)\left((d_2+1)^2\right)$  
  $\displaystyle \leq$ $\displaystyle \beta (d_2+1)4\left((d_1+1)^2\right)+4(d_1+1)\left((d_2+1)^2\right)$  
  $\displaystyle \leq$ $\displaystyle 4 \beta (d_2+1)(d_1+1)\left(d_1+1+d_2+1\right)$  

The number of unknown parameters in the system we solve equals $ 2(d_2+1)(d_1+1)$, when we denote this number with $ n$, we clearly get:

    $\displaystyle 4 \beta (d_2+1)(d_1+1)\left(d_1+1+d_2+1\right)$  
  $\displaystyle =$ $\displaystyle 2n\beta\left(d_1+1+d_2+1\right)$  
  $\displaystyle \leq$ $\displaystyle O(n^2) .$  

This means that our algorithm is faster than $ n^2$ and therefor superfast (while we have not even used the superfast solver for the intermediate interpolation problems).

When using the superfast solver we get the folowing complexity:

$\displaystyle O\left(n\left(\log^2(d_1+1)+\log^2(d_2+1)\right)\right).$

And when we consider a special case namely $ d_1=d_2$ then the fast univariate solver leads to a complexity a little smaller than $ O(n\sqrt {n})$.

The next two figures are comparisons between the timed speed and the theoretical speed we deduced. You can see in Figure 4, which only shows the results for $ d_1=d_2$ that the algorithm is faster than $ O(n\sqrt {n})$. There is also a comparison between our solver and Gaussian elimination, you can see that the crossover appears to be lying around $ 1000$, so our algorithm is not only theoretically faster, but even in practical applications, our algorithm performs better than Gaussian elimination.

Figure 4: Timings for $ d_1=d_2$ compared with $ O(n\sqrt {n})$ and Gaussian-elimination.
\includegraphics[scale=0.7]{d1d2time}

The last figure makes a comparison between the timed results and Gaussian elimination. In this figure also measurements for $ d_1\neq
d_2$ are shown.

Figure 5: Timings compared with Gaussian elimination.
\includegraphics[scale=0.7]{alltime}


next up previous
Next: An application: Solving a Up: A fast solver for Previous: The algorithm
Raf Vandebril 2004-04-19