Question: Programming

Question:Programming

Jabz 433 Maple

Hi i was wondering if anyone could tell me what code i have to program the Bisection Method. I can't seem to get the while loop to work. it only gives me the first iteration and stops. Here is what i have done
 

 

f:=x ->x^3-x-8:
a:=2;
b:=3;
f(a);
f(b);

while sign(f(b)) <> sign(f(c)) do
if (f(b)*f(c)) > 0 then
b:=c:
else
a:=c;
c:=(a + b)/2
end if:
end do;
print(c);
2.5
 

I just can't get it to work.
 

P.S I am a begginer and just recently been using maple so please give me a simple answer.

Thank u
 

Please Wait...