Karim Belabas on Tue, 26 Sep 2017 17:20:50 +0200


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

Re: variables


* Pascal Molin [2017-09-26 17:04]:
> The following behaviour is clearly not what I expected...
> Since it's a variable issue I prefer leaving to experts the decision
> whether it's a bug or a logical consequence of the axioms to be documented.
> 
> (16:50) gp > f=x*z-x^2*y;variables(polcoeff(f,1,x))
> %1 = [y, z]

Not a bug: this coefficient of x^1 is indeed (z^1)*y^0.

(17:19) gp > f=x*z-y*x^2;dbg_x(polcoeff(f,1,x))
[&=00007ffff1043bc0] POL(lg=3):1400000000000003 (+,varn=1):4000400000000000 00007ffff1043ba0 
  coef of degree 0 = [&=00007ffff1043ba0] POL(lg=4):1400000000000004 (+,varn=11):4002c00000000000 0000000000c9a800 00007ffff1043b88 
    coef of degree 0 = gen_0
    coef of degree 1 = [&=00007ffff1043b88] INT(lg=3):0200000000000003 (+,lgefint=3):4000000000000003 0000000000000001 


 If you want "simplest possible" objects, use 'simplify':

(17:16) gp > f=x*z-x^2*y;variables(polcoeff(simplify(f),1,x))
%4 = [z]

Cheers,

    K.B.
--
Karim Belabas, IMB (UMR 5251)  Tel: (+33) (0)5 40 00 26 17
Universite de Bordeaux         Fax: (+33) (0)5 40 00 21 23
351, cours de la Liberation    http://www.math.u-bordeaux.fr/~kbelabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]
`