Input:
 Initial vector 𝑥 0
begin
 Set 𝜆 1 ( 1 ) = 𝑥 𝑇 0 𝐴 𝑥 0 𝑥 𝑇 0 𝐵 𝑥 0
For   𝑗 = 0 , 1 , 2 ,
begin
  Solve linear system 𝐴 𝑧 𝑗 + 1 = 𝐵 𝑥 𝑗 for 𝑧 𝑗 + 1
  Set 𝜆 1 ( 𝑗 + 1 ) = 𝑧 𝑇 𝑗 + 1 𝐴 𝑧 𝑗 + 1 𝑧 𝑇 𝑗 + 1 𝐵 𝑧 𝑗 + 1
  Set 𝑥 𝑗 + 1 = 𝑧 𝑗 + 1 𝑧 𝑗 + 1
  Output:   𝑥 𝑗 , 𝜆 1 ( 𝑗 )
end
end
Algorithm 1