oh cool, this is related to synthetic division (the best kind of polynomial division). but i discovered this algorithm myself