Dan Gordon on Mon, 17 Apr 2000 14:47:12 -0700 (PDT)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

padic multiplication bug


I've run into an odd bug multiplying p-adic polynomials in newer
versions of GP.  Let

 f = (1 + O(2^20))*y^9 + (2^14 + O(2^34))*y^7 + (2^54 + O(2^74))
 g = (1 + O(2^20))*y^12 + (2^92 + O(2^102))

The correct answer is:

f*g = (1 + O(2^20))*y^21 + (2^14  + O(2^34))*y^19 + 
      (2^54 + O(2^74))*y^12 + 
      (2^92 + O(2^102))*y^9 + (2^106  + O(2^116))*y^7 + (2^146  + O(2^156))

In 2.0.19 (and versions at least as far back as 2.0.16), I get:

f*g = (1 + O(2^20))*y^21 + (2^14 + O(2^34))*y^19 +
    O(2^20)*y^14 + O(2^34)*y^12 + 
     (2^92 + O(2^102))*y^9 + (2^106 + O(2^116))*y^7 + (2^146 + O(2^156))

with wrong coefficients of y^14 and y^12.  Can anyone tell me what's
going on?

By the way, I ran into this while implementing a new p-adic factoring
routine.  In version 2.0.10 and before, it was easy to find p-adic
polynomials which factorpadic couldn't handle, such as 

	    (x-4)^2 * (x^2-2) + 2^100.

With later versions, factorpadic easily handles this and other examples
we had.  Is there any documentation about what improvements have
been made to factorpadic?

     Dan Gordon