bridge/class-master/depend/pari/src/modules/krasner.c
/* eis (ZXY): Eisenstein polynomial over the field defined by T.
 * topx (ZX): absolute equation of root(T) + root(eis).
 * Return the struct FAD corresponding to the field it defines (GENs created
 * as clones). Assume e > 1. */
eis (ZXY): Eisenstein polynomial over the field defined by T.
eis ( ZXY ) : Eisenstein polynomial over the field defined by T .
static void
FieldData(KRASNER_t *data, FAD_t *fdata, GEN eis, GEN topx)
{
  GEN p1, p2, p3, z, ipi, cipi, dipi, t, Q;
  fdata->p = data->p;
  t = leafcopy(topx); setvarn(t, data->v);
  fdata->top  = t;
  fdata->topr = FpX_red(t, data->pr);
  if (data->f == 1) z = gen_0;
  else
  { 
    z = pol_x(data->v);
    p1 = FpX_deriv(data->T, data->p);
    for (;;) {
      p2 = FpX_FpXQ_eval(data->T, z, fdata->top, data->p);
      if (gcmp0(p2)) break;
      p3 = FpX_FpXQ_eval(p1, z, fdata->top, data->p);
      z  = FpX_sub(z, FpXQ_div(p2, p3, fdata->top, data->p), data->p);
    }
    z = ZpX_ZpXQ_liftroot(data->T, z, fdata->top, data->p, data->r);
  }
  fdata->z  = z;
  fdata->eis = eis;
  fdata->pi  = Fq_sub(pol_x(data->v), fdata->z,
                      FpX_red(fdata->top, data->p), data->p);
  ipi = RgXQ_inv(fdata->pi, fdata->top);
  ipi = Q_remove_denom(ipi, &dipi);
  Q = mulii(data->pr, data->p);
  cipi = Fp_inv(diviiexact(dipi, data->p), Q);
  fdata->ipi = FpX_Fp_mul(ipi, cipi, Q); 
  p2 = mulii(data->pr, data->p);
  p1 = FpXQ_powers(fdata->pi, data->e, fdata->topr, p2);
  gel(p1, data->e+1) = ZX_Z_divexact(gel(p1, data->e+1), data->p);
  fdata->pik  = p1;
}
static void FieldData ( KRASNER_t * data , FAD_t * fdata , GEN eis , GEN topx ) { GEN p1 , p2 , p3 , z , ipi , cipi , dipi , t , Q ; fdata -> p = data -> p ; t = leafcopy ( topx ) ; setvarn ( t , data -> v ) ; fdata -> top = t ; fdata -> topr = FpX_red ( t , data -> pr ) ; if ( data -> f == 1 ) z = gen_0 ; else { z = pol_x ( data -> v ) ; p1 = FpX_deriv ( data -> T , data -> p ) ; for ( ; ; ) { p2 = FpX_FpXQ_eval ( data -> T , z , fdata -> top , data -> p ) ; if ( gcmp0 ( p2 ) ) break ; p3 = FpX_FpXQ_eval ( p1 , z , fdata -> top , data -> p ) ; z = FpX_sub ( z , FpXQ_div ( p2 , p3 , fdata -> top , data -> p ) , data -> p ) ; } z = ZpX_ZpXQ_liftroot ( data -> T , z , fdata -> top , data -> p , data -> r ) ; } fdata -> z = z ; fdata -> eis = eis ; fdata -> pi = Fq_sub ( pol_x ( data -> v ) , fdata -> z , FpX_red ( fdata -> top , data -> p ) , data -> p ) ; ipi = RgXQ_inv ( fdata -> pi , fdata -> top ) ; ipi = Q_remove_denom ( ipi , & dipi ) ; Q = mulii ( data -> pr , data -> p ) ; cipi = Fp_inv ( diviiexact ( dipi , data -> p ) , Q ) ; fdata -> ipi = FpX_Fp_mul ( ipi , cipi , Q ) ; p2 = mulii ( data -> pr , data -> p ) ; p1 = FpXQ_powers ( fdata -> pi , data -> e , fdata -> topr , p2 ) ; gel ( p1 , data -> e + 1 ) = ZX_Z_divexact ( gel ( p1 , data -> e + 1 ) , data -> p ) ; fdata -> pik = p1 ; }
eis (ZXY): Eisenstein polynomial over the field defined by T.
 topx (ZX): absolute equation of root(T) + root(eis).
eis ( ZXY ) : Eisenstein polynomial over the field defined by T . topx ( ZX ) : absolute equation of root ( T ) + root ( eis ) .
/* Compute a root of T in K(top) using Hensel's lift */ /* First lift to a root mod p */ /* Then a root mod p^r */ /* p/pi mod p^(pr+1) */ /* Last one is set to pi^e/p (so we compute pi^e with one extra precision) */