pub fn pow(x: &BigInt, y: &BigInt) -> Result<BigInt, PoolError>
Calculate x^y using logarithmic and exponential properties