  Krylov subspace methods for approximating a matrix function $f(A)$ times a
vector $v$ are analyzed in this paper. For the Arnoldi approximation to
$e^{-\tau A}v$, two reliable a posteriori error estimates are derived from the
new bounds and generalized error expansion we establish. One of them is similar
to the residual norm of an approximate solution of the linear system, and the
other one is determined critically by the first term of the error expansion of
the Arnoldi approximation to $e^{-\tau A}v$ due to Saad. We prove that each of
the two estimates is reliable to measure the true error norm, and the second
one theoretically justifies an empirical claim by Saad. In the paper, by
introducing certain functions $\phi_k(z)$ defined recursively by the given
function $f(z)$ for certain nodes, we obtain the error expansion of the
Krylov-like approximation for $f(z)$ sufficiently smooth, which generalizes
Saad's result on the Arnoldi approximation to $e^{-\tau A}v$. Similarly, it is
shown that the first term of the generalized error expansion can be used as a
reliable a posteriori estimate for the Krylov-like approximation to some other
matrix functions times $v$. Numerical examples are reported to demonstrate the
effectiveness of the a posteriori error estimates for the Krylov-like
approximations to $e^{-\tau A}v$, $\cos(A)v$ and $\sin(A)v$.

Numerical Analysis