def DependentCare(nu13, elderly_dependents, earned,
                  MARS, ALD_Dependents_thd, ALD_Dependents_hc,
                  ALD_Dependents_Child_c, ALD_Dependents_Elder_c,
                  care_deduction):
    """
    Computes dependent-care above-the-line deduction.

    Parameters
    ----------
    nu13: Number of dependents under 13 years old
    elderly_dependents: number of elderly dependents
    earned: Form 2441 earned income amount
    MARS: Marital Status
    ALD_Dependents_thd: Maximum income to qualify for deduction
    ALD_Dependents_hc: Deduction for dependent care haircut
    ALD_Dependents_Child_c: National weighted average cost of childcare
    ALD_Dependents_Elder_c: Eldercare deduction ceiling

    Returns
    -------
    care_deduction: Total above the line deductions for dependent care.
    """

    if earned <= ALD_Dependents_thd[MARS - 1]:
        care_deduction = (((1. - ALD_Dependents_hc) * nu13 *
                           ALD_Dependents_Child_c) +
                          ((1. - ALD_Dependents_hc) * elderly_dependents *
                           ALD_Dependents_Elder_c))
    else:
        care_deduction = 0.
    return care_deduction