Looking for fastest Legendre/Jacobi algorithm