ROOTS INDEX

ROOTS _ _ _ _ _ _ _ _ _ _ _ _ operator

The operator roots is the main top level function of the roots package. It will find all roots, real and complex, of the polynomial p to an accuracy that is sufficient to separate them and which is a minimum of 6 decimal places.

syntax:

roots(<p>)

where <p> is a univariate polynomial. Result is a list of equations which represent the roots of the polynomial at the given accuracy. In addition, roots stores separate lists of real roots and complex roots in the global variables rootsreal and rootscomplex.

examples:


roots(x^5-2);

  {x=-0.929316 + 0.675188*i,
    x=-0.929316 - 0.675188*i,
    x=0.354967 + 1.09248*i,
    x=0.354967 - 1.09248*i, 
    x=1.1487}

The minimal accuracy of the result values is controlled by rootacc.