Question: "ERROR " Fixed point method

 

hi , can anyone tell me what's wrong withthis!! plzzz!thank you in advance!

Fixed point method:

> fixe := proc (p, g)

local n, nmax, e;

e := 1/100000000; nmax := 500;

while (evalb(n < nmax) and e < abs(g(p)-p) do

n := 1;

p := g(p); print(n, "             ", evalf(p, 10), "               ", evalf(g(p), 10));

n := n+1

end do;

if evalb(nmax < n) then

print("la methode a échouée après", nmax, "itérations")

else 

end if

end proc;

g := x-> x^2-2*x-3 ;

fixe(4, g);

            

 

            2          
    x -> x  - 2 x - 3
Error, (in fixe) cannot determine if this expression is true or false: n < 500



Please Wait...