Not sure if this is any help or not, but I have created the following procedure for calculating pi.

The formula is as follows:

sqrt [ 2 - 2 sqrt (1 - {2 - sqrt 2}/4)] = U

Take this input, and put it in the following formula:

sqrt [ (U/2)^2 + (1 - sqrt {1- (U/2)^2} ) ]

The result should be recycled into the formula for successively accurate determinations of pi. To get the actual approximation of pi, one must multiply the result by 16N, where N is the cycle. For the first cycle, we get something like .1960..., which when multiplied by 16 yields 3.136... It is the .1960 which is fed into the formula again, which yields a number that, when multiplied by Nx16, N in this case being 2, or by 32. The result (not the result multiplied by Nx16) is circulated again and again, but each time, to get the approximation to pi, one must multiply the result by Nx16. Not sure if this can be converted into a computer algorithm, as I know next to nothing about computer programming.