Pi calculation with ball bound