bridge/class-master/depend/pari/src/basemath/rootpol.c
/* apply the conformal mapping then split from U */
apply the conformal mapping then split from U
apply the conformal mapping then split from U
static void
conformal_mapping(double *radii, GEN ctr, GEN p, long k, long bit,
                  double aux, GEN *F,GEN *G)
{
  long bit2, n = degpol(p), i;
  pari_sp ltop = avma, av;
  GEN q, FF, GG, a, R;
  double lrho, delta, param, param2;
  bit2 = bit + (long)(n*3.4848775) + 1;
  a = sqrtr_abs( stor(3, 2*MEDDEFAULTPREC - 2) );
  a = divrs(a, -6);
  a = gmul(mygprec(a,bit2), mygprec(ctr,bit2)); 
  av = avma;
  q = conformal_pol(mygprec(p,bit2), a);
  for (i=1; i<=n; i++)
    if (radii[i] != UNDEF) 
    {
      pari_sp av2 = avma;
      GEN t, r = dblexp(radii[i]), r2 = sqrr(r);
      t = divrr(shiftr((subrs(r2,1)),1), subrr(r2, mulur(3,subrs(r,1))));
      radii[i] = mydbllogr(addsr(1,t)) / 2;
      avma = av2;
    }
  lrho = logradius(radii, q,k,aux/10., &delta);
  update_radius(n, radii, lrho, &param, &param2);
  bit2 += (long)(n * fabs(lrho)/M_LN2 + 1.);
  R = mygprec(dblexp(-lrho), bit2);
  q = scalepol(q,R,bit2);
  gerepileall(av,2, &q,&R);
  optimize_split(q,k,delta,bit2,&FF,&GG,param,param2);
  bit2 += n; R = invr(R);
  FF = scalepol(FF,R,bit2);
  GG = scalepol(GG,R,bit2);
  a = mygprec(a,bit2);
  FF = conformal_pol(FF,a);
  GG = conformal_pol(GG,a);
  a = invr(subsr(1, gnorm(a)));
  FF = RgX_Rg_mul(FF, powru(a,k));
  GG = RgX_Rg_mul(GG, powru(a,n-k));
  *F = mygprec(FF,bit+n);
  *G = mygprec(GG,bit+n); gerepileall(ltop,2, F,G);
}
static void conformal_mapping ( double * radii , GEN ctr , GEN p , long k , long bit , double aux , GEN * F , GEN * G ) { long bit2 , n = degpol ( p ) , i ; pari_sp ltop = avma , av ; GEN q , FF , GG , a , R ; double lrho , delta , param , param2 ; bit2 = bit + ( long ) ( n * 3.4848775 ) + 1 ; a = sqrtr_abs ( stor ( 3 , 2 * MEDDEFAULTPREC - 2 ) ) ; a = divrs ( a , -6 ) ; a = gmul ( mygprec ( a , bit2 ) , mygprec ( ctr , bit2 ) ) ; av = avma ; q = conformal_pol ( mygprec ( p , bit2 ) , a ) ; for ( i = 1 ; i <= n ; i ++ ) if ( radii [ i ] != UNDEF ) { pari_sp av2 = avma ; GEN t , r = dblexp ( radii [ i ] ) , r2 = sqrr ( r ) ; t = divrr ( shiftr ( ( subrs ( r2 , 1 ) ) , 1 ) , subrr ( r2 , mulur ( 3 , subrs ( r , 1 ) ) ) ) ; radii [ i ] = mydbllogr ( addsr ( 1 , t ) ) / 2 ; avma = av2 ; } lrho = logradius ( radii , q , k , aux / 10. , & delta ) ; update_radius ( n , radii , lrho , & param , & param2 ) ; bit2 += ( long ) ( n * fabs ( lrho ) / M_LN2 + 1. ) ; R = mygprec ( dblexp ( - lrho ) , bit2 ) ; q = scalepol ( q , R , bit2 ) ; gerepileall ( av , 2 , & q , & R ) ; optimize_split ( q , k , delta , bit2 , & FF , & GG , param , param2 ) ; bit2 += n ; R = invr ( R ) ; FF = scalepol ( FF , R , bit2 ) ; GG = scalepol ( GG , R , bit2 ) ; a = mygprec ( a , bit2 ) ; FF = conformal_pol ( FF , a ) ; GG = conformal_pol ( GG , a ) ; a = invr ( subsr ( 1 , gnorm ( a ) ) ) ; FF = RgX_Rg_mul ( FF , powru ( a , k ) ) ; GG = RgX_Rg_mul ( GG , powru ( a , n - k ) ) ; * F = mygprec ( FF , bit + n ) ; * G = mygprec ( GG , bit + n ) ; gerepileall ( ltop , 2 , F , G ) ; }
apply the conformal mapping then split from U
apply the conformal mapping then split from U
/* n * (2.*log2(2.732)+log2(1.5)) + 1 */ /* a = -ctr/2sqrt(3) */ /* update array radii */ /* 2(r^2 - 1) / (r^2 - 3(r-1)) */