bridge/class-master/depend/pari/src/basemath/FpE.c
/* assume x reduced mod p, monic. Return one root, or NULL if irreducible */
assume x reduced mod p, monic. Return one root, or NULL if irreducible
assume x reduced mod p monic . Return one root or NULL if irreducible
static GEN
FqX_quad_root(GEN x, GEN T, GEN p)
{
  GEN b = gel(x,3), c = gel(x,2);
  GEN D = Fq_sub(Fq_sqr(b, T, p), Fq_mulu(c,4, T, p), T, p);
  GEN s = Fq_sqrt(D,T, p);
  if (!s) return NULL;
  return Fq_Fp_mul(Fq_sub(s, b, T, p), shifti(addiu(p, 1),-1),T, p);
}
static GEN FqX_quad_root ( GEN x , GEN T , GEN p ) { GEN b = gel ( x , 3 ) , c = gel ( x , 2 ) ; GEN D = Fq_sub ( Fq_sqr ( b , T , p ) , Fq_mulu ( c , 4 , T , p ) , T , p ) ; GEN s = Fq_sqrt ( D , T , p ) ; if ( ! s ) return NULL ; return Fq_Fp_mul ( Fq_sub ( s , b , T , p ) , shifti ( addiu ( p , 1 ) , -1 ) , T , p ) ; }
assume x reduced mod p, monic.
assume x reduced mod p monic .