Max Alekseyev on Wed, 25 Sep 2013 03:31:25 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: rational roots


Bill, thank you for this useful suggestion.
Is bestappr(x) just a more convenient form of algdep(x,1) ? Or is it more efficient/accurate/etc.?
Regards,
Max

On Sep 24, 2013 2:39 PM, "Bill Allombert" <Bill.Allombert@math.u-bordeaux1.fr> wrote:
On Tue, Sep 24, 2013 at 01:45:44PM -0400, Max Alekseyev wrote:
> Another approach would be to convert obtained floating point roots in
> rational numbers as follows:
>
> ? polroots(x^2-0.25)
> %1 = [-0.50000000000000000000000000000000000000 + 0.E-38*I,
> 0.50000000000000000000000000000000000000 + 0.E-38*I]~
> ? apply(t->algdep(t,1),%)
> %2 = [2*x + 1, 2*x - 1]~

For such conversion, rather use bestappr
? apply(bestappr,%)
%2 = [-1/2,1/2]~

Cheers,
Bill