bridge/class-master/depend/pari/src/basemath/base2.c
/* reduced resultant mod p^m (assumes x monic) */
reduced resultant mod p^m (assumes x monic)
reduced resultant mod p^m ( assumes x monic )
GEN
ZpX_reduced_resultant(GEN x, GEN y, GEN p, GEN pm)
{
  pari_sp av = avma;
  GEN z;
  if (lgefint(pm) == 3)
  {
    ulong q = pm[2];
    z = Zlx_sylvester_echelon(ZX_to_Flx(x,q), ZX_to_Flx(y,q),0,p[2],q);
    if (lg(z) > 1)
    {
      ulong c = ucoeff(z,1,1);
      if (c) { avma = av; return utoipos(c); }
    }
  }
  else
  {
    z = ZpX_sylvester_echelon(x,y,0,p,pm);
    if (lg(z) > 1)
    {
      GEN c = gcoeff(z,1,1);
      if (signe(c)) return gerepileuptoint(av, c);
    }
  }
  avma = av; return gen_0;
}
GEN ZpX_reduced_resultant ( GEN x , GEN y , GEN p , GEN pm ) { pari_sp av = avma ; GEN z ; if ( lgefint ( pm ) == 3 ) { ulong q = pm [ 2 ] ; z = Zlx_sylvester_echelon ( ZX_to_Flx ( x , q ) , ZX_to_Flx ( y , q ) , 0 , p [ 2 ] , q ) ; if ( lg ( z ) > 1 ) { ulong c = ucoeff ( z , 1 , 1 ) ; if ( c ) { avma = av ; return utoipos ( c ) ; } } } else { z = ZpX_sylvester_echelon ( x , y , 0 , p , pm ) ; if ( lg ( z ) > 1 ) { GEN c = gcoeff ( z , 1 , 1 ) ; if ( signe ( c ) ) return gerepileuptoint ( av , c ) ; } } avma = av ; return gen_0 ; }
reduced resultant mod p^m (assumes x monic)
reduced resultant mod p^m ( assumes x monic )