I guess the old code is faster for ```n <= 3```?
If so, maybe just hardcode the polynomials for ```n = 1, 2, 3```.