(x)
evaluates the natural logarithm of an interval
evaluates the natural logarithm of an interval
evaluates the natural logarithm of an interval
def log(x):
    """evaluates the natural logarithm of an interval"""
    np = import_module('numpy')
    if isinstance(x, (int, float)):
        if x <= 0:
            return interval(-np.inf, np.inf, is_valid=False)
        else:
            return interval(np.log(x))
    elif isinstance(x, interval):
        if not x.is_valid:
            return interval(-np.inf, np.inf, is_valid=x.is_valid)
        elif x.end <= 0:
            return interval(-np.inf, np.inf, is_valid=False)
        elif x.start <= 0:
            return interval(-np.inf, np.inf, is_valid=None)

        return interval(np.log(x.start), np.log(x.end))
    else:
        raise NotImplementedError
def log ( x ) : np = import_module ( 'numpy' ) if isinstance ( x , ( int , float ) ) : if x <= 0 : return interval ( - np . inf , np . inf , is_valid = False ) else : return interval ( np . log ( x ) ) elif isinstance ( x , interval ) : if not x . is_valid : return interval ( - np . inf , np . inf , is_valid = x . is_valid ) elif x . end <= 0 : return interval ( - np . inf , np . inf , is_valid = False ) elif x . start <= 0 : return interval ( - np . inf , np . inf , is_valid = None ) return interval ( np . log ( x . start ) , np . log ( x . end ) ) else : raise NotImplementedError