Module Rat_poly_common


module Rat_poly_common: sig .. end
Provides usual operations involving polynomials in one variable and whose coefficients are rational.

val eq_poly : Rat_poly.rat_poly * Rat_poly.rat_poly -> bool
Tests two polynomials for equality.
val add_poly : Rat_poly.rat_poly * Rat_poly.rat_poly -> Rat_poly.rat_poly
Adds two polynomials.
val x_times : Rat_poly.rat_poly -> Rat_poly.rat_poly
Multiply a polynomial by the monomial X.
val deriv_poly : Rat_poly.rat_poly -> Rat_poly.rat_poly
Returns the derivative of a polynomial.
val rat_times_poly : Rat.rat * Rat_poly.rat_poly -> Rat_poly.rat_poly
Returns the polynomial ap given the pair (a, p) where a is a rational and p is a polynomial.
val mult_poly : Rat_poly.rat_poly * Rat_poly.rat_poly -> Rat_poly.rat_poly
Multiply two polynomials.
val degree : Rat_poly.rat_poly -> int
Returns the degree of a non-zero polynomial.
val leading_coef : Rat_poly.rat_poly -> Rat.rat
Returns the leading coefficient of a non-zero polynomial.
val monomial : Rat.rat * int -> Rat_poly.rat_poly
Returns the monomial ap where p is X raised to the power d given the pair (a, d) where a is a non-zero rational and d is a non-negative integer.
val euclid_div_poly : Rat_poly.rat_poly * Rat_poly.rat_poly ->
Rat_poly.rat_poly * Rat_poly.rat_poly
Returns the pair (q, r) where q is the quotient and r is the remainder in the euclidean division of p1 by p2, given the pair (p1, p2) of polynomials where the divisor p2 is non-zero.
val quotient_poly : Rat_poly.rat_poly * Rat_poly.rat_poly -> Rat_poly.rat_poly
Returns the quotient in the euclidean division of p1 by p2, given the pair (p1, p2) of polynomials where the divisor p2 is non-zero.
val mod_poly : Rat_poly.rat_poly * Rat_poly.rat_poly -> Rat_poly.rat_poly
Returns the remainder in the euclidean division of p1 by p2, given the pair (p1, p2) of polynomials where the divisor p2 is non-zero.
val gcd_poly : Rat_poly.rat_poly * Rat_poly.rat_poly -> Rat_poly.rat_poly
Returns the gcd (greatest common divisor) of a pair of non-zero polynomials.
val eval_poly : Rat_poly.rat_poly * Rat.rat -> Rat.rat
Evaluation of a polynomial.
val function_of_poly : Rat_poly.rat_poly -> Rat.rat -> Rat.rat
Returns the polynomial function associated with a polynomial.
val poly_of_coef_list : Rat.rat list -> Rat_poly.rat_poly
Returns the polynomial given a list of its coefficients ordered according to decreasing degrees (we write "a" list rather than "the" list because this list may begin with useless zeros).