def nutritional_error_margin(nutriment, value):
    """
    Returns the error margin of a product's nutriment according to EU directives

    Args:
        nutriment (str): Nutriment considered
        value (float): Given product content of the considered nutriment

    Returns:
        dict: Dictionary containing absolute and relative margins (only one of which is different from 0)

    Examples:
        >>>nutritional_error_margin('proteins', 0.05)
        {'absolute': 0.02, 'relative': 0}
        >>>nutritional_error_margin('proteins', 0.3)
        {'absolute': 0, 'relative': 0.2}
    """

    value = float(value)
    assert 0 <= value <= 1

    if nutriment.lower() in ('proteins', 'carbohydrates', 'sugars', 'fiber'):
        if 0 <= value < 0.1:
            return {'absolute': 0.02, 'relative': 0}
        elif 0.1 <= value < 0.4:
            return {'absolute': 0, 'relative': 0.2}
        elif 0.4 <= value <= 1:
            return {'absolute': 0.08, 'relative': 0}

    elif nutriment.lower() == 'fat':
        if 0 <= value < 0.1:
            return {'absolute': 0.015, 'relative': 0}
        elif 0.1 <= value < 0.4:
            return {'absolute': 0, 'relative': 0.2}
        elif 0.4 <= value <= 1:
            return {'absolute': 0.08, 'relative': 0}

    elif nutriment.lower() == 'saturated-fat':
        if 0 <= value < 0.04:
            return {'absolute': 0.008, 'relative': 0}
        elif 0.04 <= value <= 1:
            return {'absolute': 0, 'relative': 0.2}

    elif nutriment.lower() == 'salt':
        if 0 <= value < 0.0125:
            return {'absolute': 0.00375, 'relative': 0}
        elif 0.0125 <= value <= 1:
            return {'absolute': 0, 'relative': 0.2}

    else:
        raise ValueError('The nutriment is not recognized.')