I believe this line could just be `x.is_zero()`.