Calculate Pi
Calculating PI, with computer or pencil. Over the centuries a number of people. PI by hand. Computers have made the job of calculating ever more useless. Windows based program for calculating millions. Update as of December 2. Irrational Numbers Search Engine Find numeric strings in the first 2 Billion digits of Pi, E, the Square Root of 2 and Phi. Fundamentals Name. The symbol used by mathematicians to represent the ratio of a circles circumference to its diameter is the lowercase Greek letter, sometimes. PIPredictor Predict your probability to become a Principal Investigator PI Updates November 2014 The PubMed database was updated to include publications up. Calculate Pitch Of Roof' title='Calculate Pitch Of Roof' />In the course of completing my high precision number class for. Fractal e. Xtreme. I had to create high precision versions of. I. wanted to test these, and calculating PI to a few thousand. I scanned around for an. PI. A little trigonometric thought will show that, since the. PI4 radians. No problem, a naive implementor might think. Ill just. calculate atan1, perhaps using the handy Taylor series. Run A Program Silently Windows 7 there. The Taylor series for atanx is. PI4 atan1 1 13 15 17 19. Trouble is, the Taylor series for atan converges very. My guess would be that if you wanted PI accurate to. Not a good method. A much better method is available however, courtesy of John Machin. It turns out. PI4 atan1 4 atan15 atan12. This is much more promising, because the Taylor series. Since each successive. These swiftly diminishing terms have two. Number one is that we need to do a. PI to. thousands of digits. Number two is that the calculations. If a particular term is, say, 1e 5. Therefore. we know that at that point we have calculated atan. If we have a C high precision number class called Inf. Prec. then a generic method for calculating atanx might. Inf. Prec atanconst Inf. Prec x. Inf. Prec Result x. Inf. Prec XSquared x x. Inf. Prec Term x. Divisor 1. while Term 0. Divisor 2. Term XSquared. Result Term Divisor. Divisor 2. Term XSquared. Result Term Divisor. Result. Therefore, our high precision number class needs to support. Unseen, but equally important, we need a way to initialize. This is probably best done. We also probably want a way to print. This requires having. So, calculating atan, and by extension PI, isnt too difficult. However this method is both harder and slower than it needs to. Dost Milte Hain Song more. The hardest and slowest part of our algorithm is muliplying. This is mildly messy to. On2 algorithm. On2 is just a fancy way of saying. We are using a generic atan routine. This is a handy thing. We know that x will. Therefore, instead of multiplying. Normally I would not advocate replacing multiplication with division. But when the multiplication is going to involve millions of. Heres a special version of atan that handles the case that. XSquared is now an integer. Inf. Prec ataninvintint x. Inf. Prec Result Inf. Prec1 x. int XSquared x x. Inf. Prec Term Result. Divisor 1. while Term 0. Divisor 2. Term XSquared. Result Term Divisor. Divisor 2. Term XSquared. Result Term Divisor. Result. So now our high precision number class just needs to support. These are all relatively. With careful coding of these routines, a desktop computer can. PI accurate to millions of digits The code. Inf. Prec PI ataninvint5 4 ataninvint2. Pretty darned simple. On a 2. 33. Mhz Pentium II I was able to. PI in just under six hours. More sophisticated algorithms can do this much faster but Machins. What I think is really cool about this is how easily this. PI. With a few. sheets of paper, some patience, and a vague memory of. PI to quite a high. I estimate that manually calculating. PI to thirty six digits would probably take a couple of. Less than. three hundred years ago, that would have been enough for. They werent. using such efficient methods, because they hadnt yet been. When calculating PI by hand it makes sense to pre multiply. This allows us to read off digits. So, our formula is. PI 4 4 atan15 atan12. PI 1. 6 atan15 4 atan12. Plugging this into our atan formula we get. Calculating 1. 65n is particularly easy for people accustomed to. Since 15 equals 21. In other words, a power of two, shifted right. Multiplying by the additional sixteen makes our final. Calculating the terms of atan12. But, you need comparatively much. In the following tables, underlined digits represent digits. Noticing these repeating digits simplify the calculations. Sign n 1. 65n Term1.