Calculating pi using machin-like formula