bridge/class-master/depend/pari/src/basemath/mellininv.c
/* if (abs), absolute error rather than relative */
if (abs), absolute error rather than relative
if ( abs ) absolute error rather than relative
static void
Kderivlarge_optim(GEN K, long abs, GEN t2d,GEN gcd, long *pbitprec, long *pnlim)
{
  GEN Vga = GMi_get_Vga(K), VL = GMi_get_VL(K), A2 = gel(VL,3);
  long bitprec = *pbitprec, d = lg(Vga)-1;
  const double D = get_D(d), td = dblmodulus(t2d), cd = gtodouble(gcd);
  double a, rtd, E = M_LN2*bitprec;
  rtd = (typ(t2d) == t_COMPLEX)? gtodouble(gel(t2d,1)): td;
  a = d*gtodouble(A2)*log2(td)/2 - (M_PI/M_LN2)*d*rtd + log2(cd); 
  bitprec += 64;
  if (abs)
  {
    bitprec += ceil(a);
    if (a <= -65) E = M_LN2*bitprec; 
  }
  *pbitprec = bitprec;
  *pnlim = ceil(E*E * log2(1+M_PI*td) / (D*td));
}
static void Kderivlarge_optim ( GEN K , long abs , GEN t2d , GEN gcd , long * pbitprec , long * pnlim ) { GEN Vga = GMi_get_Vga ( K ) , VL = GMi_get_VL ( K ) , A2 = gel ( VL , 3 ) ; long bitprec = * pbitprec , d = lg ( Vga ) - 1 ; const double D = get_D ( d ) , td = dblmodulus ( t2d ) , cd = gtodouble ( gcd ) ; double a , rtd , E = M_LN2 * bitprec ; rtd = ( typ ( t2d ) == t_COMPLEX ) ? gtodouble ( gel ( t2d , 1 ) ) : td ; a = d * gtodouble ( A2 ) * log2 ( td ) / 2 - ( M_PI / M_LN2 ) * d * rtd + log2 ( cd ) ; bitprec += 64 ; if ( abs ) { bitprec += ceil ( a ) ; if ( a <= -65 ) E = M_LN2 * bitprec ; } * pbitprec = bitprec ; * pnlim = ceil ( E * E * log2 ( 1 + M_PI * td ) / ( D * td ) ) ; }
if (abs), absolute error rather than relative
if ( abs ) absolute error rather than relative
/* A2/2 = A, log(td) = (2/d)*log t */ /*log2 K(t)~a*/ /* if bitprec <= 0, caller should return K(t) ~ 0 */ /* guarantees E <= initial E */