FastPolyEval  1.0
Fast Evaluation of Real and Complex Polynomials
Functions
apps.h File Reference

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...
 

Detailed Description

The implementation of the mini-apps with MPFR numbers.

Definition in file apps.h.

Function Documentation

◆ app_analyse()

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.

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.

Parameters
precthe precision of evaluations
Pthe polynomial
outFilethe output file containing the concave cover and the ognored coefficients
outChangethe output file containing the intervals for log_2|z| and the corresponding reduced polynomials of P
Returns
true if the analysis is complete, false if some error occurred.

◆ app_compare()

bool app_compare ( long  prec,
array  z1,
array  z2,
char *  output 
)

Compares two list of complex values and reports the eventual errors.

Parameters
precthe precision of the result
z1the fist list
z2the second list
outputa file name for the output file, NULL if not used
Returns
true if the comparison is complete, false if some error occurred.

◆ app_conj()

array app_conj ( long  prec,
array  z 
)

Returns the conjugates of the numbers in the sequence z.

Parameters
precthe precision of the result
zthe list of points
Returns
the conjugates of z, NULL if some error occurred.

◆ app_eval_d()

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.

Parameters
precthe precision of intermediary computations and of the result
Pthe polynomial
zthe list of evaluation points
outFilethe results output file name
outErrorthe errors list file name
countthe number of repetitions of the computing task
outHornerthe results output file name, computed by Horner's method
countHornerthe number of repetitions of the computing task by Horner's method
inFilesa vector with the names of input files, for printing stats only
Returns
true if the evaluaion is complete, false if some error occurred.

◆ app_eval_n()

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.

Parameters
precthe precision of intermediary computations and of the result
Pthe polynomial
zthe list of evaluation points
outFilethe results output file name
outErrorthe errors list file name
countthe number of repetitions of the computing task
outHornerthe results output file name, computed by Horner's method
countHornerthe number of repetitions of the computing task by Horner's method
inFilesa vector with the names of input files, for printing stats only
Returns
true if the evaluaion is complete, false if some error occurred.

◆ app_eval_p()

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.

Parameters
precthe precision of intermediary computations and of the result
Pthe polynomial
zthe list of evaluation points
outFilethe results output file name
outErrorthe errors list file name
countthe number of repetitions of the computing task
outHornerthe results output file name, computed by Horner's method
countHornerthe number of repetitions of the computing task by Horner's method
inFilesa vector with the names of input files, for printing stats only
Returns
true if the evaluaion is complete, false if some error occurred.

◆ app_eval_r()

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).

Parameters
precthe precision of intermediary computations and of the result
Pthe polynomial
zthe list of evaluation points
maxIterthe maximum iterates for each starting point
outFilethe results output file name
outErrorthe errors list file name
countthe number of repetitions of the computing task
outHornerthe results output file name, computed by Horner's method
countHornerthe number of repetitions of the computing task by Horner's method
inFilesa vector with the names of input files, for printing stats only
Returns
true if the evaluaion is complete, false if some error occurred.

◆ app_exp()

array app_exp ( long  prec,
array  z 
)

Computes the complex exponential of a sequence z.

Parameters
precthe precision of the result
zthe list of points
Returns
the image by the complex exponential, NULL if some error occurred.

◆ app_grid()

array app_grid ( long  prec,
array  z1,
array  z2 
)

Computes the set product of the real parts of two sequences z1 and z2.

Parameters
precthe precision of the result
z1the first list
z2the second list
Returns
the set product, NULL if some error occurred.

◆ app_im()

array app_im ( long  prec,
array  z 
)

Returns the imaginary parts of the numbers in the sequence z.

Parameters
precthe precision of the result
zthe list of points
Returns
the imaginary parts in z, NULL if some error occurred.

◆ app_join()

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.

Parameters
precthe precision of the result
z1the first list
z2the second list
Returns
the joint list, NULL if some error occurred.

◆ app_normal()

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.

Parameters
precthe precision of the result
nthe number of points, at least 2
centthe center of the normal distribution
varthe variance of the normal distribution
Returns
the list of random real numbers (in complex format), NULL if some error occurred.

◆ app_polar()

array app_polar ( long  prec,
array  z 
)

Computes the complex numbers given by a sequence z of their polar coordinates on the sphere.

Parameters
precthe precision of the result
zthe list of polar coordinates
Returns
the complex numbers given by their polar coordinates, NULL if some error occurred.

◆ app_rand()

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.

Parameters
precthe precision of the result
nthe number of points, at least 2
stthe start point
enthe end point
Returns
the list of random real numbers (in complex format), NULL if some error occurred.

◆ app_re()

array app_re ( long  prec,
array  z 
)

Returns the real parts of the numbers in the sequence z.

Parameters
precthe precision of the result
zthe list of points
Returns
the real parts in z, NULL if some error occurred.

◆ app_rot()

array app_rot ( long  prec,
array  z 
)

Computes a*exp(ib) for each term a+ib of a sequence z of complex numbers.

Parameters
precthe precision of the result
zthe list of points
Returns
the image by a+ib->a*exp(ib), NULL if some error occurred.

◆ app_sphere()

array app_sphere ( long  prec,
ulong  n 
)

Returns a list of n compelx numbers, uniformly distributed on the Riemann sphere.

Parameters
precthe precision of the result
nthe number of points, at least 2
Returns
the list of points uniformly distributed on the sphere, NULL if some error occurred.

◆ app_tensor()

array app_tensor ( long  prec,
array  z1,
array  z2 
)

Computes tensor (or piontwise) product of the sequences z1 and z2.

Parameters
precthe precision of the result
z1the first list
z2the second list
Returns
the tensor product, NULL if some error occurred.

◆ app_unif()

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.

Parameters
precthe precision of the result
nthe number of points, at least 2
stthe start point
enthe end point
Returns
the list of real numbers (in complex format), NULL if some error occurred.