def tolerance(condition, sampling_rate=0):
    """Absolute tolerance for different condition."""
    tol = 0
    if condition == 8:
        tol = 2 ** -7
    elif condition == 16:
        tol = 2 ** -11  # half precision
    elif condition == 24:
        tol = 2 ** -17  # to be checked
    elif condition == 32:
        tol = 2 ** -24  # single precision
    elif condition == 'duration':
        tol = 1 / sampling_rate
    return tol