The $HI$- and $H_{2}$-to-stellar mass correlations of late- and early-type galaxies and their consistency with the observational mass functions