def grad_grad_op(x): return -nd.cos(x)
def check_cos(): x = create_input_for_trigonometric_ops([0, np.pi/4, np.pi/2, 3*np.pi/4, np.pi]) y = nd.cos(x) # expected ouput for indices=(0, 1, -3, -2, -1) after applying cos() expected_output = [1, .707, 0, -.707, -1] assert_correctness_of_trigonometric_ops(y, expected_output)
def cos(x): return nd.cos(x)
def grad_op(x): return 1 / nd.cos(x)**2