Max Alekseyev on Sat, 29 Apr 2023 17:28:44 +0200


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

Re: gcdext() for polynomials


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_));
}

Regards,
Max



On Sat, Apr 29, 2023 at 10:48 AM Bill Allombert <Bill.Allombert@math.u-bordeaux.fr> wrote:
On Sat, Apr 29, 2023 at 09:43:53AM -0400, Max Alekseyev wrote:
> There seems to be no way to specify over what variable the gcdext()
> function should consider the given polynomials. In contrast, many pol*
> functions (like poldegree(), polcoef() etc) provide such an opton.
> Am I missing something?

You can only do it with respect to the main variable.
This is in line with the way euclidean division of polynomials work in PARI.

Cheers,
Bill