  We present a new accurate measurement of the HI mass function of galaxies
from the HIPASS Bright Galaxy Catalog, a sample of 1000 galaxies with the
highest HI peak flux densities in the southern hemisphere (Koribalski et al.
2003). This sample spans nearly four orders of magnitude in HI mass (from log
M_HI/M_sun=6.8 to 10.6, H0=75) and is the largest sample of HI selected
galaxies to date. We develop a bivariate maximum likelihood technique to
measure the space density of galaxies, and show that this is a robust method,
insensitive to the effects of large scale structure. The resulting HI mass
function can be fitted satisfactorily with a Schechter function with faint-end
slope alpha=-1.30. This slope is found to be dependent on morphological type,
with later type galaxies giving steeper slopes. We extensively test various
effects that potentially bias the determination of the HI mass function,
including peculiar motions of galaxies, large scale structure, selection bias,
and inclination effects, and quantify these biases. The large sample of
galaxies enables an accurate measurement of the cosmological mass density of
neutral gas: Omega_HI=(3.8 +/- 0.6) x 10^{-4}. Low surface brightness galaxies
contribute only 15% to this value, consistent with previous findings.
