Add one more big-a optimization to legendre_phi