bridge/class-master/depend/pari/src/basemath/F2xqE.c
/* Computes the equation of the line through R and P, and returns its
   evaluation at the point Q. Also adds P to the point R.
 */
Computes the equation of the line through R and P, and returns its
evaluation at the point Q. Also adds P to the point R.
Computes the equation of the line through R and P and returns its evaluation at the point Q . Also adds P to the point R .
static GEN
F2xqE_chord_update(GEN R, GEN P, GEN Q, GEN a2, GEN T, GEN *pt_R)
{
  if (ell_is_inf(R))
  {
    *pt_R = gcopy(P);
    return F2xqE_vert(P, Q, a2, T);
  }
  else if (ell_is_inf(P))
  {
    *pt_R = gcopy(R);
    return F2xqE_vert(R, Q, a2, T);
  }
  else if (F2x_equal(gel(P, 1), gel(R, 1)))
  {
    if (F2x_equal(gel(P, 2), gel(R, 2)))
      return F2xqE_tangent_update(R, Q, a2, T, pt_R);
    else
    {
      *pt_R = ellinf();
      return F2xqE_vert(R, Q, a2, T);
    }
  } else {
    GEN slope;
    *pt_R = F2xqE_add_slope(P, R, a2, T, &slope);
    return F2xqE_Miller_line(R, Q, slope, a2, T);
  }
}
static GEN F2xqE_chord_update ( GEN R , GEN P , GEN Q , GEN a2 , GEN T , GEN * pt_R ) { if ( ell_is_inf ( R ) ) { * pt_R = gcopy ( P ) ; return F2xqE_vert ( P , Q , a2 , T ) ; } else if ( ell_is_inf ( P ) ) { * pt_R = gcopy ( R ) ; return F2xqE_vert ( R , Q , a2 , T ) ; } else if ( F2x_equal ( gel ( P , 1 ) , gel ( R , 1 ) ) ) { if ( F2x_equal ( gel ( P , 2 ) , gel ( R , 2 ) ) ) return F2xqE_tangent_update ( R , Q , a2 , T , pt_R ) ; else { * pt_R = ellinf ( ) ; return F2xqE_vert ( R , Q , a2 , T ) ; } } else { GEN slope ; * pt_R = F2xqE_add_slope ( P , R , a2 , T , & slope ) ; return F2xqE_Miller_line ( R , Q , slope , a2 , T ) ; } }
Computes the equation of the line through R and P, and returns its
evaluation at the point Q.
Computes the equation of the line through R and P and returns its evaluation at the point Q .