I don't think it's easy.  The second variant (with Float -> Rational conversion) looks better.