def exp(x):
 np = import_module('numpy')
 if isinstance(x, (int, float)):
  return interval(np.exp(x), np.exp(x))
 elif isinstance(x, interval):
  return interval(np.exp(x.start), np.exp(x.end), is_valid=x.is_valid)
 else:
  raise NotImplementedError

def exp ( x ) : np = import_module ( 'numpy' ) if isinstance ( x , ( int , float ) ) : return interval ( np . exp ( x ) , np . exp ( x ) ) elif isinstance ( x , interval ) : return interval ( np . exp ( x . start ) , np . exp ( x . end ) , is_valid = x . is_valid ) else : raise NotImplementedError
apply the exponential function to each element of the matrix mat .