bridge/class-master/depend/pari/src/basemath/lfun.c
/* M should eventually converge to N, the conductor. L has a pole. */
M should eventually converge to N, the conductor. L has a pole.
M should eventually converge to N the conductor . L has a pole .
static GEN
wrap2(void *E, GEN M)
{
  struct huntcond_t *S = (struct huntcond_t*)E;
  GEN data = S->data, t1k, t2k, p1, p1inv, p2, p2inv;
  GEN thetainit, R;
  GEN t1 = mkfrac(stoi(11), stoi(10)), t2 = mkfrac(stoi(13), stoi(11));
  GEN t1be, t2be, t1bemk, t2bemk, t1kmbe, t2kmbe;
  GEN F11, F12, F21, F22, P1, P2, res;
  long k = S->k, prec, bitprec;
  thetainit = linit_get_tech(data);
  bitprec = theta_get_bitprec(thetainit);
  prec = nbits2prec(bitprec);
  *(S->pM) = M;
  *(S->psqrtM) = gsqrt(M, prec);
  p1 = lfuntheta(data, t1, 0, bitprec);
  p2 = lfuntheta(data, t2, 0, bitprec);
  p1inv = lfuntheta(data, ginv(t1), 0, bitprec);
  p2inv = lfuntheta(data, ginv(t2), 0, bitprec);
  t1k = gpowgs(t1, k);
  t2k = gpowgs(t2, k);
  R = theta_get_R(thetainit);
  if (typ(R) == t_VEC)
  {
    GEN be = gmael(R, 1, 1);
    t1be = gpow(t1, be, prec); t1bemk = gdiv(gsqr(t1be), t1k);
    t2be = gpow(t2, be, prec); t2bemk = gdiv(gsqr(t2be), t2k);
    t1kmbe = gdiv(t1k, t1be);
    t2kmbe = gdiv(t2k, t2be);
  }
  else
  { 
    t1be = t1k; t1bemk = t1k; t1kmbe = gen_1;
    t2be = t2k; t2bemk = t2k; t2kmbe = gen_1;
  }
  F11 = conj_i(gsub(gmul(gsqr(t1be), p1), p1inv));
  F12 = conj_i(gsub(gmul(gsqr(t2be), p2), p2inv));
  F21 = gsub(gmul(t1k, p1), gmul(t1bemk, p1inv));
  F22 = gsub(gmul(t2k, p2), gmul(t2bemk, p2inv));
  P1 = gsub(gmul(t1bemk, t1be), t1kmbe);
  P2 = gsub(gmul(t2bemk, t2be), t2kmbe);
  res = gdiv(gsub(gmul(P2,F21), gmul(P1,F22)),
             gsub(gmul(P2,F11), gmul(P1,F12)));
  return glog(gabs(res, prec), prec);
}
static GEN wrap2 ( void * E , GEN M ) { struct huntcond_t * S = ( struct huntcond_t * ) E ; GEN data = S -> data , t1k , t2k , p1 , p1inv , p2 , p2inv ; GEN thetainit , R ; GEN t1 = mkfrac ( stoi ( 11 ) , stoi ( 10 ) ) , t2 = mkfrac ( stoi ( 13 ) , stoi ( 11 ) ) ; GEN t1be , t2be , t1bemk , t2bemk , t1kmbe , t2kmbe ; GEN F11 , F12 , F21 , F22 , P1 , P2 , res ; long k = S -> k , prec , bitprec ; thetainit = linit_get_tech ( data ) ; bitprec = theta_get_bitprec ( thetainit ) ; prec = nbits2prec ( bitprec ) ; * ( S -> pM ) = M ; * ( S -> psqrtM ) = gsqrt ( M , prec ) ; p1 = lfuntheta ( data , t1 , 0 , bitprec ) ; p2 = lfuntheta ( data , t2 , 0 , bitprec ) ; p1inv = lfuntheta ( data , ginv ( t1 ) , 0 , bitprec ) ; p2inv = lfuntheta ( data , ginv ( t2 ) , 0 , bitprec ) ; t1k = gpowgs ( t1 , k ) ; t2k = gpowgs ( t2 , k ) ; R = theta_get_R ( thetainit ) ; if ( typ ( R ) == t_VEC ) { GEN be = gmael ( R , 1 , 1 ) ; t1be = gpow ( t1 , be , prec ) ; t1bemk = gdiv ( gsqr ( t1be ) , t1k ) ; t2be = gpow ( t2 , be , prec ) ; t2bemk = gdiv ( gsqr ( t2be ) , t2k ) ; t1kmbe = gdiv ( t1k , t1be ) ; t2kmbe = gdiv ( t2k , t2be ) ; } else { t1be = t1k ; t1bemk = t1k ; t1kmbe = gen_1 ; t2be = t2k ; t2bemk = t2k ; t2kmbe = gen_1 ; } F11 = conj_i ( gsub ( gmul ( gsqr ( t1be ) , p1 ) , p1inv ) ) ; F12 = conj_i ( gsub ( gmul ( gsqr ( t2be ) , p2 ) , p2inv ) ) ; F21 = gsub ( gmul ( t1k , p1 ) , gmul ( t1bemk , p1inv ) ) ; F22 = gsub ( gmul ( t2k , p2 ) , gmul ( t2bemk , p2inv ) ) ; P1 = gsub ( gmul ( t1bemk , t1be ) , t1kmbe ) ; P2 = gsub ( gmul ( t2bemk , t2be ) , t2kmbe ) ; res = gdiv ( gsub ( gmul ( P2 , F21 ) , gmul ( P1 , F22 ) ) , gsub ( gmul ( P2 , F11 ) , gmul ( P1 , F12 ) ) ) ; return glog ( gabs ( res , prec ) , prec ) ; }
M should eventually converge to N, the conductor.
M should eventually converge to N the conductor .
/* be = k */