Paul Pollack, Peter Schorn: Dirichlet's proof of the three-square theorem: An algorithmic perspective. Math. Comput. 88(316): 1007-1019 (2019)