# Two Taylor Algorithms for Computing the Action of the Matrix Exponential on a Vector
## 3 Numerical Experiments  
In this section, several tests have been carried out to illustrate the accuracy and efficiency of two MATLAB codes based on Algorithms 1 and 2. All these experiments have been executed on Microsoft Windows 10 \(\times\) 64 PC system with an Intel Core i7 CPU Q720 @1.60 Ghz processor and 6 GB of RAM, using MATLAB R2020b. The following MATLAB codes have been compared among them:  
* expmvtay1: Implements the Algorithm 1, where absolute backward errors are assumed. The degree \(m\) of the Taylor polynomial used in the approximation will vary from 40 to 60. The maximum value allowed for the scaling parameter \(s\), so as not to give rise to an excessively high number of matrix-vector products, will be equal to 45. The code is available at [[http://personales.upv.es/joalab/software/expmvtay1.m](http://personales.upv.es/joalab/software/expmvtay1.m)]([http://personales.upv.es/joalab/software/expmvtay1.m](http://personales.upv.es/joalab/software/expmvtay1.m)) (accessed on 22 December 2021). * expmvtay2: Based on Algorithm 2. As mentioned before, it attempts to reduce the number of matrix-vector products required by the code expmvtay1. It considers the same limits of \(m\) and \(s\) as the previous function. The implementation can be downloaded from [[http://personales.upv.es/joalab/software/expmvtay2.m](http://personales.upv.es/joalab/software/expmvtay2.m)]([http://personales.upv.es/joalab/software/expmvtay2.m](http://personales.upv.es/joalab/software/expmvtay2.m)) (accessed on 22 December 2021). * expmAvtay: Code where \(e^{A}\) is firstly expressly computed, by using the function exptaynsv3 described in [26], and the matrix-vector product \(e^{A}v\) is then carried out. The code exptaynsv3 is based on a Taylor polynomial approximation to the matrix exponential function in combination with the scaling and squaring technique. The order \(m\) of the approximation polynomial will take values no greater than 30. * expmv: This function, implemented by [PERSON] and [PERSON] [17], computes \(e^{tA}v\) without explicitly forming \(e^{tA}\). It uses the scaling part of the scaling and squaring method together with a truncated Taylor series approximation to the matrix exponential. * expm_newAv: Code that first explicitly calculates \(e^{A}\) by means of the function expm_new, developed by [PERSON] and [PERSON] [27], and then multiplies it by the vector \(v\) to form \(e^{A}v\). The function expm_new is based on Pade approximants and it implements an improved scaling and squaring algorithm. * expleja: This code, based on the Leja interpolation method, computes the action of the matrix exponential of \(H\times A\) on a vector (or a matrix) \(v\)[28]. The result is similar to \(e^{tA\times A}v\), but the matrix exponential is not explicitly worked out. In our experiments, \(H\) will be equal to 1 and default values of the tolerance will be provided. * expv: Implementation of Sidje [23] that calculates \(e^{tA}v\) by using Krylov subspace projection techniques with a fixed dimension for the corresponding subspace. It does not compute the matrix exponential in isolation but instead, it calculates directly the action of the exponential operator on the operand vector. The matrix under consideration interacts only via matrix-vector products (matrix-free method). To evaluate the performance of the codes described above in accuracy and speed, a test battery composed of the following set of matrices has been used. For each matrix \(A\), a distinct vector \(v\) with random values in the interval [\(-0.5\), \(0.5\)] has been generated as well. MATLAB Symbolic Math Toolbox with 256 digits of precision was employed in all the computations to provide the _\"exact\"_ action of the matrix exponential of \(A\) on a vector \(v\), thanks to the vpa (variable-precision floating-point arithmetic) function:  
1.