We present a variation of Paige's algorithm for computing the generalized singular value decomposition (GSVD) of two matrices A and B. There are two innovations. The first is a new preprocessing step which reduces A and B to upper triangular forms satisfying certain rank conditions. The second is a new 2 by 2 triangular GSVD algorithm, which constitutes the inner loop of Paige's algorithm. We present proofs of stability and high accuracy of the 2 by 2 GSVD algorithm, and demonstrate it using examples on which all previous algorithms fail.
Keywords: generalized singular value decomposition, CS decomposition, matrix decomposition, Jacobi algorithm, Kogbetliantz algorithm