dmatheson
06-12-2006, 02:36 PM
Hi there.
I have used mnbrak (10.1 Golden Section Search in One Dimension) succesfully in Visual Basic, C++ and S-Plus.
However, what I am bracketing needs to have the following boundary: it must be more than 0 and less than 1. It is exceedingly rare that I get a number higher than one (indeed I can't recall if I ever have), but from time-to-time the function brackets a number that is less than 0 - and thus causes my function to crash.
I have gotten around this problem to this point by artificially setting my final value to a very small 0.1E-20 value, but would prefer more accuracy.
Can anyone lend a hand as I am really not sure how to go about doing this?
Cheers,
David
I have used mnbrak (10.1 Golden Section Search in One Dimension) succesfully in Visual Basic, C++ and S-Plus.
However, what I am bracketing needs to have the following boundary: it must be more than 0 and less than 1. It is exceedingly rare that I get a number higher than one (indeed I can't recall if I ever have), but from time-to-time the function brackets a number that is less than 0 - and thus causes my function to crash.
I have gotten around this problem to this point by artificially setting my final value to a very small 0.1E-20 value, but would prefer more accuracy.
Can anyone lend a hand as I am really not sure how to go about doing this?
Cheers,
David