> I have a question on the last problem, #29. > > A pre-question would be: Is the value of P supposed to be .5? I assumed it > was. Yes, P=.5. > > On to the real question. I have my SecantRoot program set up to calculate > .5-( ((1+p)/2) * (p/(1-p+p^2))^21 ). It will do this fine, however I do not > know what the real value of p should be when setting the equation equal to > 0. My program will go out to n=11 and give a value of .8423047910355657 > (which is oddly the same as when n=10) but after that p becomes NaN forever. > In Java NaN is "Not a Number" meaning something along the lines of divide by > 0 or something similarly undefined. This really isn't the issue, but it is a > result of my program not terminating itself because the true value is not > known for the tolerance checking. How am I supposed to find the true value? > I tried my calculator but it just sits and chugs forever. > The "oddly" part of your message answers your question! When two iterations of secant are the same, then you're in big trouble, because you're going to get at derivative approximation of 0, which results in a zero divide, which results in a NaN.... I get a value of 0.8423047910355659, so we're pretty close! Why are you using secant, may I ask?