bridge/class-master/depend/pari/src/basemath/mellininv.c
/* Evaluate a vector considered as a polynomial using Horner. Unstable!
 * If ui != NULL, ui = 1/u, evaluate P(1/u)*u^(deg P): useful for |u|>1 */
Evaluate a vector considered as a polynomial using Horner. Unstable.
Evaluate a vector considered as a polynomial using Horner . Unstable .
static GEN
evalvec(GEN vec, long lim, GEN u, GEN ui)
{
  pari_sp ltop = avma;
  GEN S = gen_0;
  long n;
  lim = minss(lim, lg(vec)-1);
  if (!ui)
    for (n = lim; n >= 1; --n) S = gmul(u, gadd(gel(vec,n), S));
  else
  {
    for (n = 1; n <= lim; ++n) S = gmul(ui, gadd(gel(vec,n), S));
    S = gmul(gpowgs(u, n), S);
  }
  return gerepileupto(ltop, S);
}
static GEN evalvec ( GEN vec , long lim , GEN u , GEN ui ) { pari_sp ltop = avma ; GEN S = gen_0 ; long n ; lim = minss ( lim , lg ( vec ) - 1 ) ; if ( ! ui ) for ( n = lim ; n >= 1 ; -- n ) S = gmul ( u , gadd ( gel ( vec , n ) , S ) ) ; else { for ( n = 1 ; n <= lim ; ++ n ) S = gmul ( ui , gadd ( gel ( vec , n ) , S ) ) ; S = gmul ( gpowgs ( u , n ) , S ) ; } return gerepileupto ( ltop , S ) ; }
Evaluate a vector considered as a polynomial using Horner.
Evaluate a vector considered as a polynomial using Horner .