  For matrix $A$, vector $\boldsymbol{b}$ and function $f$, the computation of
vector $f(A)\boldsymbol{b}$ arises in many scientific computing applications.
We consider the problem of obtaining quantum state $\lvert f \rangle$
corresponding to vector $f(A)\boldsymbol{b}$. There is a quantum algorithm to
compute state $\lvert f \rangle$ using eigenvalue estimation that uses phase
estimation and Hamiltonian simulation $\mathrm{e}^{\mathrm{{\bf i}} A t}$.
However, the algorithm based on eigenvalue estimation needs
$\textrm{poly}(1/\epsilon)$ runtime, where $\epsilon$ is the desired accuracy
of the output state. Moreover, if matrix $A$ is not Hermitian,
$\mathrm{e}^{\mathrm{{\bf i}} A t}$ is not unitary and we cannot run eigenvalue
estimation. In this paper, we propose a quantum algorithm that uses Cauchy's
integral formula and the trapezoidal rule as an approach that avoids eigenvalue
estimation. We show that the runtime of the algorithm is
$\mathrm{poly}(\log(1/\epsilon))$ and the algorithm outputs state $\lvert f
\rangle$ even if $A$ is not Hermitian.
