Bill Allombert on Wed, 03 May 2023 00:07:52 +0200


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

Re: gcdext() for polynomials


On Sat, Apr 29, 2023 at 11:26:53AM -0400, Max Alekseyev wrote:
> I understand, but it should not be a trouble to add an optional parameter
> v, and handle it via renaming - like this:
> 
{
mygcdext(f,g,v) = my(x,f_,g_,temp='temp);
x = variable(f);
if( v==x, return( gcdext(f,g) ) );
f_= subst(subst(f, x, temp), v, x );
g_= subst(subst(g, x, temp), v, x);
apply(t->subst(subst(t, x, v), temp, x), gcdext(f_,g_));
}

The number of bugs added to PARI when trying to work around variable priority
is staggering.

Exercise: find a bug in your code :)

Cheers,
Bill