# Two Taylor Algorithms for Computing the Action of the Matrix Exponential on a Vector
## 3 Numerical Experiments
Set 1: One hundred diagonalizable \(128\times 128\) complex matrices with the form \(A=V\times D\times V^{T}\), where \(D\) is a diagonal matrix with complex eigenvalues and \(V\) is an orthogonal matrix obtained as \(V=H/\sqrt{128}\), being \(H\) a Hadamard matrix. The 2-norm of these randomly generated matrices varied from 0.1 to 339.4. The _\"exact\"_ action of the matrix exponential of \(A\) on a vector \(v\) was calculated computing first \(e^{A}=V\times e^{D}\times V^{T}\) (see [29], p. 10) and then \(e^{A}v\). 2. Set 2: One hundred non-diagonalizable \(128\times 128\) complex matrices generated as \(A=V\times J\times V^{T}\), where \(J\) is a Jordan matrix composed of complex eigenvalues with an algebraic multiplicity randomly varying between 1 and 3. \(V\) is an orthogonal matrixwhose randomly obtained elements become progressively larger from one matrix to the next. The 2-norm of these matrices reached values from 3.76 to 323.59. The _\"exact\"_ action of the matrix exponential on a vector was calculated as for the above set of matrices. 3. Set 3: Fifty matrices from the Matrix Computation Toolbox (MCT) [30] and twenty matrices from the Eigtool MATLAB Package (EMP) [31], all of them with a \(128\times 128\) size. With the aim of calculating the _\"exact\"_ action of the matrix exponential on a vector, the _\"exact\"_ exponential function \(e^{A}\) of each matrix \(A\) was initially computed according to the next algorithm consisting of the following three steps, employing the function vpa in each of them: 1. Diagonalise the matrix \(A\) via the MATLAB function eig and obtain the matrices \(V\) and \(D\) such that \(A=V\times D\times V^{-1}\). Then, the matrix \(E_{1}\) will be computed as \(E_{1}=V\times e^{D}\times V^{-1}\). 2. Calculate the matrix exponential of \(A\) by means of the MATLAB function expm, i.e., \(E_{2}=expm(A)\). 3. Take into account the _\"exact\"_ matrix exponential of \(A\) only if: \[\frac{\|E_{1}-E_{2}\|}{\|E_{1}\|}\leq u.\]  
Lastly, the _\"exact\"_ action was worked out as \(E_{1}v\), obviously again using the function vpa. Among the seventy-two matrices that initially constitute this third set, only forty-two of them (thirty-five from the MCT and seven from the EMP) could be satisfactorily processed in the numerical tests carried out. The 2-norm of these considered matrices ranged between 1 and 10,716. The reasons for the exclusion of the others are given below:  
* The _\"exact\"_ exponential function for matrices 4, 5, 10, 16, 17, 18, 21, 25, 26, 35, 40, 42, 43, 44, and 49 from the MCT and matrices 4, 6, 7, and 9 from the EMP could not be computed in accordance with the 3-step procedure previously described. * Matrices 2 and 15 incorporated in the MCT and matrices 1, 3, 5, 10, and 15 belonging to the EMP incurred in a very high relative error by some code, due to the ill-conditioning of these matrices. * Matrices 8, 11, 13, and 16 from the EMP were repeated, as they were also part of the MCT. Figures 1-3 show, respectively, the results of the numerical analyses carried out by means of each of the different codes in comparison with the three types of matrices considered. In more detail, these figures depict the normwise relative errors (a), the performance profiles (b), the ratios of normwise relative errors between expmtway1 and the rest of the implementations (c), the lowest and highest relative error rates (d), the polynomial orders and the Krylov subspace dimensions (e), the ratios of matrix-vector products between expmtway2 and the other codes (f), the response time (g), and the ratio of the execution time between expmtway2 and the remaining functions (h). Figure 1: Experimental results for Set 1. (**a**) Normwise relative errors. (**b**) Performance profile. (**c**) Ratio of relative errors. (**d**) Lowest and highest relative error rate. (**e**) Polynomial, interpolation and subspace orders. (**f**) Ratio of matrix–vector products. (**g**) Execution time. (**h**) Ratio of execution time. Figure 2: Experimental results for Set 2. (**a**) Normwise relative errors.