bugAxiom Computer Algebra System - Bugs: bug #10530, exquo and therefore gcd cannot...


You are not allowed to post comments on this tracker with your current authentication level.

bug #10530: exquo and therefore gcd cannot handle UP(x, EXPR INT)

Submitter:  Martin Rubey <kratt6>
Submitted:  Wed 29 Sep 2004 03:36:55 PM UTC
Category:  algebra Severity:  3 - Normal
Item Group:  code bug Status:  transferred
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  Reproducibility:  None
Fixed Release: 
Error message: 

Example of code trigerring the bug: 

gcd((A-2^a)::UP(A, EXPR INT),(A^2-2^(2*a))::UP(A, EXPR INT))

Internal cause: 

In EXPR INT, 2^a and 2^(2*a) are treated as two variables without relations in EXPR INT. Therefore exquo in       gcdPrimitive(p1:SUPP,p2:SUPP)$PGCD fails.

Thu 30 Sep 2004 09:31:59 AM UTC, comment #3: 

>> Sorry, this is not correct. It is in FIELD (for EXPR INT)

Excuse me, I was to quick again. Here is the (hopefully correct) anaylysis:

exquo(simplify((A-2^a)*(A+2^a))::UP(A,EXPR INT),(A-2^a)::UP(A,EXPR INT))

calls exquo$SUP(EXPR INT). This implements exact division of polynomials p1 by p2 as usual. After each subtraction - done via fmecg$SUP - the result is again stored in p1. exquo terminates when p1 is the empty list - note that SUPs are stored as lists of pairs (degree, coefficient) - or the degree of p2 is larger than p1. In the latter case, exquo fails.

Thus, in our case, at one point p1 is 4^a-2^(2*a), which is zero mathematically, but axiom does not know it. In particular, p1 is not the empty list, but rather a constant polynomial...

It would be interesting to see how MuPAD or Aldor handle this.

Martin Rubey <kratt6>
Wed 29 Sep 2004 04:20:16 PM UTC, comment #2: 

>> The instance of exquo involved is the one in SMP.

Sorry, this is not correct. It is in FIELD (for EXPR INT)

Martin Rubey <kratt6>
Wed 29 Sep 2004 04:02:03 PM UTC, comment #1: 

I should have added:

(1) -> exquo(normalize(simplify(((A-2^a)*(A+2^a)))::EXPR INT),normalize((A-2^a)::EXPR INT))

          a log(4)    2
        %e         - A
   (1)  ---------------
           a log(2)
         %e         - A
                                          Type: Union(Expression Integer,...)

(2) -> exquo(simplify((A-2^a)*(A+2^a))::UP(A,EXPR INT),(A-2^a)::UP(A,EXPR INT))

   (2)  "failed"
                                                    Type: Union("failed",...)

I'm afraid that this cannot be fixed easily, since there is no general mechanism to determine whether an expression is zero or not, which is needed in exquo. The instance of exquo involved is the one in SMP.

Martin Rubey <kratt6>
Wed 29 Sep 2004 03:36:55 PM UTC, original submission:  

gcd((x-2^a)::UP(x, EXPR INT), simplify((x-2^a)*(x+2^a))::UP(x, EXPR INT))

gives 1, while the correct answer should be x-2^a, as given by

gcd((x-2^a)::UP(x, EXPR INT),((x-2^a)*(x+2^a))::UP(x, EXPR INT))

A workaround is presented on

Martin Rubey <kratt6>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


Follows 1 latest change.

Date Changed by Updated Field Previous Value => Replaced by
2005-07-11 billpage1 StatusNone transferred

Back to the top

Powered by Savane 3.12.
Corresponding source code