Generate π to 5 decimal places

Use Gauss Legendre Algorithm

Iteration Formula is below:

y = a
a=½(a+b)
b=√by
c = c - x(a-y)2
x = 2x

π  =  (a+b)2
  4c

Start with these initial values:

a = 1
x = 1

b  =  1
  2

c = ¼

π to 5 digits using Gauss-Legendre