finding roots of polynomials with high precision




On Sun, 5 Sep 2010, Ether Jones wrote:

< In Maple I can find the real root of x^5-x+1 to 50 decimal places like this:
< 
< evalf(solve(x^5-x+1=0,x),50);
< -1.1673039782614186842560458998548421807205603715255
< 
< How do I do this in Maxima?
< 
< I tried this but got the wrong answer:
< 
< fpprec: 50;
< g(x):=bfloat(x^5-x+1);
< bfloat(find_root(g(x),x,-2,-1));
< (%o14)? ? ? - 1.1673039782614187398479543844587169587612152099609b0

How about:
(%i2) load(mnewton);

(%o2)
"/home/work/maxima/sandbox/maxima-current-release/share/contrib/mnewton.mac"
(%i3) g(x):=x^5-x+1;

(%o3) g(x):=x^5-x+1
(%i4) (fpprec:50, newtonepsilon:bfloat(10^(-fpprec+5)),
mnewton(g(x),x,-2));

(%o4) [[x = -1.1673039782614186842560458998548421807205603715255b0]]

Setting newtonepsilon to a bfloat means the computations are done
in bfloat. Use

? mnewton

to see the documentation.

Leo 
-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.