Question: How do I create "while" loops in Maple?

I'm trying to set up a "while" loop involving Newton's Method without using the Newton command. I'm leaving something out since the loop values aren't changing. This is what I have so far:

 

Error:=1;

x:='x';

DesiredError:=1.10^-30; (this is my error tolerance)

x_(1):=1.5; (this is my initial guess)

for n from 1 to 20 while (Error>DesiredError) do

 x_(n+1)=x_(n)-(p(x_(n))/p'(x_(n))):

 evalf(%):

 abs(x_(n+1)-x_(n)):

end do:

 

 

Any assistance would be great!

Thanks!

Please Wait...