PS3 Newton's Method: well I have some troubles with the root I find, in my algorithm if I evaluate - with evaluatePoly([...],root) - it's close to zero and less than epsilon, but the right output sometimes is very different, and also my iteration counter is higher than the real answer.
With output I mean, the right answer, sometimes I have [-0.9271107628992463, 10] and the answer from edX is [0.806790753796352, 7]
computeRoot([-8, 2, 1], -20, 0.0001) My answer = [2.0000001655887214, 10] Evaluating = 9.935323559417952e-07 - Real answer = [-4.00000000844848, 6] Evaluating = 0.0 - I know, but my answer is less than epsilon (0.0001)
I'm sooooooooo stupid!!! my code was like this epol = x_0 i = 0 epol = evaluatePoly(poly,x_0) And trying to copy it to post to get another opinion ... voilà!! my variable epol should be x_0, I didn't erase the third line in which I change epol T.T. sooo stupid
Join our real-time social learning platform and learn together with your friends!