fucntional pi calc