The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: NaN with root finding method
Replies: 2   Last Post: Dec 4, 2012 12:21 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 983
Registered: 8/21/06
NaN with root finding method
Posted: Dec 3, 2012 11:18 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I am using the 64 bit version of MatLab. I am trying to reproduce another groups work on a rootfinding method (which for sake of simplicity will say is llike an improved version of Steffensen's method).

My results agree with theirs for the first couple of iterations, but then when I get very close to the root, I get "NaN" for my output (and they don't: they give results for numbers as low as 10^(-600)).

I know using difference quotients and the like, when you're close to a root, you're basically dividing a number very close to zero by another number very close to zero, and so you can get numerical instabilities. I've applied the "double" command to every number I'm using and every computed value, but it doesn't solve my problem.
Any help or advice would be greatly appreciated.

Matt Brenneman

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.