Karim BELABAS on Thu, 7 Jan 1999 17:40:31 +0100 (MET) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: bug in nfsubfields() |
[Igor:] > another one of post-2.0.11 bugs: > > ? nfisincl(x^2-2,x^4-2*x^2+9) > [-1/6*x^3 + 5/6*x, 1/6*x^3 - 5/6*x] > ? nfsubfields(nfinit(x^4-2*x^2+9),2) > [] [or polredabs(x^4-2*x^2+9) --> x^4 + 1 which obviously has 3 quadratic subfields]. I simplified a (Hensel-type) bound, but forgot that the "power basis" we use may have an index (here 24), which should also be taken into account. Here's a patch. Karim. *** src/modules/subfield.c.orig Tue Dec 15 16:30:32 1998 --- src/modules/subfield.c Thu Jan 7 17:30:46 1999 *************** *** 507,516 **** static GEN embedding_of_potential_subfields(GEN nf,GEN g,GEN DATA,GEN rootsA,GEN delta) { ! GEN w0_inQ,w0,w1,h0,gp,p2,f,unmodp,p,ind; long av = avma, av1; f=(GEN)nf[1]; ind=(GEN)nf[4]; p=(GEN)DATA[2]; gp=deriv(g,varn(g)); unmodp=gmodulsg(1,p); av1 = avma; w0 = interpolation_polynomial(gmul(rootsA,unmodp), delta); --- 507,517 ---- static GEN embedding_of_potential_subfields(GEN nf,GEN g,GEN DATA,GEN rootsA,GEN delta) { ! GEN w0_inQ,w0,w1,h0,gp,p2,f,unmodp,p,ind, maxp; long av = avma, av1; f=(GEN)nf[1]; ind=(GEN)nf[4]; p=(GEN)DATA[2]; + maxp=mulii((GEN)DATA[13],ind); gp=deriv(g,varn(g)); unmodp=gmodulsg(1,p); av1 = avma; w0 = interpolation_polynomial(gmul(rootsA,unmodp), delta); *************** *** 544,550 **** fprintferr("Old Q-polynomial: "); outerr(w0_inQ); fprintferr("New Q-polynomial: "); outerr(p2); } ! if (cmpii(p, (GEN)DATA[13]) > 0) { if (DEBUGLEVEL) fprintferr("coeff too big for embedding\n"); avma=av; return gzero; --- 545,551 ---- fprintferr("Old Q-polynomial: "); outerr(w0_inQ); fprintferr("New Q-polynomial: "); outerr(p2); } ! if (cmpii(p, maxp) > 0) { if (DEBUGLEVEL) fprintferr("coeff too big for embedding\n"); avma=av; return gzero; -- Karim Belabas email: Karim.Belabas@math.u-psud.fr Dep. de Mathematiques, Bat. 425 Universite Paris-Sud Tel: (00 33) 1 69 15 57 48 F-91405 Orsay (France) Fax: (00 33) 1 69 15 60 19 -- PARI/GP Home Page: http://pari.home.ml.org