CHANGED: optimization of the handling of negative numerators for the Jacobi symbol