roots of cubics?



Hello,

All of this is with maxima 5.9.3.

   Following the discussion about eigenvalues of cubic polynomials, I
   started experimenting with the characteristic polynomial of the
   matrix

   A: matrix([0,3,2],[3,0,1],[2,1,0]);

The polynomial is p(z) = -z^3 + 14*z + 12

As one might expect, its roots obtained by solve are somewhat of a
mess.

However,  realroots produces 3 rational roots.

(%i37) p(z):= -z^3 + 14*z + 12;
                                       3
(%o37)                     p(z) := - z  + 14 z + 12
(%i38) realroots(p(z));
                       107438331        30574087      138012419
(%o38)         [z = - ---------, z = - --------, z = ---------]
                       33554432         33554432      33554432

The denominator is 2^25.

That doesn't seem too large for CAS (or am I simply wrong here).

Call the roots $z_1, z_2, z_3$.

But,

%i41) p(part(%o38,1,2));
                                 366670081845891
(%o41)                      -----------------------
                             37778931862957161709568
(%i42) float(%);
(%o42)                       9.705676252996893E-9

So, trying to verify that the rational $z_1$ was a root is only
accurate to about 10^(-8).

Is this kind of thing to be expected?

I was surprised that "realroots" produced rational solutions in the
first place, but, given that, I thought I'd be in the realm of
rational arithmetic.

In double precision floating point arithmetic, I know one expects
accuracy to something like 16 decimal places.

What is number of digits to reasonably expect in rational arithmetic?

Is there a setting like fpprec for rational arithmetic?

-sen


-- 
  ---------------------------------------------------------------------------
  | Sheldon E. Newhouse            |    e-mail: sen1 at math.msu.edu           |
  | Mathematics Department         |       				   |
  | Michigan State University      | telephone: 517-355-9684                |
  | E. Lansing, MI 48824-1027 USA  |       FAX: 517-432-1562                |
  ---------------------------------------------------------------------------