bridge/class-master/depend/pari/src/basemath/elliptic.c
/* Exactness of lhs and rhs in the following depends in non-obvious ways
 * on the coeffs of the curve as well as on the components of the point z.
 * Thus if e is exact, with a1==0, and z has exact y coordinate only, the
 * lhs will be exact but the rhs won't. */
Exactness of lhs and rhs in the following depends in non-obvious ways
on the coeffs of the curve as well as on the components of the point z.
Thus if e is exact, with a1==0, and z has exact y coordinate only, the
lhs will be exact but the rhs won't.
Exactness of lhs and rhs in the following depends in non - obvious ways on the coeffs of the curve as well as on the components of the point z . Thus if e is exact with a1 == 0 and z has exact y coordinate only the lhs will be exact but the rhs won ' t .
int
oncurve(GEN e, GEN z)
{
  GEN LHS, RHS, x;
  long pl, pr, ex, expx;
  pari_sp av;
  checkellpt(z); if (ell_is_inf(z)) return 1; 
  if (ell_get_type(e) == t_ELL_NF) z = nfVtoalg(ellnf_get_nf(e), z);
  av = avma;
  LHS = ec_LHS_evalQ(e,z);
  RHS = ec_f_evalx(e,gel(z,1)); x = gsub(LHS,RHS);
  if (gequal0(x)) { avma = av; return 1; }
  pl = precision(LHS);
  pr = precision(RHS);
  if (!pl && !pr) { avma = av; return 0; } 
  ex = pr? gexpo(RHS): gexpo(LHS); 
  if (!pr || (pl && pl < pr)) pr = pl; 
  expx = gexpo(x);
  pr = (expx < ex - prec2nbits(pr) + 15
     || expx < ellexpo(e) - prec2nbits(pr) + 5);
  avma = av; return pr;
}
int oncurve ( GEN e , GEN z ) { GEN LHS , RHS , x ; long pl , pr , ex , expx ; pari_sp av ; checkellpt ( z ) ; if ( ell_is_inf ( z ) ) return 1 ; if ( ell_get_type ( e ) == t_ELL_NF ) z = nfVtoalg ( ellnf_get_nf ( e ) , z ) ; av = avma ; LHS = ec_LHS_evalQ ( e , z ) ; RHS = ec_f_evalx ( e , gel ( z , 1 ) ) ; x = gsub ( LHS , RHS ) ; if ( gequal0 ( x ) ) { avma = av ; return 1 ; } pl = precision ( LHS ) ; pr = precision ( RHS ) ; if ( ! pl && ! pr ) { avma = av ; return 0 ; } ex = pr ? gexpo ( RHS ) : gexpo ( LHS ) ; if ( ! pr || ( pl && pl < pr ) ) pr = pl ; expx = gexpo ( x ) ; pr = ( expx < ex - prec2nbits ( pr ) + 15 || expx < ellexpo ( e ) - prec2nbits ( pr ) + 5 ) ; avma = av ; return pr ; }
Exactness of lhs and rhs in the following depends in non-obvious ways
 on the coeffs of the curve as well as on the components of the point z.
Exactness of lhs and rhs in the following depends in non - obvious ways on the coeffs of the curve as well as on the components of the point z .
/* oo */ /* both of LHS, RHS are exact */ /* at least one of LHS,RHS is inexact */ /* don't take exponent of exact 0 */ /* min among nonzero elts of {pl,pr} */