bridge/class-master/depend/pari/src/basemath/elliptic.c
/* p > 3. Don't assume that e is minimal or even integral at p */
p > 3. Don't assume that e is minimal or even integral at p
p > 3 . Don ' t assume that e is minimal or even integral at p
static long
ellrootno_p(GEN e, GEN p)
{
  long nuj, nuD, nu;
  GEN D = ell_get_disc(e);
  long ep, z;
  nuD = Q_pval(D, p);
  if (!nuD) return 1;
  nuj = j_pval(e, p);
  nu = (nuD - nuj) % 12;
  if (nu == 0)
  {
    GEN c6;
    long d, vg;
    if (!nuj) return 1; 
    c6 = ell_get_c6(e); 
    vg = minss(2*Q_pval(c6, p), nuD);
    d = vg / 12;
    if (d)
    {
      GEN q = powiu(p,6*d);
      c6 = (typ(c6) == t_INT)? diviiexact(c6, q): gdiv(c6, q);
    }
    if (typ(c6) != t_INT) c6 = Rg_to_Fp(c6,p);
    return -kronecker(negi(c6), p);
  }
  if (nuj) return krosi(-1,p);
  ep = 12 / ugcd(12, nu);
  if (ep==4) z = 2; else z = (ep&1) ? 3 : 1;
  return krosi(-z, p);
}
static long ellrootno_p ( GEN e , GEN p ) { long nuj , nuD , nu ; GEN D = ell_get_disc ( e ) ; long ep , z ; nuD = Q_pval ( D , p ) ; if ( ! nuD ) return 1 ; nuj = j_pval ( e , p ) ; nu = ( nuD - nuj ) % 12 ; if ( nu == 0 ) { GEN c6 ; long d , vg ; if ( ! nuj ) return 1 ; c6 = ell_get_c6 ( e ) ; vg = minss ( 2 * Q_pval ( c6 , p ) , nuD ) ; d = vg / 12 ; if ( d ) { GEN q = powiu ( p , 6 * d ) ; c6 = ( typ ( c6 ) == t_INT ) ? diviiexact ( c6 , q ) : gdiv ( c6 , q ) ; } if ( typ ( c6 ) != t_INT ) c6 = Rg_to_Fp ( c6 , p ) ; return - kronecker ( negi ( c6 ) , p ) ; } if ( nuj ) return krosi ( -1 , p ) ; ep = 12 / ugcd ( 12 , nu ) ; if ( ep == 4 ) z = 2 ; else z = ( ep & 1 ) ? 3 : 1 ; return krosi ( - z , p ) ; }
p > 3.
p > 3 .
/* good reduction */ /* p || N */ /* != 0 */ /* c6 in minimal model */