def get_annuity(forward, year_fraction, number_payments):
    """
    Cash settled annuity formula. See formula (1)
    :param forward: float
    :param year_fraction: float. Typically 1.0 for yearly, 0.5 semi-annual, etc
    :param number_payments: int
    :return: float
    """
    annuity = 0.0
    tmp = year_fraction
    for j in range(0, number_payments):
        tmp /= 1.0 + year_fraction * forward
        annuity += tmp
    return annuity