bridge/class-master/depend/pari/src/basemath/elltors.c
/* best generator in cycle of length k */
best generator in cycle of length k
best generator in cycle of length k
static GEN
best_in_cycle(GEN e, GEN p, long k)
{
  GEN p0 = p,q = p;
  long i;
  for (i=2; i+i<k; i++)
  {
    q = elladd(e,q,p0);
    if (ugcd(i,k)==1 && smaller_x(gel(q,1), gel(p,1))) p = q;
  }
  return (gsigne(ec_dmFdy_evalQ(e,p)) < 0)? ellneg(e,p): p;
}
static GEN best_in_cycle ( GEN e , GEN p , long k ) { GEN p0 = p , q = p ; long i ; for ( i = 2 ; i + i < k ; i ++ ) { q = elladd ( e , q , p0 ) ; if ( ugcd ( i , k ) == 1 && smaller_x ( gel ( q , 1 ) , gel ( p , 1 ) ) ) p = q ; } return ( gsigne ( ec_dmFdy_evalQ ( e , p ) ) < 0 ) ? ellneg ( e , p ) : p ; }
best generator in cycle of length k
best generator in cycle of length k