Open codeblooded1729 opened 1 year ago
Thanks for catching this @codeblooded1729 ! For division by linear polynomials, I think the recommended way is to declare the divisor as a SparsePolynomial
. However, I agree that the naive behaviour should not be so slow. Do you want to submit a PR that checks if the divisor is sparse (for some heuristic criteria of sparsity) and calls the sparse division routine?
There is an O(l * (k - l + 1))
algorithm in Shoup's book, where l is the degree of divisor and k is the degree of dividend. Should I implement that instead?
Sorry for the delay on this, but if you're still interested, please go ahead and implement that
Ping @codeblooded1729, are you still interested in implementing this?
I have found that when dividing by a polynomial divisible by a large power of x, by a linear polynomial, it takes too much time. The algorithm is thus, no longer linear in the degree of polynomial
The issue needs to be fixed, or maybe we can have a special method for division by linear poly