[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] [Axiom-mail] A newby question about eval and Expressio
[Axiom-developer] [Axiom-mail] A newby question about eval and Expression
Sun, 13 Nov 2005 05:49:02 -0600
there are two issues in your code:
Doug Stewart writes:
> )clear all
> digits 20
> -- n:=x^3+a1*x^2+a2*x+a3 ::Polynomial Fraction Integer
note that x1 is *not* a polynomial. Not even a rational function.
> x2:=-(S+T)/2-a1/3 + %i*sqrt(3)*(S-T)/2
> x3:=-(S+T)/2-a1/3 - %i*sqrt(3)*(S-T)/2
> a5:=x^3+a1*x^2+a2*x+a3 ::Polynomial Fraction Integer;
> a6:=('x-x11) ::Polynomial Fraction Integer;
> a7:=monicDivide(a5,a6,x) ;
> a77:=a7.quotient ::Polynomial Fraction Integer;
> a78:=a7.remainder ::Polynomial Fraction Integer;
> qu1 :=eval(a77,x11,x1)
> this gives an error message:
> The form on the left hand side of an assignment must be a single
> variable ... supporting the setelt operation.
The notation "::" is a shorthand for "coerce". But then, this is bad
syntax. You can either say
However, since x1 is not a polynomial, both will fail.
The domain "Expression Integer" is the domain of all expressions you can form
with coefficients being integers. For example:
However, if you *can* avoid this domain (often you can't), try to do so, since
it has a major drawback:
A computer cannot test reliably whether some element of Expression Integer is
zero or not. Axiom tries, but often fails. For example, the first example above
is not zero for Axiom...
(MuPAD, Mathematica and Maple try harder, but they often fail, too)
Note that this problem does not arise for many other domains: you can test for
Fraction Polynomial PrimeField 1783
and so on.
Axiom-mail mailing list
forwarded from http://page.axiom-developer.org/zope/mathaction/address@hidden
[Axiom-developer] [Axiom-mail] [Axiom-mail] [Axiom-mail] A newby question about eval and Expression, root, 2005/11/12