![](https://secure.gravatar.com/avatar/fc2baa22f0b0e9fc8dc93733cb94103c.jpg?s=120&d=mm&r=g)
19 Mar
2008
19 Mar
'08
12:56 a.m.
This function solved my problem when I used 20 iterations, but when I used 40 iterations I got (nan, nan, nan). I logged the successive points for which my function was evaluated, and the process seemed to have converged to the correct answer before suddenly deciding to give nans. My current solution is to just use 20 iterations, but I would be interested to hear a safer solution. Alex