Bill Allombert on Mon, 24 Sep 2012 16:23:40 +0200


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

Re: How to overcome limitations on variable names in PARI-GP


On Mon, Sep 24, 2012 at 03:18:43PM +0200, Ewan Delanoy wrote:
> Hello all,
> 
>  ?
>  ? trial1=polinv(proposer,modulus,x)
>  %4 = (282*a^3 + 280*a)*x + (-1407*a^4 - 1765*a^2 - 300)
>  ?
>  ? /*the result above is correct. Now see what happens when we replace x with a : */
>  ?
>  ? proposer=(-282*a^3 - 280*a)*b + (285*a^4 - 85*a^2 - 300)
>  %5 = 285*a^4 - 282*b*a^3 - 85*a^2 - 280*b*a - 300

Hello Ewan,

You did not replace x by a, but by b. What happen is that x has a higher priority than a,
but b has a lower priority than a. So instead of working in K(a)[x] you are now in K(b)[a].
So the notion of degree and Euclidean divisions etc. are different. Fundamentally PARI
only know about univariate polynomials over fields.

If you add b; on the first line of your program, it should work, by forcing b
to have an higher priority than x.

The documentation of variable priorities is available by entering in GP:
??"Variable priorities, multivariate objects"@2

Cheers,
Bill.