5.

Polynomials

Wrapper over the functions as described in Chaper 6 of the GNU Scientific Libraryreference manual.

There are routines for finding real and complex roots of quadratic and cubic equations using analytic methods. An iterative polynomial solver is also available for finding the roots of general polynomials with real coefficients (of any order).

(`eval``c, a`)-
evaluate the equation
using Horner's method for stability at
`x`. ``len'' is the number of coefficients (equal to the length of the python object)

**class**(`dd``xa,ya`)-
This class computes a divided-difference representation of the
interpolating polynomial for the points (
`xa`,`ya`).(`get_dd``)`- Get the devided-difference representation

(`eval`)`x`-
evaluate the representation at
`x`

(`taylor`)`x`- convert the internal representation to a Taylor expansion

(`solve_quadratic``a,b,c`)- computes the real roots of the equation all variables are real varibales using a ``C double type'' for internal representation. returns the number of roots and their value.

(`complex_solve_quadratic``a,b,c`)- computes the complex roots of the equation . all variables are complex varibales. Returns the number of roots and their value.

(`solve_cubic``a,b,c`)- computes the real roots of the equation . All variables are real varibales using a ``C double type'' for internal representation. Returns the number of roots and their value.

(`complex_solve_cubic``a,b,c`)- computes the complex roots of the equation . all variables are complex variables. returns the number of roots and their value.

**class**(`poly_complex``n`)-
intialise the class giving the dimension of the problem
(`solve``a`)-
This method computes the roots of the general polynomial
using balanced-QR reduction
of the companion matrix. The parameter n specifies the length of the
coefficient array. The coefficient of the highest order term must be
non-zero. The n-1 roots are returned in a complex array.
The method raises GSL_EFAILED if the QR reduction does not converge.