def relative_deviation(simulated, observed, threshold):
    """Return the relative deviation of a simulated value from an observed value."""
    try:
        1 / observed
    except ZeroDivisionError:
        observed = 0.00001

    dev = abs(simulated - observed) / observed
    if dev > threshold:
        return (True, dev)
    else:
        return (False, dev)