this is code from gp-pari, free software I was able to download to my home computer. There is a rather compact depiction of this way of writing things at the question Finding $P$ such that $P^TAP$ is a diagonal matrix From what I can see, the only "advantage" of this is a rather cookbook description, and the fact there is no need to ever explicitly invert a matrix. I am interested, though, never seen this "matrix reduction" way of writing the thing. Probably in some books from 100 years ago or so, time of Hermite and Minkowski.
This may help, the example of a two by two symmetric matrix, the easy case where both diagonal entries are nonzero:
$$
A =
\left(
\begin{array}{cc}
C & T \\
T & W
\end{array}
\right)
$$
where we want to change $T$ to zero. We take an elementary matrix, upper triangular in the easy cases,
$$
E =
\left(
\begin{array}{cc}
1 & \lambda \\
0 & 1
\end{array}
\right),
$$
where we are going to choose $\lambda$ so that $E^T A E$ is diagonal. Well,
$$
\color{red}{\left(
\begin{array}{cc}
1 & 0 \\
\lambda & 1
\end{array}
\right)
\left(
\begin{array}{cc}
C & T \\
T & W
\end{array}
\right)
\left(
\begin{array}{cc}
1 & \lambda \\
0 & 1
\end{array}
\right)=
\left(
\begin{array}{cc}
C & T + C \lambda \\
T + C \lambda & W + 2 T \lambda + C \lambda^2
\end{array}
\right).}
$$
We want $T + C \lambda = 0,$ so we choose $ \lambda = -T /C.$ If the matrix is actually 3 by 3, sometimes the number $\lambda$ is in position 12, or position 13, or position 23. When there are premature zeroes on the diagonal, sometimes $\lambda$ needs to be below the diagonal; not for this problem, though.
parisize = 4000000, primelimit = 500509
? a = [ 2, -1/2, -1/2; -1/2, 3, -1/2; -1/2, -1/2, 5]
%1 =
[2 -1/2 -1/2]
[-1/2 3 -1/2]
[-1/2 -1/2 5]
? e1 = [ 1, 1/4 , 0; 0,1,0; 0,0,1]
%2 =
[1 1/4 0]
[0 1 0]
[0 0 1]
? a1 = mattranspose(e1) * a * e1
%3 =
[2 0 -1/2]
[0 23/8 -5/8]
[-1/2 -5/8 5]
? p1 = e1
%4 =
[1 1/4 0]
[0 1 0]
[0 0 1]
? =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
? e2 = [ 1, 0 , 1/4; 0,1,0; 0,0,1]
%5 =
[1 0 1/4]
[0 1 0]
[0 0 1]
? a2 = mattranspose(e2) * a1 * e2
%6 =
[2 0 0]
[0 23/8 -5/8]
[0 -5/8 39/8]
? p2 = e1 * e2
%8 =
[1 1/4 1/4]
[0 1 0]
[0 0 1]
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
? e3 = [ 1, 0 , 0; 0,1,5/23; 0,0,1]
%9 =
[1 0 0]
[0 1 5/23]
[0 0 1]
? a3 = mattranspose(e3) * a2 * e3
%10 =
[2 0 0]
[0 23/8 0]
[0 0 109/23]
? p3 = p2 * e3
%11 =
[1 1/4 7/23]
[0 1 5/23]
[0 0 1]
? =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
? p = p3
%12 =
[1 1/4 7/23]
[0 1 5/23]
[0 0 1]
? a
%13 =
[2 -1/2 -1/2]
[-1/2 3 -1/2]
[-1/2 -1/2 5]
? d = mattranspose(p) * a * p
%14 =
[2 0 0]
[0 23/8 0]
[0 0 109/23]
?
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=