1 | initial version |
You should provide the code of the build_polynomial
function.
What is the degree of the polynomials ?
My understanding is that your polynomials are symbolic expressions, not genuine polynomials, which would explain part of the slowness. But it is hard to advise something interesting without more details.
Also, in very high degree, one could imagine to answer your questions from the list of factors without having to build a polynomial by multipliying the factors. Having the factors is a rich information, that might be sad to lose by expanding the product.