def AdditionalMedicareTax(e00200, MARS,
                          AMEDT_ec, sey, AMEDT_rt,
                          FICA_mc_trt, FICA_ss_trt,
                          ptax_amc, payrolltax):
    """
    Computes Additional Medicare Tax (Form 8959) included in payroll taxes.

    Notes
    -----
    Tax Law Parameters:
        AMEDT_ec : Additional Medicare Tax earnings exclusion

        AMEDT_rt : Additional Medicare Tax rate

        FICA_ss_trt : FICA Social Security tax rate

        FICA_mc_trt : FICA Medicare tax rate

    Taxpayer Charateristics:
        e00200 : Wages and salaries

        sey : Self-employment income

    Returns
    -------
    ptax_amc : Additional Medicare Tax

    payrolltax : payroll tax augmented by Additional Medicare Tax
    """
    line8 = max(0., sey) * (1. - 0.5 * (FICA_mc_trt + FICA_ss_trt))
    line11 = max(0., AMEDT_ec[MARS - 1] - e00200)
    ptax_amc = AMEDT_rt * (max(0., e00200 - AMEDT_ec[MARS - 1]) +
                           max(0., line8 - line11))
    payrolltax += ptax_amc
    return (ptax_amc, payrolltax)