def white_dwarf_mass(M):
    """
    Initial to final mass function to return white dwarf mass 
    as a function of the mass of its main sequence star projenitor.
    IFMF taken from Salaris et. al. 2009
    """

    if M < 4.0:
        wd_mass = 0.134 * M + 0.331
    else:
        wd_mass = 0.047 * M + 0.679


    return wd_mass