bridge/class-master/depend/pari/src/basemath/base2.c
/* product of (monic) irreducible factors of f over Fp[X]
 * Assume f reduced mod p, otherwise valuation at x may be wrong */
product of (monic) irreducible factors of f over Fp[X]
Assume f reduced mod p, otherwise valuation at x may be wrong
product of ( monic ) irreducible factors of f over Fp [ X ] Assume f reduced mod p otherwise valuation at x may be wrong
static GEN
Flx_radical(GEN f, ulong p)
{
  long v0 = Flx_valrem(f, &f);
  ulong du, d, e;
  GEN u;
  d = Flx_checkdeflate(f);
  if (!d) return v0? polx_Flx(f[1]): pol1_Flx(f[1]);
  if (u_lvalrem(d,p, &e)) f = Flx_deflate(f, d/e); 
  u = Flx_gcd(f, Flx_deriv(f, p), p); 
  du = degpol(u);
  if (du)
  {
    if (du == (ulong)degpol(f))
      f = Flx_radical(Flx_deflate(f,p), p);
    else
    {
      u = Flx_normalize(u, p);
      f = Flx_div(f, u, p);
      if (p <= du)
      {
        GEN w = Flxq_powu(f, du, u, p);
        w = Flx_div(u, Flx_gcd(w,u,p), p); 
        f = Flx_mul(f, Flx_radical(Flx_deflate(w,p), p), p);
      }
    }
  }
  if (v0) f = Flx_shift(f, 1);
  return f;
}
static GEN Flx_radical ( GEN f , ulong p ) { long v0 = Flx_valrem ( f , & f ) ; ulong du , d , e ; GEN u ; d = Flx_checkdeflate ( f ) ; if ( ! d ) return v0 ? polx_Flx ( f [ 1 ] ) : pol1_Flx ( f [ 1 ] ) ; if ( u_lvalrem ( d , p , & e ) ) f = Flx_deflate ( f , d / e ) ; u = Flx_gcd ( f , Flx_deriv ( f , p ) , p ) ; du = degpol ( u ) ; if ( du ) { if ( du == ( ulong ) degpol ( f ) ) f = Flx_radical ( Flx_deflate ( f , p ) , p ) ; else { u = Flx_normalize ( u , p ) ; f = Flx_div ( f , u , p ) ; if ( p <= du ) { GEN w = Flxq_powu ( f , du , u , p ) ; w = Flx_div ( u , Flx_gcd ( w , u , p ) , p ) ; f = Flx_mul ( f , Flx_radical ( Flx_deflate ( w , p ) , p ) , p ) ; } } } if ( v0 ) f = Flx_shift ( f , 1 ) ; return f ; }
product of (monic) irreducible factors of f over Fp[X]
 Assume f reduced mod p, otherwise valuation at x may be wrong
product of ( monic ) irreducible factors of f over Fp [ X ] Assume f reduced mod p otherwise valuation at x may be wrong
/* f(x^p^i) -> f(x) */ /* (f,f') */ /* u / gcd(u, v^(deg u-1)) */