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 authentification level.

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

Submitted by:  Martin Rubey <kratt6>
Submitted on:  Wed 29 Sep 2004 03:36:55 PM UTC  
 
Category: algebraSeverity: 3 - Normal
Item Group: code bugStatus: transferred
Privacy: PublicAssigned 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
http://page.axiom-developer.org/zope/mathaction/EXPR_GCD

Martin Rubey <kratt6>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follows 1 latest change.

Date Changed By Updated Field Previous Value => Replaced By
Mon 11 Jul 2005 08:56:17 PM UTCbillpage1StatusNone=>transferred

Back to the top


Powered by Savane 3.1-cleanup