def _calc_instability(ca, ce):
    """Returns the instability ratio between ca and ce."""
    if ca or ce:
        caf, cef = float(ca), float(ce)
        instab = cef / (cef + caf)
    else:
        instab = 0
    return instab