Ticket #15767: ell.gp.patch

File ell.gp.patch, 1.5 KB (added by pbruin, 6 years ago)

Trac 15767: more exact Archimedean computations in ell.gp

  • ell.gp

    old new  
    840840}
    841841{nflocallysoluble( nf, pol, r=0,a=1,b=1) =
    842842\\ Test whether Y^2 = pol is Everywhere Locally Soluble
    843 local(pol0,plist,add,ff,p,Delta,vecpol,vecpolr,Sturmr);
     843local(pol0,plist,add,ff,p,Delta,c,s,t);
    844844
    845845if( DEBUGLEVEL_ell >= 4, print("    starting nflocallysoluble ",[pol,r,a,b]));
    846846  pol0 = pol;
     
    875875\\ places reelles
    876876
    877877  if( nf.r1,
    878     Delta = poldisc(pol); vecpol = Vec(pol);
     878    c = pollead(pol);
     879    pol /= c;
     880    pol = subst(pol, 'x, 'x - polcoeff(pol, 3)/4);
     881    s = polcoeff(pol, 2);
     882    t = 2*s^3 - 8*s*polcoeff(pol, 0) + 9*polcoeff(pol, 1)^2;
     883    Delta = poldisc(pol);
    879884    for( i = 1, nf.r1,
    880       if( nfrealsign(nf,pollead(pol),i) > 0, next);
    881       if( nfrealsign(nf,polcoeff(pol,0),i) > 0, next);
     885      if( nfrealsign(nf,c,i) > 0, next);
    882886      if( nfrealsign(nf,Delta,i) < 0, next);
    883       vecpolr = vector(#vecpol,j,mysubst(vecpol[j],nf.roots[i]));
    884       Sturmr = polsturm(Pol(vecpolr));
    885       if( Sturmr == 0,
     887      \\ Sturm => 4 roots if s < 0 and t < 0, otherwise 0 roots
     888      if( nfrealsign(nf,s,i) < 0 && nfrealsign(nf,t,i) < 0, next);
    886889if( DEBUGLEVEL_ell >= 2, print("  not ELS at infinity"));
    887890if( DEBUGLEVEL_ell >= 4, print("    end of nflocallysoluble"));
    888         return(0));
     891      return(0);
    889892  ));
    890893if( DEBUGLEVEL_ell >= 2, print("  quartic ELS "));
    891894if( DEBUGLEVEL_ell >= 4, print("    end of nflocallysoluble"));