bridge/class-master/depend/pari/src/basemath/mftrace.c
/* CHI mfchar */
/* Warning: M is a multiple of the conductor of CHI, but is NOT
   necessarily its modulus */
CHI mfchar
Warning: M is a multiple of the conductor of CHI, but is NOT
necessarily its modulus
CHI mfchar Warning : M is a multiple of the conductor of CHI but is NOT necessarily its modulus
static GEN
mfskcx(long k, GEN CHI, long M, long prec)
{
  GEN S, CHIvec, P;
  long F, m, i, l;
  CHI = mfchartoprimitive(CHI, &F);
  CHIvec = mfcharcxinit(CHI, prec);
  if (F == 1) S = gdivgs(bernfrac(k), k);
  else
  {
    GEN Q = mfqk(k, F), V = CHIvec_val(CHIvec);
    S = gmul(gel(V, F), RgX_coeff(Q, 0));
    for (m = 1; m < F; m++) S = gadd(S, gmul(gel(V, m), RgX_coeff(Q, m)));
    S = conj_i(S);
  }
  P = gel(myfactoru(u_ppo(M/F,F)), 1); l = lg(P);
  for (i = 1; i < l; i++)
  {
    long p = P[i];
    S = gmul(S, gsubsg(1, gdiv(mychareval(CHIvec, p), powuu(p, k))));
  }
  return gmul(gmul(gausssumcx(CHIvec, prec), S), powuu(M/F, k));
}
static GEN mfskcx ( long k , GEN CHI , long M , long prec ) { GEN S , CHIvec , P ; long F , m , i , l ; CHI = mfchartoprimitive ( CHI , & F ) ; CHIvec = mfcharcxinit ( CHI , prec ) ; if ( F == 1 ) S = gdivgs ( bernfrac ( k ) , k ) ; else { GEN Q = mfqk ( k , F ) , V = CHIvec_val ( CHIvec ) ; S = gmul ( gel ( V , F ) , RgX_coeff ( Q , 0 ) ) ; for ( m = 1 ; m < F ; m ++ ) S = gadd ( S , gmul ( gel ( V , m ) , RgX_coeff ( Q , m ) ) ) ; S = conj_i ( S ) ; } P = gel ( myfactoru ( u_ppo ( M / F , F ) ) , 1 ) ; l = lg ( P ) ; for ( i = 1 ; i < l ; i ++ ) { long p = P [ i ] ; S = gmul ( S , gsubsg ( 1 , gdiv ( mychareval ( CHIvec , p ) , powuu ( p , k ) ) ) ) ; } return gmul ( gmul ( gausssumcx ( CHIvec , prec ) , S ) , powuu ( M / F , k ) ) ; }
CHI mfchar
Warning: M is a multiple of the conductor of CHI, but is NOT
necessarily its modulus
CHI mfchar Warning : M is a multiple of the conductor of CHI but is NOT necessarily its modulus
/* prime divisors of M not dividing f(chi) */