bridge/class-master/depend/pari/src/basemath/ellisog.c
/* Returns an updated value for isog based (primarily) on tQ and uQ. Used to
 * iteratively compute the isogeny corresponding to a subgroup generated by a
 * given point. Ref: Equation 8 in Velu's paper.
 * isog = NULL codes the identity */
Returns an updated value for isog based (primarily) on tQ and uQ. Used to
iteratively compute the isogeny corresponding to a subgroup generated by a
given point. Ref: Equation 8 in Velu's paper.
isog = NULL codes the identity
Returns an updated value for isog based ( primarily ) on tQ and uQ . Used to iteratively compute the isogeny corresponding to a subgroup generated by a given point . Ref : Equation 8 in Velu ' s paper . isog = NULL codes the identity
static GEN
update_isogeny_polys(GEN isog, GEN E, GEN Q, GEN tQ, GEN uQ, long vx, long vy)
{
  pari_sp ltop = avma, av;
  GEN xQ = gel(Q, 1), yQ = gel(Q, 2);
  GEN rt = deg1pol_shallow(gen_1, gneg(xQ), vx);
  GEN a1 = ell_get_a1(E), a3 = ell_get_a3(E);
  GEN gQx = ec_dFdx_evalQ(E, Q);
  GEN gQy = ec_dFdy_evalQ(E, Q);
  GEN tmp1, tmp2, tmp3, tmp4, f, g, h, rt_sqr, res;
  av = avma;
  tmp1 = gmul(uQ, gadd(deg1pol_shallow(gen_2, gen_0, vy),
                       deg1pol_shallow(a1, a3, vx)));
  tmp1 = gerepileupto(av, tmp1);
  av = avma;
  tmp2 = gmul(tQ, gadd(gmul(a1, rt),
                       deg1pol_shallow(gen_1, gneg(yQ), vy)));
  tmp2 = gerepileupto(av, tmp2);
  av = avma;
  tmp3 = gsub(gmul(a1, uQ), gmul(gQx, gQy));
  tmp3 = gerepileupto(av, tmp3);
  if (!isog) isog = isog_identity(vx,vy);
  f = gel(isog, 1);
  g = gel(isog, 2);
  h = gel(isog, 3);
  rt_sqr = gsqr(rt);
  res = cgetg(4, t_VEC);
  av = avma;
  tmp4 = gdiv(gadd(gmul(tQ, rt), uQ), rt_sqr);
  gel(res, 1) = gerepileupto(av, gadd(f, tmp4));
  av = avma;
  tmp4 = gadd(tmp1, gmul(rt, gadd(tmp2, tmp3)));
  gel(res, 2) = gerepileupto(av, gsub(g, gdiv(tmp4, gmul(rt, rt_sqr))));
  av = avma;
  gel(res, 3) = gerepileupto(av, gmul(h, rt));
  return gerepileupto(ltop, res);
}
static GEN update_isogeny_polys ( GEN isog , GEN E , GEN Q , GEN tQ , GEN uQ , long vx , long vy ) { pari_sp ltop = avma , av ; GEN xQ = gel ( Q , 1 ) , yQ = gel ( Q , 2 ) ; GEN rt = deg1pol_shallow ( gen_1 , gneg ( xQ ) , vx ) ; GEN a1 = ell_get_a1 ( E ) , a3 = ell_get_a3 ( E ) ; GEN gQx = ec_dFdx_evalQ ( E , Q ) ; GEN gQy = ec_dFdy_evalQ ( E , Q ) ; GEN tmp1 , tmp2 , tmp3 , tmp4 , f , g , h , rt_sqr , res ; av = avma ; tmp1 = gmul ( uQ , gadd ( deg1pol_shallow ( gen_2 , gen_0 , vy ) , deg1pol_shallow ( a1 , a3 , vx ) ) ) ; tmp1 = gerepileupto ( av , tmp1 ) ; av = avma ; tmp2 = gmul ( tQ , gadd ( gmul ( a1 , rt ) , deg1pol_shallow ( gen_1 , gneg ( yQ ) , vy ) ) ) ; tmp2 = gerepileupto ( av , tmp2 ) ; av = avma ; tmp3 = gsub ( gmul ( a1 , uQ ) , gmul ( gQx , gQy ) ) ; tmp3 = gerepileupto ( av , tmp3 ) ; if ( ! isog ) isog = isog_identity ( vx , vy ) ; f = gel ( isog , 1 ) ; g = gel ( isog , 2 ) ; h = gel ( isog , 3 ) ; rt_sqr = gsqr ( rt ) ; res = cgetg ( 4 , t_VEC ) ; av = avma ; tmp4 = gdiv ( gadd ( gmul ( tQ , rt ) , uQ ) , rt_sqr ) ; gel ( res , 1 ) = gerepileupto ( av , gadd ( f , tmp4 ) ) ; av = avma ; tmp4 = gadd ( tmp1 , gmul ( rt , gadd ( tmp2 , tmp3 ) ) ) ; gel ( res , 2 ) = gerepileupto ( av , gsub ( g , gdiv ( tmp4 , gmul ( rt , rt_sqr ) ) ) ) ; av = avma ; gel ( res , 3 ) = gerepileupto ( av , gmul ( h , rt ) ) ; return gerepileupto ( ltop , res ) ; }
Returns an updated value for isog based (primarily) on tQ and uQ.
Returns an updated value for isog based ( primarily ) on tQ and uQ .
/* g -= uQ * (2 * y + E.a1 * x + E.a3)
   *   + tQ * rt * (E.a1 * rt + y - yQ)
   *   + rt * (E.a1 * uQ - gQx * gQy) */