The cosines of the principal angles between the column spaces of full colum
n rank matrices X is an element of R-mxp and Y is an element of R-mxq are e
fficiently computed, using the Bjorck-Golub algorithm, as the singular valu
es of Q(x)(T) Q(y), where Q(x) and Q(y) are orthonormal matrices computed b
y the QR factorizations of X and Y, respectively. This paper shows that the
Bjorck-Golub algorithm is mixed stable in the following sense: the compute
d singular values approximate with small relative error the exact cosines o
f the principal angles between the column spaces of X + Delta X and Y + Del
ta Y, where Delta X, Delta Y are small backward errors. Further, theoretica
l analysis and numerical evidence show that the algorithm becomes more robu
st if the QR factorizations are computed with the complete pivoting scheme
of Powell and Reid. Moreover, it is shown that Gaussian elimination with co
mplete pivoting can be used as an efficient preconditioner in computation a
nd as a useful tool in analysis of the sensitivity of the QR factorization.