def _cafec_coeff_ufunc(actual,
                       potential):
    """
    Vectorized function for computing a CAFEC coefficient.
    
    :param actual: average value for a month from water balance accounting 
    :param potential: average potential value from water balance accounting
    :return CAFEC coefficient
    """
     
    # calculate alpha
    if potential == 0:
        if actual == 0:
            coefficient = 1
        else:
            coefficient = 0
    else:
        coefficient = actual / potential
  
    return coefficient