bridge/class-master/depend/pari/src/basemath/elliptic.c
/* Formula from Silverman GTM 151 Theorem 3.2 page 466 */
Formula from Silverman GTM 151 Theorem 3.2 page 466
Formula from Silverman GTM 151 Theorem 3 . 2 page 466
static GEN
ellheight_C(GEN E, GEN P, long prec)
{
  pari_sp av = avma;
  GEN z = zell(E, P, prec);
  GEN per = ellperiods(E, 1, prec);
  GEN w = gel(per,1), w1 = gel(w,1), w2 = gel(w, 2), w1c = conj_i(w1);
  GEN e = gel(per,2), e1 = gel(e,1), e2 = gel(e, 2);
  GEN D = gsub(gmul(w1, conj_i(w2)),gmul(w1c, w2));
  GEN b = gdiv(gsub(gmul(w1, conj_i(z)),gmul(w1c, z)), D);
  GEN a = gdiv(gsub(z, gmul(b, w2)), w1);
  GEN eta = gadd(gmul(a, e1), gmul(b, e2));
  GEN r = gmul2n(real_i(gmul(z, eta)), -1);
  GEN l = real_i(ellsigma(per, z, 1, prec));
  return gerepileupto(av, gsub(r, l));
}
static GEN ellheight_C ( GEN E , GEN P , long prec ) { pari_sp av = avma ; GEN z = zell ( E , P , prec ) ; GEN per = ellperiods ( E , 1 , prec ) ; GEN w = gel ( per , 1 ) , w1 = gel ( w , 1 ) , w2 = gel ( w , 2 ) , w1c = conj_i ( w1 ) ; GEN e = gel ( per , 2 ) , e1 = gel ( e , 1 ) , e2 = gel ( e , 2 ) ; GEN D = gsub ( gmul ( w1 , conj_i ( w2 ) ) , gmul ( w1c , w2 ) ) ; GEN b = gdiv ( gsub ( gmul ( w1 , conj_i ( z ) ) , gmul ( w1c , z ) ) , D ) ; GEN a = gdiv ( gsub ( z , gmul ( b , w2 ) ) , w1 ) ; GEN eta = gadd ( gmul ( a , e1 ) , gmul ( b , e2 ) ) ; GEN r = gmul2n ( real_i ( gmul ( z , eta ) ) , -1 ) ; GEN l = real_i ( ellsigma ( per , z , 1 , prec ) ) ; return gerepileupto ( av , gsub ( r , l ) ) ; }
Formula from Silverman GTM 151 Theorem 3.2 page 466
Formula from Silverman GTM 151 Theorem 3 . 2 page 466