Algorithms for Quadratic Matrix and Vector Equations