# Calculating a function of a matrix with a real spectrum

Let T be a square matrix with a real spectrum, and let f be an analytic function. The problem of the approximate calculation of f(T) is discussed. Applying the Schur triangular decomposition and the reordering, one can assume that T is triangular and its diagonal entries t_ii are arranged in increasing order. To avoid calculations using the differences t_ii-t_jj with close (including equal) t_ii and t_jj, it is proposed to represent T in a block form and calculate the two main block diagonals using interpolating polynomials. The rest of the f(T) entries can be calculated using the Parlett recurrence algorithm. It is also proposed to perform scalar operations (such as the building of interpolating polynomials) with an enlarged number of decimal digits.

READ FULL TEXT