axiom-developer
[Top][All Lists]

## [Axiom-developer] [#191 exquo and therefore gcd cannot handle UP(x, EXPR

 From: billpage Subject: [Axiom-developer] [#191 exquo and therefore gcd cannot handle UP(x, EXPR INT)] Date: Mon, 11 Jul 2005 16:19:13 -0500

Changes
http://page.axiom-developer.org/zope/mathaction/191ExquoAndThereforeGcdCannotHandleUPXEXPRINT/diff
--

--removed:
-
-

??changed:
-
-    _______________________________________________________
-
-
-  <http://savannah.nongnu.org/bugs/?func=detailitem&item_id=10530>
-
-_______________________________________________
-  Message sent via/by Savannah
-  http://savannah.nongnu.org/
-
\begin{axiom}
gcd((x-2^a)::UP(x, EXPR INT), simplify((x-2^a)*(x+2^a))::UP(x, EXPR INT))
\end{axiom}

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

\begin{axiom}
gcd((x-2^a)::UP(x, EXPR INT),((x-2^a)*(x+2^a))::UP(x, EXPR INT))
\end{axiom}

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 [EXPR_GCD]

Internal Cause

In EXPR INT, $2^a$ and $2^(2a)$ are treated as two variables
without relations in EXPR INT. Therefore exquo in::

gcdPrimitive(p1:SUPP,p2:SUPP)$PGCD fails. Thu 09/30/2004 at 09:31, comment !#3 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^(2a)\$, 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 09/29/2004 at 16:20, 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 09/29/2004 at 16:02, comment !#1:

\begin{axiom}
exquo(normalize(simplify(((A-2^a)*(A+2^a)))::EXPR INT),normalize((A-2^a)::EXPR
INT))
exquo(simplify((A-2^a)*(A+2^a))::UP(A,EXPR INT),(A-2^a)::UP(A,EXPR INT))
\end{axiom}

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.

--