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

The implementation of the mini-apps with machine numbers. More...

Go to the source code of this file.

Functions

arrayf appf_join (arrayf z1, arrayf z2)
 Joins the real parts of the sequences z1 and z2 as the real parts and imaginary parts of a new list. More...
 
arrayf appf_grid (arrayf z1, arrayf z2)
 Computes the set product of the real parts of two sequences z1 and z2. More...
 
arrayf appf_exp (arrayf z)
 Computes the complex exponential of a sequence z. More...
 
arrayf appf_rot (arrayf z)
 Computes a*exp(ib) for each term a+ib of a sequence z of complex numbers. More...
 
arrayf appf_polar (arrayf z)
 Computes the complex numbers given by a sequence z of their polar coordinates on the sphere. More...
 
arrayf appf_unif (ulong n, coeff_t st, coeff_t en)
 Returns the list of n real numbers that split the interval [st,en] in n-1 equal intervals. More...
 
bool appf_compare (arrayf z1, arrayf z2, char *output)
 Compares two list of complex values and reports the eventual errors. More...
 
arrayf appf_re (arrayf z)
 Returns the real parts of the numbers in the sequence z. More...
 
arrayf appf_im (arrayf z)
 Returns the imaginary parts of the numbers in the sequence z. More...
 
arrayf appf_conj (arrayf z)
 Returns the conjugates of the numbers in the sequence z. More...
 
arrayf appf_tensor (arrayf z1, arrayf z2)
 Computes tensor (or piontwise) product of the sequences z1 and z2. More...
 
bool appf_eval_p (polyf P, arrayf 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 appf_eval_d (polyf P, arrayf 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 appf_eval_n (polyf P, arrayf 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 appf_eval_r (polyf P, arrayf 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...
 

Detailed Description

The implementation of the mini-apps with machine numbers.

Definition in file appsf.h.

Function Documentation

◆ appf_compare()

bool appf_compare ( arrayf  z1,
arrayf  z2,
char *  output 
)

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

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

◆ appf_conj()

arrayf appf_conj ( arrayf  z)

Returns the conjugates of the numbers in the sequence z.

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

◆ appf_eval_d()

bool appf_eval_d ( polyf  P,
arrayf  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
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.

◆ appf_eval_n()

bool appf_eval_n ( polyf  P,
arrayf  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
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.

◆ appf_eval_p()

bool appf_eval_p ( polyf  P,
arrayf  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
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.

◆ appf_eval_r()

bool appf_eval_r ( polyf  P,
arrayf  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
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.

◆ appf_exp()

arrayf appf_exp ( arrayf  z)

Computes the complex exponential of a sequence z.

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

◆ appf_grid()

arrayf appf_grid ( arrayf  z1,
arrayf  z2 
)

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

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

◆ appf_im()

arrayf appf_im ( arrayf  z)

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

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

◆ appf_join()

arrayf appf_join ( arrayf  z1,
arrayf  z2 
)

Joins the real parts of the sequences z1 and z2 as the real parts and imaginary parts of a new list.

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

◆ appf_polar()

arrayf appf_polar ( arrayf  z)

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

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

◆ appf_re()

arrayf appf_re ( arrayf  z)

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

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

◆ appf_rot()

arrayf appf_rot ( arrayf  z)

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

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

◆ appf_tensor()

arrayf appf_tensor ( arrayf  z1,
arrayf  z2 
)

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

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

◆ appf_unif()

arrayf appf_unif ( ulong  n,
coeff_t  st,
coeff_t  en 
)

Returns the list of n real numbers that split the interval [st,en] in n-1 equal intervals.

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