def calculate_fef(ms, mtbfa, mtbfgp):
    """
    Function to calculate the minimum required average fix effectiveness factor
    for the entire program or a test phase.

    :param float ms: the management strategy over the period to calculate the
                     fix effectiveness factor.
    :param float mtbfa: the average MTBF over the period to calculate the fix
                        effectiveness factor.
    :param float mtbfgp: the growth potential MTBF.
    :return: _avg_fef
    :rtype: float
    """

    try:
        _avg_fef = (mtbfgp - mtbfa) / (ms * mtbfgp)
    except ZeroDivisionError:
        _avg_fef = 1.0

    return _avg_fef