def fstarBen(mh, m1, f0, beta, gamma):
    """
    Stellar mass to halo mass ratio as a function of halo mass.
    Fitting function from Moster et al.
    """
    mstar = 2.0 * f0 * 10.0 ** mh / ((10.0 ** mh / 10.0 ** m1) ** (-beta) + (10.0 ** mh / 10.0 ** m1) ** gamma)
    fstar = mstar / 10.0 ** mh
    return fstar