Abstract

Existing algorithms for computing the matrix cosine are tightly coupled to a specific precision of floating-point arithmetic for optimal efficiency so they do not conveniently extend to an arbitrary precision environment. We develop an algorithm for computing the matrix cosine that takes the unit roundoff of the working precision as input, and so works in an arbitrary precision. The algorithm employs a Taylor approximation with scaling and recovering and it can be used with a Schur decomposition or in a decomposition-free manner. We also derive a framework for computing the Fréchet derivative, construct an efficient evaluation scheme for computing the cosine and its Fréchet derivative simultaneously in arbitrary precision, and show how this scheme can be extended to compute the matrix sine, cosine, and their Fréchet derivatives all together. Numerical experiments show that the new algorithms behave in a forward stable way over a wide range of precisions. The transformation-free version of the algorithm for computing the cosine is competitive in accuracy with the state-of-the-art algorithms in double precision and surpasses existing alternatives in both speed and accuracy in working precisions higher than double.

Keywords

  1. multiprecision algorithm
  2. multiprecision arithmetic
  3. matrix cosine
  4. matrix exponential
  5. matrix function
  6. Fréchet derivative
  7. double angle formula
  8. Taylor approximation
  9. forward error analysis
  10. MATLAB

MSC codes

  1. 15A16
  2. 65F30
  3. 65F60

Get full access to this article

View all available purchase options and get full access to this article.

References

1.
A. H. Al-Mohy, A truncated Taylor series algorithm for computing the action of trigonometric and hyperbolic matrix functions, SIAM J. Sci. Comput., 40 (2018), pp. A1696--A1713, https://doi.org/10.1137/17M1145227.
2.
A. H. Al-Mohy and N. J. Higham, Computing the Fréchet derivative of the matrix exponential, with an application to condition number estimation, SIAM J. Matrix Anal. Appl., 30 (2009), pp. 1639--1657, https://doi.org/10.1137/080716426.
3.
A. H. Al-Mohy and N. J. Higham, A new scaling and squaring algorithm for the matrix exponential, SIAM J. Matrix Anal. Appl., 31 (2009), pp. 970--989, https://doi.org/10.1137/09074721X.
4.
A. H. Al-Mohy, N. J. Higham, and S. D. Relton, Computing the Fréchet derivative of the matrix logarithm and estimating the condition number, SIAM J. Sci. Comput., 35 (2013), pp. C394--C410, https://doi.org/10.1137/120885991.
5.
A. H. Al-Mohy, N. J. Higham, and S. D. Relton, New algorithms for computing the matrix sine and cosine separately or simultaneously, SIAM J. Sci. Comput., 37 (2015), pp. A456--A487, https://doi.org/10.1137/140973979.
6.
P. Alonso, J. Ibánez, J. Sastre, J. Peinado, and E. Defez, Efficient and accurate algorithms for computing matrix trigonometric functions, J. Comput. Appl. Math., 309 (2017), pp. 325--332, https://doi.org/10.1016/j.cam.2016.05.015.
7.
J. Bezanson, A. Edelman, S. Karpinski, and V. B. Shah, Julia: A fresh approach to numerical computing, SIAM Rev., 59 (2017), pp. 65--98, https://doi.org/10.1137/141000671.
8.
M. Caliari and F. Zivcovich, On-the-fly backward error estimate for matrix exponential approximation by Taylor algorithm, J. Comput. Appl. Math., 346 (2019), pp. 532--548, https://doi.org/10.1016/j.cam.2018.07.042.
9.
P. I. Davies and N. J. Higham, A Schur--Parlett algorithm for computing matrix functions, SIAM J. Matrix Anal. Appl., 25 (2003), pp. 464--485, https://doi.org/10.1137/S0895479802410815.
10.
E. Defez, J. Ibánez, J. M. Alonso, and P. Alonso-Jordá, On Bernoulli series approximation for the matrix cosine, Math. Methods Appl. Sci., (2020), in press, https://doi.org/10.1002/mma.7041.
11.
E. Defez, J. Ibánez, J. Peinado, J. Sastre, and P. Alonso-Jordá, An efficient and accurate algorithm for computing the matrix cosine based on new Hermite approximations, J. Comput. Appl. Math., 348 (2019), pp. 1--13, https://doi.org/10.1016/j.cam.2018.08.047.
12.
N. J. Dingle and N. J. Higham, Reducing the influence of tiny normwise relative errors on performance profiles, ACM Trans. Math. Software, 39 (2013), 24, https://doi.org/10.1145/2491491.2491494.
13.
E. D. Dolan and J. J. Moré, Benchmarking optimization software with performance profiles, Math. Program., 91 (2002), pp. 201--213, https://doi.org/10.1007/s101070100263.
14.
M. Fasi, Optimality of the Paterson--Stockmeyer method for evaluating matrix polynomials and rational matrix functions, Linear Algebra Appl., 574 (2019), pp. 182--200, https://doi.org/10.1016/j.laa.2019.04.001.
15.
M. Fasi and N. J. Higham, Multiprecision algorithms for computing the matrix logarithm, SIAM J. Matrix Anal. Appl., 39 (2018), pp. 472--491, https://doi.org/10.1137/17M1129866.
16.
M. Fasi and N. J. Higham, An arbitrary precision scaling and squaring algorithm for the matrix exponential, SIAM J. Matrix Anal. Appl., 40 (2019), pp. 1233--1256, https://doi.org/10.1137/18M1228876.
17.
G. H. Golub and C. F. Van Loan, Matrix Computations, 4th ed., Johns Hopkins University Press, Baltimore, MD, 2013.
18.
G. Hargreaves, Topics in Matrix Computations: Stability and Efficiency of Algorithms, Ph.D. thesis, University of Manchester, Manchester, UK, 2005.
19.
G. I. Hargreaves and N. J. Higham, Efficient algorithms for the matrix cosine and sine, Numer. Algorithms, 40 (2005), pp. 383--400, https://doi.org/10.1007/s11075-005-8141-0.
20.
N. J. Higham, The Matrix Computation Toolbox, \newblock http://www.maths.manchester.ac.uk/~higham/mctoolbox.
21.
N. J. Higham, Functions of Matrices: Theory and Computation, Society for Industrial and Applied Mathematics, Philadelphia, 2008, https://doi.org/10.1137/1.9780898717778.
22.
N. J. Higham and L. Lin, An improved Schur--Padé algorithm for fractional powers of a matrix and their Fréchet derivatives, SIAM J. Matrix Anal. Appl., 34 (2013), pp. 1341--1360, https://doi.org/10.1137/130906118.
23.
N. J. Higham and X. Liu, A multiprecision derivative-free Schur--Parlett algorithm for computing matrix functions, SIAM J. Matrix Anal. Appl., 42 (2021), pp. 1401--1422, https://doi.org/10.1137/20m1365326.
24.
N. J. Higham and M. Mikaitis, Anymatrix: An Extensible MATLAB Matrix Collection, https://github.com/mmikaitis/anymatrix.
25.
N. J. Higham and M. Mikaitis, Anymatrix: An extensible MATLAB matrix collection, Numer. Algorithms, (2021), https://doi.org/10.1007/s11075-021-01226-2.
26.
N. J. Higham and S. D. Relton, Estimating the condition number of the Fréchet derivative of a matrix function, SIAM J. Sci. Comput., 36 (2014), pp. C617--C634, https://doi.org/10.1137/130950082.
27.
N. J. Higham and M. I. Smith, Computing the matrix cosine, Numer. Algorithms, 34 (2003), pp. 13--26, https://doi.org/10.1023/A:1026152731904.
28.
N. J. Higham and F. Tisseur, A block algorithm for matrix $1$-norm estimation, with an application to 1-norm pseudospectra, SIAM J. Matrix Anal. Appl., 21 (2000), pp. 1185--1201, https://doi.org/10.1137/S0895479899356080.
29.
F. Johansson et al., mpmath: A Python Library for Arbitrary-Precision Floating-Point Arithmetic (version 0.18), \newblock http://mpmath.org/.
30.
A. Magnus and J. Wynn, On the padé table of $\cos z$, Proc. Amer. Math. Soc., 47 (1975), pp. 361--367, https://doi.org/10.2307/2039747.
31.
A. Meurer, C. P. Smith, M. Paprocki, et al., SymPy: Symbolic computing in Python, PeerJ Comput. Sci., 3 (2017), e103, https://doi.org/10.7717/peerj-cs.103.
32.
Multiprecision Computing Toolbox for MATLAB, Advanpix, Tokyo, http://www.advanpix.com.
33.
P. Nadukandi and N. J. Higham, Computing the wave-kernel matrix functions, SIAM J. Sci. Comput., 40 (2018), pp. A4060--A4082, https://doi.org/10.1137/18M1170352.
34.
M. S. Paterson and L. J. Stockmeyer, On the number of nonscalar multiplications necessary to evaluate polynomials, SIAM J. Comput., 2 (1973), pp. 60--66, https://doi.org/10.1137/0202007.
35.
J. Sastre, J. Ibánez, P. Alonso, J. Peinado, and E. Defez, Two algorithms for computing the matrix cosine function, Appl. Math. Comput., 312 (2017), pp. 66--77, https://doi.org/10.1016/j.amc.2017.05.019.
36.
J. Sastre, J. Ibánez, P. Alonso-Jordá, J. Peinado, and E. Defez, Fast Taylor polynomial evaluation for the computation of the matrix cosine, J. Comput. Appl. Math., 354 (2019), pp. 641--650, https://doi.org/10.1016/j.cam.2018.12.041.
37.
J. Sastre, J. Ibánez, P. Ruiz, and E. Defez, Efficient computation of the matrix cosine, Appl. Math. Comput., 219 (2013), pp. 7575--7585, https://doi.org/10.1016/j.amc.2013.01.043.
38.
S. M. Serbin, Rational approximations of trigonometric matrices with application to second-order systems of differential equations, Appl. Math. Comput., 5 (1979), pp. 75--92, https://doi.org/10.1016/0096-3003(79)90011-0.
39.
S. M. Serbin and S. A. Blalock, An algorithm for computing the matrix cosine, SIAM J. Sci. Statist. Comput., 1 (1980), pp. 198--204, https://doi.org/10.1137/0901013.
40.
M. Seydaoğlu, P. Bader, S. Blanes, and F. Casas, Computing the matrix sine and cosine simultaneously with a reduced number of products, Appl. Numer. Math., 163 (2021), pp. 96--107, https://doi.org/10.1016/j.apnum.2021.01.009.

Information & Authors

Information

Published In

cover image SIAM Journal on Matrix Analysis and Applications
SIAM Journal on Matrix Analysis and Applications
Pages: 233 - 256
ISSN (online): 1095-7162

History

Submitted: 17 August 2021
Accepted: 30 November 2021
Published online: 17 February 2022

Keywords

  1. multiprecision algorithm
  2. multiprecision arithmetic
  3. matrix cosine
  4. matrix exponential
  5. matrix function
  6. Fréchet derivative
  7. double angle formula
  8. Taylor approximation
  9. forward error analysis
  10. MATLAB

MSC codes

  1. 15A16
  2. 65F30
  3. 65F60

Authors

Affiliations

Funding Information

King Khalid University https://doi.org/10.13039/501100007446 : R.G.P.1/113/40
Royal Society https://doi.org/10.13039/501100000288
Engineering and Physical Sciences Research Council https://doi.org/10.13039/501100000266 : EP/P020720/1

Metrics & Citations

Metrics

Citations

If you have the appropriate software installed, you can download article citation data to the citation manager of your choice. Simply select your manager software from the list below and click Download.

Cited By

Media

Figures

Other

Tables

Share

Share

Copy the content Link

Share with email

Email a colleague

Share on social media

The SIAM Publications Library now uses SIAM Single Sign-On for individuals. If you do not have existing SIAM credentials, create your SIAM account https://my.siam.org.