def decode_mmcm_fractional_divider(frac, low_time, high_time, frac_wf_fall,
                                   frac_wf_rise):
    """
    Decodes the value of a MMCM fractional divider given relevant register
    fields.
    """

    # A special case of 1:2.125 division
    if (frac, low_time, high_time, frac_wf_fall, frac_wf_rise) == \
       (1, 0, 0, 1, 1):
        return 2.125

    # Base divider
    divider = high_time + frac_wf_rise * 0.5 + \
              low_time + frac_wf_fall * 0.5 + \
              frac / 8.0

    # Correct
    if frac == 0:
        divider += 2.0
    elif frac == 1:
        divider += 1.5
    else:
        divider += 1.0

    return divider