Evaluation

Functions

void _fmpz_poly_evaluate_mpq_horner (mpq_t rop, const fmpz_poly_t f, const mpq_t a)
int fmpz_poly_q_evaluate (mpq_t rop, fmpz_poly_q_ptr f, const mpq_t a)

Function Documentation

void _fmpz_poly_evaluate_mpq_horner ( mpq_t  rop,
const fmpz_poly_t  f,
const mpq_t  a 
)

Evaluates the integer polynomial f at the rational a using Horner's method.

int fmpz_poly_q_evaluate ( mpq_t  rop,
fmpz_poly_q_ptr  f,
const mpq_t  a 
)

Evaluates the rational function f at the rational a.

If the denominator evaluates to zero at a, returns 0 and does not modify any of the variables. Otherwise, returns 1 and sets rop to the rational $f(a)$.

In the special case where a is an integer, this method uses the method fmpz_poly_evaluate from the fmpz_poly module. Otherwise, a simple implementation of Horner's method is employed.

Todo:
The second argument should be declared const, but as of FLINT 1.5.0 this generates a compile-time warning.
Generated on Wed Dec 8 17:00:29 2010 for FMPZ_POLY_Q by  doxygen 1.6.3