def test_composition_val(): value = np.pi / 6 x = Variable('x', value) c = cos(x) s = sin(x) t = tan(x) e = exp(x) f = c * t + e g = c + s assert isinstance(f, Trace) assert f._val == np.cos(value) * np.tan(value) + np.exp(value)
def f(v): return [v[0] + v[1], v[1] - v[2], cos(v[2]), exp(v[3]) * sin(v[2])]
def f0(x): return x**3 - 4 * x + cos(exp(-sin(tan(log(x)))))
def f10(v): return sin(v)**2 + tan(v)**2
def f5(x, y, z): return [exp(-(sin(x) - cos(y))**2), sin(-log(x)**2 + tan(z))]
def f4(v): return [v[0] + 3 * v[2]**2, v[1] - v[0], v[2] + sin(v[1])]
def f(x): return sin(x)
def trig(w, x, y, z): return sin(x) + cos(z) * y + sin(w)
def trig(x): return sin(x)