import math
[docs]
def sin(x: float) -> float:
return math.sin(x)
[docs]
def cos(x: float) -> float:
return math.cos(x)
[docs]
def tan(x: float) -> float:
return math.tan(x)
[docs]
def add(x: float, y: float) -> float:
return x + y
[docs]
def sub(x: float, y: float) -> float:
return x - y
[docs]
def mul(x: float, y: float) -> float:
return x * y
[docs]
def div(x: float, y: float) -> float:
if y == 0:
return 1
return x / y
[docs]
def avg(x: float, y: float) -> float:
return (x + y) / 2
[docs]
def lim(x: float, max_val: float, min_val: float) -> float:
return max(min(max_val, x), min_val)