One of the most effective methods for solving the matrix equationAX+XB=Cis the Bartels-Stewart algorithm. Key to this technique is the orthogonal reduction ofAandBto triangular form using theQRalgorithm for eigenvalues. A new method is proposed which differs from the Bartels-Stewart algorithm in thatAis only reduced to Hessenberg form. The resulting algorithm is between 30 and 70 percent faster depending upon the dimensions of the matricesAandB. The stability of the new method is demonstrated through a roundoff error analysis and supported by numerical tests. Finally, it is shown how the techniques described can be applied and generalized to other matrix equation problems.