Suppose I have two polynomials $f(x)$ and $g(x)$ and I somehow represent their coefficients. I have a couple of ways to hold a polynomial depending on how many significant coefficients the polynomial has. I want to determine the amount of significant coefficients in the results of $f(x) + g(x)$ ,$f(x) \cdot g(x)$ , $f(x) - g(x)$ etc. .
But I'd like to do it before I create the object that holds them, is there some efficient way of doing this without calculating the result twice?
I can assume that I know the current rank and number of elements in $f(x)$ and $g(x)$
If this is not possible knowing that the new polynomial's non-trivial coefficients will be at least half of the rank will suffice, but I'm unsure how to do it as well.
I did try to apply various heuristics but didn't come up with something consistent and fast.