def floor(x): """ Floor function (round towards negative infinity) """ if isinstance(x, UncertainFunction): mcpts = np.floor(x._mcpts) return UncertainFunction(mcpts) else: return np.floor(x)
def sinh(x): """ Hyperbolic sine """ if isinstance(x, UncertainFunction): mcpts = np.sinh(x._mcpts) return UncertainFunction(mcpts) else: return np.sinh(x)
def cos(x): """ Cosine """ if isinstance(x, UncertainFunction): mcpts = np.cos(x._mcpts) return UncertainFunction(mcpts) else: return np.cos(x)
def exp(x): """ Exponential function """ if isinstance(x, UncertainFunction): mcpts = np.exp(x._mcpts) return UncertainFunction(mcpts) else: return np.exp(x)
def atanh(x): """ Inverse hyperbolic tangent """ if isinstance(x, UncertainFunction): mcpts = np.arctanh(x._mcpts) return UncertainFunction(mcpts) else: return np.arctanh(x)
def ceil(x): """ Ceiling function (round towards positive infinity) """ if isinstance(x, UncertainFunction): mcpts = np.ceil(x._mcpts) return UncertainFunction(mcpts) else: return np.ceil(x)
def acosh(x): """ Inverse hyperbolic cosine """ if isinstance(x, UncertainFunction): mcpts = np.arccosh(x._mcpts) return UncertainFunction(mcpts) else: return np.arccosh(x)
def asin(x): """ Inverse sine """ if isinstance(x, UncertainFunction): mcpts = np.arcsin(x._mcpts) return UncertainFunction(mcpts) else: return np.arcsin(x)
def tanh(x): """ Hyperbolic tangent """ if isinstance(x, UncertainFunction): mcpts = np.tanh(x._mcpts) return UncertainFunction(mcpts) else: return np.tanh(x)
def trunc(x): """ Truncate the values to the integer value without rounding """ if isinstance(x, UncertainFunction): mcpts = np.trunc(x._mcpts) return UncertainFunction(mcpts) else: return np.trunc(x)
def expm1(x): """ Calculate exp(x) - 1 """ if isinstance(x, UncertainFunction): mcpts = np.expm1(x._mcpts) return UncertainFunction(mcpts) else: return np.expm1(x)
def sqrt(x): """ Square-root function """ if isinstance(x, UncertainFunction): mcpts = np.sqrt(x._mcpts) return UncertainFunction(mcpts) else: return np.sqrt(x)
def radians(x): """ Convert degrees to radians """ if isinstance(x, UncertainFunction): mcpts = np.radians(x._mcpts) return UncertainFunction(mcpts) else: return np.radians(x)
def log1p(x): """ Natural logarithm of (1 + x) """ if isinstance(x, UncertainFunction): mcpts = np.log1p(x._mcpts) return UncertainFunction(mcpts) else: return np.log1p(x)
def log10(x): """ Base-10 logarithm """ if isinstance(x, UncertainFunction): mcpts = np.log10(x._mcpts) return UncertainFunction(mcpts) else: return np.log10(x)
def abs(x): """ Absolute value """ if isinstance(x, UncertainFunction): mcpts = np.abs(x._mcpts) return UncertainFunction(mcpts) else: return np.abs(x)
def hypot(x, y): """ Calculate the hypotenuse given two "legs" of a right triangle """ if isinstance(x, UncertainFunction) or isinstance(x, UncertainFunction): ufx = to_uncertain_func(x) ufy = to_uncertain_func(y) mcpts = np.hypot(ufx._mcpts, ufy._mcpts) return UncertainFunction(mcpts) else: return np.hypot(x, y)