I've implemented the method of bisection using three embedded "while"
loops. My problem is that, when I call for the function, it runs
forever even though I have specified a maximum number of iterations.
It has been running long enough that I suspect it is going to run it
an infinite number of times.
Without revealing my code for the whole problem, I'll show enough
code demonstrate how I am telling it to stop after k iterations.
while(fx(((x+y)/2)) != tol && i < iter.max){
i = i+1
while(){
while(){
}
}
}
So, my first theory was that the other two loops were running
infinitely (or a lot of times) within each iteration of the first
while loop. However, I added "&& i < iter.max" to the end of the
other while loops and this did not help. Other theories?