bridge/class-master/depend/pari/src/basemath/lfun.c
/* assume lmisc is an linit, s went through get_domain and s/bitprec belong
 * to domain */
assume lmisc is an linit, s went through get_domain and s/bitprec belong
to domain
assume lmisc is an linit s went through get_domain and s / bitprec belong to domain
static GEN
lfun_OK(GEN linit, GEN s, GEN sdom, long bitprec)
{
  GEN N, gas, S, FVga, res, ss = s;
  long prec = nbits2prec(bitprec);
  FVga = lfun_get_factgammavec(linit_get_tech(linit));
  S = lfunlambda_OK(linit, s, sdom, bitprec);
  if (typ(S)==t_SER)
  {
    long d = lg(S) - 2 + fracgammadegree(FVga);
    if (typ(s) == t_SER)
      ss = sertoser(s, d);
    else
      ss = deg1ser_shallow(gen_1, s, varn(S), d);
  }
  gas = gammafactproduct(FVga, ss, prec);
  N = ldata_get_conductor(linit_get_ldata(linit));
  res = gdiv(S, gmul(gpow(N, gdivgs(ss, 2), prec), gas));
  if (typ(s)!=t_SER && typ(res)==t_SER)
  {
    long v = valp(res);
    if (v > 0) return gen_0;
    if (v == 0) res = gel(res, 2);
    else
      setlg(res, minss(lg(res), 2-v));
  }
  return gprec_w(res, prec);
}
static GEN lfun_OK ( GEN linit , GEN s , GEN sdom , long bitprec ) { GEN N , gas , S , FVga , res , ss = s ; long prec = nbits2prec ( bitprec ) ; FVga = lfun_get_factgammavec ( linit_get_tech ( linit ) ) ; S = lfunlambda_OK ( linit , s , sdom , bitprec ) ; if ( typ ( S ) == t_SER ) { long d = lg ( S ) - 2 + fracgammadegree ( FVga ) ; if ( typ ( s ) == t_SER ) ss = sertoser ( s , d ) ; else ss = deg1ser_shallow ( gen_1 , s , varn ( S ) , d ) ; } gas = gammafactproduct ( FVga , ss , prec ) ; N = ldata_get_conductor ( linit_get_ldata ( linit ) ) ; res = gdiv ( S , gmul ( gpow ( N , gdivgs ( ss , 2 ) , prec ) , gas ) ) ; if ( typ ( s ) != t_SER && typ ( res ) == t_SER ) { long v = valp ( res ) ; if ( v > 0 ) return gen_0 ; if ( v == 0 ) res = gel ( res , 2 ) ; else setlg ( res , minss ( lg ( res ) , 2 - v ) ) ; } return gprec_w ( res , prec ) ; }
assume lmisc is an linit, s went through get_domain and s/bitprec belong
 to domain
assume lmisc is an linit s went through get_domain and s / bitprec belong to domain