Speed up special cases of square-free factorization.