  The extended Davis-Kahan theorem makes use of polynomial matrix
transformations to produce bounds at least as tight as the standard Davis-Kahan
theorem. The optimization problem of finding transformation parameters
resulting in optimal bounds from the extended Davis-Kahan theorem is presented
for affine transformations. It is demonstrated how globally optimal bound
values can be computed automatically using fractional programming theory. Two
different solution approaches, the Charnes-Cooper transformation and
Dinkelbach's algorithm are reviewed. Our implementation of the extended
Davis--Kahan theorem is used to calculate bound values in three significant
examples. First, a pairwise comparison is made of the spaces spanned by the
eigenvectors of the graph shift operator matrices corresponding to different
stochastic block model graphs. Second our bound is calculated on the distance
of the spaces spanned by eigenvectors of the graph shift operators and their
corresponding generating matrices in the stochastic blockmodel, and, third, on
the sample and population covariance matrices in a spiked covariance model. Our
extended bound values, using affine transformations, not only outperform the
standard Davis-Kahan bounds in all examples where both theorems apply, but also
demonstrate good performance in several cases where the standard Davis-Kahan
theorem cannot be used.
