bridge/class-master/depend/pari/src/basemath/ellisog.c
/* deg h = 1; 2-torsion contribution from Weierstrass point */
deg h = 1; 2-torsion contribution from Weierstrass point
deg h = 1 ; 2 - torsion contribution from Weierstrass point
static GEN
contrib_weierstrass_pt(GEN E, GEN h, long only_image, long vx, long vy)
{
  GEN p = ellbasechar(E);
  GEN a1 = ell_get_a1(E);
  GEN a3 = ell_get_a3(E);
  GEN x0 = gneg(constant_coeff(h)); 
  GEN b = gadd(gmul(a1,x0), a3);
  GEN y0, Q, t, w, t1, t2, f, g;
  if (!equalis(p, 2L)) 
    y0 = gmul2n(gneg(b), -1);
  else
  { 
    if (!gequal0(b)) pari_err_BUG("two_torsion_contrib (a1*x0+a3 != 0)");
    y0 = gsqrt(ec_f_evalx(E, x0), 0);
  }
  Q = mkvec2(x0, y0);
  t = ec_dFdx_evalQ(E, Q);
  w = gmul(x0, t);
  if (only_image) return mkvec2(t,w);
  f = deg1pol_shallow(t, gmul(t, gneg(x0)), vx);
  t1 = deg1pol_shallow(a1, gmul(a1, gneg(x0)), vx);
  t2 = deg1pol_shallow(gen_1, gneg(y0), vy);
  g = gmul(f, gadd(t1, t2));
  return mkvec5(t, w, f, g, h);
}
static GEN contrib_weierstrass_pt ( GEN E , GEN h , long only_image , long vx , long vy ) { GEN p = ellbasechar ( E ) ; GEN a1 = ell_get_a1 ( E ) ; GEN a3 = ell_get_a3 ( E ) ; GEN x0 = gneg ( constant_coeff ( h ) ) ; GEN b = gadd ( gmul ( a1 , x0 ) , a3 ) ; GEN y0 , Q , t , w , t1 , t2 , f , g ; if ( ! equalis ( p , 2L ) ) y0 = gmul2n ( gneg ( b ) , -1 ) ; else { if ( ! gequal0 ( b ) ) pari_err_BUG ( " " ) ; y0 = gsqrt ( ec_f_evalx ( E , x0 ) , 0 ) ; } Q = mkvec2 ( x0 , y0 ) ; t = ec_dFdx_evalQ ( E , Q ) ; w = gmul ( x0 , t ) ; if ( only_image ) return mkvec2 ( t , w ) ; f = deg1pol_shallow ( t , gmul ( t , gneg ( x0 ) ) , vx ) ; t1 = deg1pol_shallow ( a1 , gmul ( a1 , gneg ( x0 ) ) , vx ) ; t2 = deg1pol_shallow ( gen_1 , gneg ( y0 ) , vy ) ; g = gmul ( f , gadd ( t1 , t2 ) ) ; return mkvec5 ( t , w , f , g , h ) ; }
deg h = 1; 2-torsion contribution from Weierstrass point
deg h = 1 ; 2 - torsion contribution from Weierstrass point
/* h = x - x0 */ /* char(k) != 2 ==> y0 = -b/2 */ /* char(k) = 2 ==> y0 = sqrt(f(x0)) where E is y^2 + h(x) = f(x). */ /* Compute isogeny, f = (x - x0) * t */ /* g = (x - x0) * t * (a1 * (x - x0) + (y - y0)) */