[GHC] #10387: toRational should error out on NaN and Infinity values for Double/Floats