# [Maxima] Allroot function problem

Raymond Toy raymond.toy at stericsson.com
Thu May 7 10:53:46 CDT 2009

```Leo Butler wrote:
>
> Here is the example, but with an errant %i in front. Perhaps the
> developers can comment on why allroots finds slightly different roots. I
> would have thought that it would have first normalised %i*g(x) to a
> monic polynomial (i.e. g(x)) before root finding.
>
If all the coefficients are real, allroots takes advantage of that and
uses a real-valued algorithm so that conjugate pairs of roots are truly
conjugates.  If any coefficient is complex, then a complex-valued
algorithm is used.  Hence the roots can be different.  (I think
sometimes they can be VERY different.)

Ray

> (%i7) r : allroots(%i*g(x));
> (%o7) [x = 8.660254037844386E-6*%i+4.999999999666666E-6,
>        x = -4.546085682277573E-22*%i-1.0000000000333333E-5,
>        x = 4.9999999996666655E-6-8.660254037844385E-6*%i,
>        x = 1.0-1.854133945715982E-17*%i,
>        x = 1.853943210852701E-17*%i-.9999999999999994]
> (%i8) map(lambda([x],expand(abs(g(rhs(x))))), r);
> (%o8) [2.04548464889026E-31,2.026200846528237E-31,5.680450389142161E-31,
>        2.25119816213002E-16,1.170503900707085E-16]
>
>
>
>
> Leo
>
>
>
>
>
>
> <
> < The map of a root has to be zero, doesn't it?
> < I have already tried with allroots(g(X)), but I got some strange
> < results (can someone explain me why?)
> <
> < By the way: my work with maxima is to find some polynomials and value
> < to which some rounding error happends, can someone give me some source
> < in the literature the approachs this topic (with examples)? I want to
> < identify interesting polynomials to test my new benchmark for floating
> < point calculation, which evaluates the quality of the result
> < (accuracy). I hope someone can help me.
> <
> < Thank you,
> < Oscar
> < _______________________________________________
> < Maxima mailing list
> < Maxima at math.utexas.edu
> < http://www.math.utexas.edu/mailman/listinfo/maxima
> <
> <
>
>

```