Dear friends,
Please, I would like to ask a question that it is not exactly about fortran but about algorithms, hoping you can still offer to me some advice on the subject.
Let’s say that I have a two polynomials multiplication, for example:
p = x^12 + x^7 + x^5
q = x^18 + x^13 + x^4
p.q = x^30 + 2x^25 + x^23 + x^20 + x^18 + x^16 + x^11 + x^9
and I want to discard those monomials larger than x^23.
This is easy, I just have to do (p.q) mod x^25.
But now I need discard those monomials larger than x^23
and, at the same time, those smaller than x^16.
Are you aware of an efficient procedure to accomplish that?
As always, many thanks for your help.