On 8/25/06, sen1 at math.msu.edu <sen1 at math.msu.edu> wrote:
> On my last post, I guess the real question for me is
>
> why did realroots report rational roots if the roots are only accurate
> to a certain amount?
Because realroots *always* reports its results in rational form.
Realroots uses an approximation method which happens to use rationals
internally rather than bfloats. I understand that this can be
confusing because Maxima normally uses rationals to represent exact
numbers.
> Is there a predicate which would allow showing rational roots only if
> they really are rational?
Realroots is inherently an approximation algorithm, and rarely gives
exact rational roots. Try:
realroots((1220 * x - 34341) * (5423 * x - 1233), %o32,1.0e-100);
The denominators of the roots are roughly 10^-100. More annoyingly,
they are only accurate to 10^-93. It appears that rootepsilon is
relative to the leading coefficient of the polynomial, but that is not
documented.
You can of course easily test if the roots are exact, and you could
even try to guess at rational roots using continued fractions (cf),
but if you're looking for rational roots of polynomials, why not start
with factor, which finds them all exactly?
-s