Abstract
Several improvements are made to an algorithm of Higham and Smith for computing the matrix cosine. The original algorithm scales the matrix by a power of 2 to bring the ∞-norm to 1 or less, evaluates the [8/8] Padé approximant, then uses the double-angle formula cos (2A)=2cos 2A−I to recover the cosine of the original matrix. The first improvement is to phrase truncation error bounds in terms of ‖A2‖1/2 instead of the (no smaller and potentially much larger quantity) ‖A‖. The second is to choose the degree of the Padé approximant to minimize the computational cost subject to achieving a desired truncation error. A third improvement is to use an absolute, rather than relative, error criterion in the choice of Padé approximant; this allows the use of higher degree approximants without worsening an a priori error bound. Our theory and experiments show that each of these modifications brings a reduction in computational cost. Moreover, because the modifications tend to reduce the number of double-angle steps they usually result in a more accurate computed cosine in floating point arithmetic. We also derive an algorithm for computing both cos (A) and sin (A), by adapting the ideas developed for the cosine and intertwining the cosine and sine double angle recurrences.
Similar content being viewed by others
References
P.I. Davies and N.J. Higham, A Schur–Parlett algorithm for computing matrix functions, SIAM J. Matrix Anal. Appl. 25(2) (2003) 464–485.
N.J. Higham, Functions of a Matrix: Theory and Computation, in preparation.
N.J. Higham, The Matrix Computation Toolbox, http://www.ma.man.ac.uk/~higham/mctoolbox.
N.J. Higham, Evaluating Padé approximants of the matrix logarithm, SIAM J. Matrix Anal. Appl. 22(4) (2001) 1126–1135.
N.J. Higham, The scaling and squaring method for the matrix exponential revisited, SIAM J. Matrix Anal. Appl. 26(4) (2005) 1179–1193.
N.J. Higham and M.I. Smith, Computing the matrix cosine, Numerical Algorithms 34 (2003) 13–26.
C.S. Kenney and A.J. Laub, Condition estimates for matrix functions, SIAM J. Matrix Anal. Appl. 10(2) (1989) 191–209.
A. Magnus and J. Wynn, On the Padé table of cos z, Proc. Amer. Math. Soc. 47(2) (1975) 361–367.
M.S. Paterson and L.J. Stockmeyer, On the number of nonscalar multiplications necessary to evaluate polynomials, SIAM J. Comput. 2(1) (1973) 60–66.
S.M. Serbin, Rational approximations of trigonometric matrices with application to second-order systems of differential equations, Appl. Math. Comput. 5(1) (1979) 75–92.
S.M. Serbin and S.A. Blalock, An algorithm for computing the matrix cosine, SIAM J. Sci. Statist. Comput. 1(2) (1980) 198–204.
Author information
Authors and Affiliations
Corresponding author
Additional information
Communicated by C. Brezinski
AMS subject classification
65F30
Numerical Analysis Report 461, Manchester Centre for Computational Mathematics, February 2005.
Gareth I. Hargreaves: This work was supported by an Engineering and Physical Sciences Research Council Ph.D. Studentship.
Nicholas J. Higham: This work was supported by Engineering and Physical Sciences Research Council grant GR/T08739 and by a Royal Society–Wolfson Research Merit Award.
Rights and permissions
About this article
Cite this article
Hargreaves, G.I., Higham, N.J. Efficient algorithms for the matrix cosine and sine. Numer Algor 40, 383–400 (2005). https://doi.org/10.1007/s11075-005-8141-0
Received:
Accepted:
Issue Date:
DOI: https://doi.org/10.1007/s11075-005-8141-0