It might be useful to have `rationalize(x)` return `x` if `x` is already rational, to allow generic code that takes both reals and rationals as inputs.