Compute the number Pi to thousand decimal places.
Algorithm of J. M. Borwein and P. B. Borwein for computation of Pi number starts with the initializations
X=SQRT(2); Pi=2+X; Y=SQRT(X)
and then repeats the iteration
Unit: internal function, external function without procedure statement
Interface: SQRT function
Parameter: a positive integer P - number of digits of Pi, implicit P=9
Returns: the first P significant decimal digits of Pi, default is 9
There is an another way to obtain the value of the number Pi: we can compute the number Pi only once and save its value into the text of the function. The following PICONST function can be used to computing of the first P decimal digits of Pi, for P=1,...,200. It was created automatically by the program, see Technique: Beforehand computed constants.
The statement Number_Pi=PI(1000) computes 10 times loop in PI function and requires 79 seconds.