Previous page : Calculating pi using the compound formula
Next page : Calculating pi - part 3
Now, let us use the information on the previous page to find a value of b such that eib = –1.
One way to proceed now is to use the interval halving method. Say we want to solve f(x)=0. We start with two guesses: one that yields a result that is too big and one that yields a result that is too small. Given that the function is continuous, we must have a 0 somewhere in between those two start values.
In our case, we should try to find a value for b between 2 and 4 such that the imaginary part of the compound formula is 0.
We pick the mean value of our two guesses and then calculate f(x) of that value. Say the result is positive, and say, f( of our lower guess) is also positive, then we let the mean value be our new lower guess. We do similarly for the upper guess.
You may explore that here:
I wrote “pi” here, but remember, we are pretending we don’t know the value of pi at this stage.
The calculations are done using 1006-digit numbers, and the interval halving is done 1595 times. The result is shown with 481 digits. The digits in boldface are stable. The speed increases after 160 steps.
What we have just found is a value that is about 3.14159 26535 89793 23846.
So, what value is that? Remember, we pretend that we don’t know the value of π – or even that this value is supposed to be π.
We continue with trying to find this out on the next page.
Previous page : Calculating pi using the compound formula
Next page : Calculating pi - part 3