Karim Belabas on Sat, 24 Jan 2026 15:07:20 +0100


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

Re: polred and variants


* John Cremona [2026-01-22 22:19]:
[...]
> But it is still true that there is no documentation in this manual for
> any non-obsolete *polred* functions.

Indeed, here is the complete list of "polred" public functions
(from "grep polred parideclh.h") with comments

// OBSOLETE, don't use them in new programs
GEN     factoredpolred(GEN x, GEN fa);
GEN     factoredpolred2(GEN x, GEN fa);
GEN     polredord(GEN x);
GEN     polred(GEN x);
GEN     polred0(GEN x, long flag);
GEN     polred2(GEN x);
GEN     polredabs(GEN x);
GEN     polredabs2(GEN x);
GEN     polredabsall(GEN x, long flun);
GEN     smallpolred(GEN x);
GEN     smallpolred2(GEN x);
GEN     rnfpolred(GEN nf, GEN pol, long prec);

// Expensive but provide canonical representatives
GEN     polredabs0(GEN x, long flag);
GEN     rnfpolredabs(GEN nf, GEN pol, long flag);

// Fast, generally best. Possibly smaller discriminant (!)
GEN     polredbest(GEN x, long flag);
GEN     rnfpolredbest(GEN nf, GEN R, long flag);

The documentation for the 4 non-obsolete functions is found in ??polredabs,
??polredbest, ??rnfpolredabs, ??rnfpolredbest. Or gp user's manual.

> One suggested improvement to the gp documentation for nf_ORIG: it
> seems to me that the second thing returned by the nf_ORIG flag is
> Mod(a,P) and not a itself: in the code I have to use lift() to get the
> polynomial.

Indeed. The litteral wording was correct (nothing was said about the
type of 'a' and Mod(a,P) is 'a' if already a t_POLMOD mod P) but misleading.

Now clarified in 'master'. :-)

Thanks !

    K.B.
-- 
Pr. Karim Belabas, U. Bordeaux
Institut de Mathématiques de Bordeaux UMR 5251 - (+33) 05 40 00 29 77
http://www.math.u-bordeaux.fr/~kbelabas/