bridge/class-master/depend/pari/src/basemath/elliptic.c
/* n <= 4, N is the characteristic of the base ring or NULL (char 0) */
n <= 4, N is the characteristic of the base ring or NULL (char 0)
n < = 4 N is the characteristic of the base ring or NULL ( char 0 )
static GEN
elldivpol4(GEN e, GEN N, long n, long v)
{
  GEN b2,b4,b6,b8, res;
  if (n==0) return pol_0(v);
  if (n<=2) return N? scalarpol_shallow(mkintmod(gen_1,N),v): pol_1(v);
  b2 = ell_get_b2(e); b4 = ell_get_b4(e);
  b6 = ell_get_b6(e); b8 = ell_get_b8(e);
  if (n==3)
    res = mkpoln(5, N? modsi(3,N): utoi(3),b2,gmulsg(3,b4),gmulsg(3,b6),b8);
  else
  {
    GEN b10 = gsub(gmul(b2, b8), gmul(b4, b6));
    GEN b12 = gsub(gmul(b8, b4), gsqr(b6));
    res = mkpoln(7, N? modsi(2,N): gen_2,b2,gmulsg(5,b4),gmulsg(10,b6),gmulsg(10,b8),b10,b12);
  }
  setvarn(res, v); return res;
}
static GEN elldivpol4 ( GEN e , GEN N , long n , long v ) { GEN b2 , b4 , b6 , b8 , res ; if ( n == 0 ) return pol_0 ( v ) ; if ( n <= 2 ) return N ? scalarpol_shallow ( mkintmod ( gen_1 , N ) , v ) : pol_1 ( v ) ; b2 = ell_get_b2 ( e ) ; b4 = ell_get_b4 ( e ) ; b6 = ell_get_b6 ( e ) ; b8 = ell_get_b8 ( e ) ; if ( n == 3 ) res = mkpoln ( 5 , N ? modsi ( 3 , N ) : utoi ( 3 ) , b2 , gmulsg ( 3 , b4 ) , gmulsg ( 3 , b6 ) , b8 ) ; else { GEN b10 = gsub ( gmul ( b2 , b8 ) , gmul ( b4 , b6 ) ) ; GEN b12 = gsub ( gmul ( b8 , b4 ) , gsqr ( b6 ) ) ; res = mkpoln ( 7 , N ? modsi ( 2 , N ) : gen_2 , b2 , gmulsg ( 5 , b4 ) , gmulsg ( 10 , b6 ) , gmulsg ( 10 , b8 ) , b10 , b12 ) ; } setvarn ( res , v ) ; return res ; }
n <= 4, N is the characteristic of the base ring or NULL (char 0)
n < = 4 N is the characteristic of the base ring or NULL ( char 0 )