Re: polred and variants
John Cremona <[email protected]> Tue, 17 Mar 2026 15:37:45 +0000
| Newsgroups | gmane.comp.mathematics.pari.user |
|---|---|
| Message-ID | <CAD0p0K4w=-0gcAWDtuimRJho4kaYTzAMvZgBPJzKyA8rGAMV2g@mail.gmail.com> |
On Tue, 17 Mar 2026 at 15:34, John Cremona <[email protected]> wrote: > > Thanks again for this, Karim. So (in the absolute case) the > canonical version is polredabs0() (*not) polredabs() which is > obsolete, while the non-canonical "best" version is polredbest(). > > Out of interest, what is an example of a polynomial for which the > polredabs and polredbest reductions are different? Ignore that question, I see that x^4 + 2*x^2 - 12*x + 10 is unchanged by polredbest but becomes x^4+9 with polredabs. John > > John > > On Sat, 24 Jan 2026 at 14:07, Karim Belabas <[email protected]>= wrote: > > > > * John Cremona [2026-01-22 22:19]: > > [...] > > > But it is still true that there is no documentation in this manual fo= r > > > 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 ??polred= abs, > > ??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 th= e > > > 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 mislea= ding. > > > > Now clarified in 'master'. :-) > > > > Thanks ! > > > > K.B. > > -- > > Pr. Karim Belabas, U. Bordeaux > > Institut de Math=C3=A9matiques de Bordeaux UMR 5251 - (+33) 05 40 00 29= 77 > > http://www.math.u-bordeaux.fr/~kbelabas/