![]() |
FastPolyEval
1.0
Fast Evaluation of Real and Complex Polynomials
|
The implementation of the mini-apps with MPFR numbers. More...
Go to the source code of this file.
Functions | |
array | app_join (long prec, array z1, array z2) |
Joins the real parts of the sequences z1 and z2 as the real parts and imaginary parts of a new list. More... | |
array | app_grid (long prec, array z1, array z2) |
Computes the set product of the real parts of two sequences z1 and z2 . More... | |
array | app_exp (long prec, array z) |
Computes the complex exponential of a sequence z . More... | |
array | app_rot (long prec, array z) |
Computes a*exp (ib) for each term a+ib of a sequence z of complex numbers. More... | |
array | app_polar (long prec, array z) |
Computes the complex numbers given by a sequence z of their polar coordinates on the sphere. More... | |
array | app_unif (long prec, ulong n, mpfr_t st, mpfr_t en) |
Returns the list of n real numbers that split the interval [st,en] in n-1 equal intervals. More... | |
array | app_rand (long prec, ulong n, mpfr_t st, mpfr_t en) |
Returns the list of n random real numbers in the interval [st,en], uniformly distributed. More... | |
array | app_normal (long prec, ulong n, mpfr_t cent, mpfr_t var) |
Returns the list of n random real numbers, normally distributed with center cent and variance var . More... | |
array | app_sphere (long prec, ulong n) |
Returns a list of n compelx numbers, uniformly distributed on the Riemann sphere. More... | |
bool | app_compare (long prec, array z1, array z2, char *output) |
Compares two list of complex values and reports the eventual errors. More... | |
array | app_re (long prec, array z) |
Returns the real parts of the numbers in the sequence z . More... | |
array | app_im (long prec, array z) |
Returns the imaginary parts of the numbers in the sequence z . More... | |
array | app_conj (long prec, array z) |
Returns the conjugates of the numbers in the sequence z . More... | |
array | app_tensor (long prec, array z1, array z2) |
Computes tensor (or piontwise) product of the sequences z1 and z2 . More... | |
bool | app_eval_p (long prec, poly P, array z, char *outFile, char *outError, long count, char *outHorner, long countHorner, const char **inFiles) |
Evaluates the polynomial P in all points in the list z , using the FPE algorithm. More... | |
bool | app_eval_d (long prec, poly P, array z, char *outFile, char *outError, long count, char *outHorner, long countHorner, const char **inFiles) |
Evaluates the derivative of the polynomial P in all points in the list z , using the FPE algorithm. More... | |
bool | app_eval_n (long prec, poly P, array z, char *outFile, char *outError, long count, char *outHorner, long countHorner, const char **inFiles) |
Evaluates the Newton terms of the polynomial P in all points in the list z , using the FPE algorithm. More... | |
bool | app_eval_r (long prec, poly P, array z, ulong maxIter, char *outFile, char *outError, long count, char *outHorner, long countHorner, const char **inFiles) |
Evaluates the Newton iterates of the polynomial P in all points in the list z , using the FPE algorithm. More... | |
bool | app_analyse (long prec, poly P, char *outFile, char *outChange) |
Analyses the polynomail P and outputs its concave cover, ignored coefficients and (optionally) the modules of complex numbers for which the reduced polynomial changes. More... | |
The implementation of the mini-apps with MPFR numbers.
Definition in file apps.h.
Analyses the polynomail P
and outputs its concave cover, ignored coefficients and (optionally) the modules of complex numbers for which the reduced polynomial changes.
These analysis is performed for the evaluations of the P
with prec
bits of precision. The concave cover corresponds to the pre-processing phase of the FPE algortihm. The map k->log_2|a_k|
is considered.
prec | the precision of evaluations |
P | the polynomial |
outFile | the output file containing the concave cover and the ognored coefficients |
outChange | the output file containing the intervals for log_2|z| and the corresponding reduced polynomials of P |
Returns the conjugates of the numbers in the sequence z
.
prec | the precision of the result |
z | the list of points |
z
, NULL
if some error occurred. bool app_eval_d | ( | long | prec, |
poly | P, | ||
array | z, | ||
char * | outFile, | ||
char * | outError, | ||
long | count, | ||
char * | outHorner, | ||
long | countHorner, | ||
const char ** | inFiles | ||
) |
Evaluates the derivative of the polynomial P
in all points in the list z
, using the FPE algorithm.
prec | the precision of intermediary computations and of the result |
P | the polynomial |
z | the list of evaluation points |
outFile | the results output file name |
outError | the errors list file name |
count | the number of repetitions of the computing task |
outHorner | the results output file name, computed by Horner's method |
countHorner | the number of repetitions of the computing task by Horner's method |
inFiles | a vector with the names of input files, for printing stats only |
bool app_eval_n | ( | long | prec, |
poly | P, | ||
array | z, | ||
char * | outFile, | ||
char * | outError, | ||
long | count, | ||
char * | outHorner, | ||
long | countHorner, | ||
const char ** | inFiles | ||
) |
Evaluates the Newton terms of the polynomial P
in all points in the list z
, using the FPE algorithm.
prec | the precision of intermediary computations and of the result |
P | the polynomial |
z | the list of evaluation points |
outFile | the results output file name |
outError | the errors list file name |
count | the number of repetitions of the computing task |
outHorner | the results output file name, computed by Horner's method |
countHorner | the number of repetitions of the computing task by Horner's method |
inFiles | a vector with the names of input files, for printing stats only |
bool app_eval_p | ( | long | prec, |
poly | P, | ||
array | z, | ||
char * | outFile, | ||
char * | outError, | ||
long | count, | ||
char * | outHorner, | ||
long | countHorner, | ||
const char ** | inFiles | ||
) |
Evaluates the polynomial P
in all points in the list z
, using the FPE algorithm.
prec | the precision of intermediary computations and of the result |
P | the polynomial |
z | the list of evaluation points |
outFile | the results output file name |
outError | the errors list file name |
count | the number of repetitions of the computing task |
outHorner | the results output file name, computed by Horner's method |
countHorner | the number of repetitions of the computing task by Horner's method |
inFiles | a vector with the names of input files, for printing stats only |
bool app_eval_r | ( | long | prec, |
poly | P, | ||
array | z, | ||
ulong | maxIter, | ||
char * | outFile, | ||
char * | outError, | ||
long | count, | ||
char * | outHorner, | ||
long | countHorner, | ||
const char ** | inFiles | ||
) |
Evaluates the Newton iterates of the polynomial P
in all points in the list z
, using the FPE algorithm.
This is a method to approximate the roots of P
, but there are no guarantees for the convergence. If the iterates escape far from the origin, the alogrith stops (for those starting points).
prec | the precision of intermediary computations and of the result |
P | the polynomial |
z | the list of evaluation points |
maxIter | the maximum iterates for each starting point |
outFile | the results output file name |
outError | the errors list file name |
count | the number of repetitions of the computing task |
outHorner | the results output file name, computed by Horner's method |
countHorner | the number of repetitions of the computing task by Horner's method |
inFiles | a vector with the names of input files, for printing stats only |
Computes the complex exponential of a sequence z
.
prec | the precision of the result |
z | the list of points |
NULL
if some error occurred. Computes the set product of the real parts of two sequences z1
and z2
.
prec | the precision of the result |
z1 | the first list |
z2 | the second list |
NULL
if some error occurred. Returns the imaginary parts of the numbers in the sequence z
.
prec | the precision of the result |
z | the list of points |
z
, NULL
if some error occurred. Joins the real parts of the sequences z1
and z2
as the real parts and imaginary parts of a new list.
prec | the precision of the result |
z1 | the first list |
z2 | the second list |
NULL
if some error occurred. Returns the list of n
random real numbers, normally distributed with center cent
and variance var
.
prec | the precision of the result |
n | the number of points, at least 2 |
cent | the center of the normal distribution |
var | the variance of the normal distribution |
NULL
if some error occurred. Computes the complex numbers given by a sequence z
of their polar coordinates on the sphere.
prec | the precision of the result |
z | the list of polar coordinates |
NULL
if some error occurred. Returns the list of n
random real numbers in the interval [st,en], uniformly distributed.
prec | the precision of the result |
n | the number of points, at least 2 |
st | the start point |
en | the end point |
NULL
if some error occurred. Returns the real parts of the numbers in the sequence z
.
prec | the precision of the result |
z | the list of points |
z
, NULL
if some error occurred. Computes a*exp
(ib) for each term a+ib
of a sequence z
of complex numbers.
prec | the precision of the result |
z | the list of points |
a+ib->a*exp
(ib), NULL
if some error occurred. Returns a list of n
compelx numbers, uniformly distributed on the Riemann sphere.
prec | the precision of the result |
n | the number of points, at least 2 |
NULL
if some error occurred. Computes tensor (or piontwise) product of the sequences z1
and z2
.
prec | the precision of the result |
z1 | the first list |
z2 | the second list |
NULL
if some error occurred. Returns the list of n
real numbers that split the interval [st,en] in
n-1
equal intervals.
prec | the precision of the result |
n | the number of points, at least 2 |
st | the start point |
en | the end point |
NULL
if some error occurred.