One of the easiest ways to make Maple crash is to iterate a function only slightly more complicated than this one using exact expressions rather than floats. Just about any function that contains the variable x in more than one place will do. The iterates rapidly get more and more complicated, eventually using up all available memory. So, in general, it's much better to insert an evalf into your loop, e.g.
one possibility
which one is more accurate?better?
> restart:
> n:=1:
> x[n]:=exp(1)^(-1/2):
> while n<21 do
> x[n+1]:=exp(1)^(-x[n]/2):
> n:=n+1:
> od:
> evalf(%%);
OR
> x := 1: # try with a rational!
> to 20 do
> x := exp(-x/2);
> end do:
> evalf(x);
Thanks
Which one?
One of the easiest ways to make Maple crash is to iterate a function only slightly more complicated than this one using exact expressions rather than floats. Just about any function that contains the variable x in more than one place will do. The iterates rapidly get more and more complicated, eventually using up all available memory. So, in general, it's much better to insert an evalf into your loop, e.g.
to 20 do
x := evalf(f(x))
end do: