pi(d)=
{
	x=sqrt(2);
	y=2^(1/4);
	p=2+sqrt(2);

	for(k=1,d,
		x=1/2*(sqrt(x)+1/sqrt(x));
		p=p*(1+x)/(1+y);
		y=(y*sqrt(x)+1/sqrt(x))/(1+y);
	);
	return(p);
}
