FastPolyEval  1.0
Fast Evaluation of Real and Complex Polynomials
Data Structures | Macros | Typedefs | Functions
evalf.h File Reference

Definition of polynomials evaluator with machine floating point coefficients. More...

Go to the source code of this file.

Data Structures

struct  evalf_struct
 Evaluator of polynomials with machine floating point coefficients. More...
 

Macros

#define evalf_lastValError(ev)   (ev->valErr)
 The [approximative] upper bound for the error of the last evaluation, in bits. Not reported by the Newton term computation.
 
#define evalf_lastDerError(ev)   (ev->derErr)
 The [approximative] upper bound for the error of the last derivative evaluation, in bits. Not reported by the Newton term computation.
 

Typedefs

typedef evalf_struct evalf_t[1]
 Practical wrapper for evalf_struct. More...
 
typedef evalf_structevalf
 Convenience pointer to evalf_struct.
 

Functions

evalf evalf_new (polyf P)
 Returns a new evaluator of the complex polynomial P. More...
 
evalf evalf_new_r (polyfr Q)
 Returns a new evaluator of the real polynomial Q. More...
 
bool evalf_free (evalf ev)
 Frees all the memory used by the evaluator ev, assuming the struct has been allocated with malloc(), for example with evalf_new() or with evalf_new_r(). More...
 
bool evalf_val (compf v, evalf ev, compf z)
 Evaluates ev->P(z) (or ev->Q(z)) using the method described in [1]. More...
 
bool evalf_der (compf d, evalf ev, compf z)
 Evaluates ev->P'(z) (or ev->Q'(z)) using the method described in [1]. More...
 
bool evalf_val_der (compf v, compf d, evalf ev, compf z)
 Evaluates ev->P(z) and ev->P'(z) (or ev->Q(z) and ev->Q'(z)) using the method described in [1]. More...
 
bool evalf_newton (compf nt, evalf ev, compf z)
 Computes the Newthon method step of ev->P (or ev->Q) using the method described in [1]. More...
 
bool evalf_analyse (evalf ev)
 Analyses the complex polynomial ev->P, after some of its coefficients have been changed. More...
 
bool evalf_analyse_r (evalf ev)
 Analyses the real polynomial ev->Q, after some of its coefficients have been changed. More...
 
bool evalf_val_cc (compf v, evalf ev, compf z)
 Evaluates ev->P(x) using the method described in [1]. More...
 
bool evalf_der_cc (compf d, evalf ev, compf z)
 Evaluates ev->P'(x) using the method described in [1]. More...
 
bool evalf_val_der_cc (compf v, compf d, evalf ev, compf z)
 Evaluates ev->P(x) and ev->P'(x) using the method described in [1]. More...
 
bool evalf_newton_cc (compf nt, evalf ev, compf z)
 Computes the Newthon method step of ev->P using the method described in [1]. More...
 
bool evalf_val_cr (compf v, evalf ev, coeff_t x)
 Evaluates ev->P(x) using the method described in [1]. More...
 
bool evalf_der_cr (compf d, evalf ev, coeff_t x)
 Evaluates ev->P'(x) using the method described in [1]. More...
 
bool evalf_val_der_cr (compf v, compf d, evalf ev, coeff_t x)
 Evaluates ev->P(x) and ev->P'(x) using the method described in [1]. More...
 
bool evalf_newton_cr (compf nt, evalf ev, coeff_t x)
 Computes the Newthon method step of ev->P using the method described in [1]. More...
 
bool evalf_val_rc (compf v, evalf ev, compf z)
 Evaluates ev->Q(x) using the method described in [1]. More...
 
bool evalf_der_rc (compf d, evalf ev, compf z)
 Evaluates ev->Q'(x) using the method described in [1]. More...
 
bool evalf_val_der_rc (compf v, compf d, evalf ev, compf z)
 Evaluates ev->Q(x) and ev->Q'(x) using the method described in [1]. More...
 
bool evalf_newton_rc (compf nt, evalf ev, compf z)
 Computes the Newthon method step of ev->Q using the method described in [1]. More...
 
coeff_t evalf_val_rr (evalf ev, coeff_t x)
 Evaluates the real polynomial ev->Q(x) using the method described in [1]. More...
 
coeff_t evalf_der_rr (evalf ev, coeff_t x)
 Evaluates the derivative of real polynomial ev->Q'(x) using the method described in [1]. More...
 
bool evalf_val_der_rr (coeff_t *v, coeff_t *d, evalf ev, coeff_t x)
 Evaluates ev->Q(x) and ev->Q'(x) using the method described in [1]. More...
 
coeff_t evalf_newton_rr (evalf ev, coeff_t x)
 Computes the Newthon method step of the real polynomial ev->Q using the method described in [1]. More...
 

Detailed Description

Definition of polynomials evaluator with machine floating point coefficients.

Definition in file evalf.h.

Typedef Documentation

◆ evalf_t

typedef evalf_struct evalf_t[1]

Practical wrapper for evalf_struct.

To avoid the constant use * and & the type evalf_t is a pointer.

Definition at line 51 of file evalf.h.

Function Documentation

◆ evalf_analyse()

bool evalf_analyse ( evalf  ev)

Analyses the complex polynomial ev->P, after some of its coefficients have been changed.

Note
The general functions evalf_val(), evalf_der(), evalf_val_der() and evalf_newton() automatically analyse the appropriate polynomial. Use this function only with the optimized versions like evalf_val_cx().
Parameters
evthe evaluator
Returns
true if ev is ready to use, false otherwise.

◆ evalf_analyse_r()

bool evalf_analyse_r ( evalf  ev)

Analyses the real polynomial ev->Q, after some of its coefficients have been changed.

Note
The general functions evalf_val(), evalf_der(), evalf_val_der() and evalf_newton() automatically analyse the appropriate polynomial. Use this function only with the optimized versions like evalf_val_rx().
Parameters
evthe evaluator
Returns
true if ev is ready to use, false otherwise.

◆ evalf_der()

bool evalf_der ( compf  d,
evalf  ev,
compf  z 
)

Evaluates ev->P'(z) (or ev->Q'(z)) using the method described in [1].

Note
This function chooses the quickest variant to compute, depending if the polynomial of ev and / or z are real.
Parameters
dthe result
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_der_cc()

bool evalf_der_cc ( compf  d,
evalf  ev,
compf  z 
)

Evaluates ev->P'(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
dthe result
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_der_cr()

bool evalf_der_cr ( compf  d,
evalf  ev,
coeff_t  x 
)

Evaluates ev->P'(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
dthe result
evthe evaluator
xthe real argument
Returns
true if successfull, false otherwise.

◆ evalf_der_rc()

bool evalf_der_rc ( compf  d,
evalf  ev,
compf  z 
)

Evaluates ev->Q'(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
dthe result
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_der_rr()

coeff_t evalf_der_rr ( evalf  ev,
coeff_t  x 
)

Evaluates the derivative of real polynomial ev->Q'(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
evthe evaluator
xthe real argument
Returns
the result, NaN is some error occurred.

◆ evalf_free()

bool evalf_free ( evalf  ev)

Frees all the memory used by the evaluator ev, assuming the struct has been allocated with malloc(), for example with evalf_new() or with evalf_new_r().

Parameters
evthe evaluator
Returns
true if successfull, false otherwise.

◆ evalf_new()

evalf evalf_new ( polyf  P)

Returns a new evaluator of the complex polynomial P.

Parameters
Pthe complex polynomial
Returns
the new evaluator, NULL if some error occurred.

◆ evalf_new_r()

evalf evalf_new_r ( polyfr  Q)

Returns a new evaluator of the real polynomial Q.

Parameters
Qthe real polynomial
Returns
the new evaluator, NULL if some error occurred.

◆ evalf_newton()

bool evalf_newton ( compf  nt,
evalf  ev,
compf  z 
)

Computes the Newthon method step of ev->P (or ev->Q) using the method described in [1].

Note
This function chooses the quickest variant to compute, depending if the polynomial of ev and / or z are real.
Parameters
ntthe Newton term
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_newton_cc()

bool evalf_newton_cc ( compf  nt,
evalf  ev,
compf  z 
)

Computes the Newthon method step of ev->P using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
ntthe Newton term
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_newton_cr()

bool evalf_newton_cr ( compf  nt,
evalf  ev,
coeff_t  x 
)

Computes the Newthon method step of ev->P using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
ntthe Newton term
evthe evaluator
xthe real argument
Returns
true if successfull, false otherwise.

◆ evalf_newton_rc()

bool evalf_newton_rc ( compf  nt,
evalf  ev,
compf  z 
)

Computes the Newthon method step of ev->Q using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
ntthe Newton term
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_newton_rr()

coeff_t evalf_newton_rr ( evalf  ev,
coeff_t  x 
)

Computes the Newthon method step of the real polynomial ev->Q using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
evthe evaluator
xthe real argument
Returns
the result, NaN is some error occurred.

◆ evalf_val()

bool evalf_val ( compf  v,
evalf  ev,
compf  z 
)

Evaluates ev->P(z) (or ev->Q(z)) using the method described in [1].

Note
This function chooses the quickest variant to compute, depending if the polynomial of ev and / or z are real.
Parameters
vthe result
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_val_cc()

bool evalf_val_cc ( compf  v,
evalf  ev,
compf  z 
)

Evaluates ev->P(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
vthe result
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_val_cr()

bool evalf_val_cr ( compf  v,
evalf  ev,
coeff_t  x 
)

Evaluates ev->P(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
vthe result
evthe evaluator
xthe real argument
Returns
true if successfull, false otherwise.

◆ evalf_val_der()

bool evalf_val_der ( compf  v,
compf  d,
evalf  ev,
compf  z 
)

Evaluates ev->P(z) and ev->P'(z) (or ev->Q(z) and ev->Q'(z)) using the method described in [1].

Note
This function chooses the quickest variant to compute, depending if the polynomial of ev and / or z are real.
Parameters
vthe value
dthe derivative
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_val_der_cc()

bool evalf_val_der_cc ( compf  v,
compf  d,
evalf  ev,
compf  z 
)

Evaluates ev->P(x) and ev->P'(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
vthe value
dthe derivative
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_val_der_cr()

bool evalf_val_der_cr ( compf  v,
compf  d,
evalf  ev,
coeff_t  x 
)

Evaluates ev->P(x) and ev->P'(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
vthe value
dthe derivative
evthe evaluator
xthe real argument
Returns
true if successfull, false otherwise.

◆ evalf_val_der_rc()

bool evalf_val_der_rc ( compf  v,
compf  d,
evalf  ev,
compf  z 
)

Evaluates ev->Q(x) and ev->Q'(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
vthe value
dthe derivative
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_val_der_rr()

bool evalf_val_der_rr ( coeff_t v,
coeff_t d,
evalf  ev,
coeff_t  x 
)

Evaluates ev->Q(x) and ev->Q'(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
vthe value
dthe derivative
evthe evaluator
xthe real argument
Returns
true if successfull, false otherwise.

◆ evalf_val_rc()

bool evalf_val_rc ( compf  v,
evalf  ev,
compf  z 
)

Evaluates ev->Q(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
vthe result
evthe evaluator
zthe complex argument
Returns
true if successfull, false otherwise.

◆ evalf_val_rr()

coeff_t evalf_val_rr ( evalf  ev,
coeff_t  x 
)

Evaluates the real polynomial ev->Q(x) using the method described in [1].

Warning
For maximum speed, no checks are performed on the parameters, on the type of polynomial represented by ev nor if the polynomial has been pre-conditionned after the last coefficient update.
Parameters
evthe evaluator
xthe real argument
Returns
the result, NaN is some error occurred.