def test_cos_deriv_y():
    x = AutoDiff(4, "x")
    y = AutoDiff(5, "y")
    f = ef.cos(x * y)
    assert np.isclose(f.der['y'], -3.6517810029105107)
def test_cos_val():
    x = AutoDiff(4, "x")
    y = AutoDiff(5, "y")
    f = ef.cos(x * y)
    assert np.isclose(f.val, 0.40808206181339196)
def test_cos_deriv_x():
    x = AutoDiff(4, "x")
    y = AutoDiff(5, "y")
    f = ef.cos(x * y)
    assert np.isclose(f.der['x'], -4.564726253638138)
def test_cos_illegal_arg():
    with pytest.raises(AttributeError):
        assert ef.cos("thirty")
def test_cos_numeric_value():
    assert np.isclose(ef.cos(4), np.cos(4))
def test_cos_numeric_input_no_deriv():
    with pytest.raises(AttributeError):
        assert ef.cos(4).der
def test_cos_no_sec_derivative_xy():
    x = AutoDiff(4, "x")
    y = AutoDiff(5, "y")
    with pytest.raises(AttributeError):
        assert ef.cos(x).der2['x']
def test_cos_deriv2_xy():
    x = AutoDiff(4, "x", H=True)
    y = AutoDiff(5, "y", H=True)
    f = ef.cos(x * y)
    assert np.isclose(f.der2['xy'], -9.074586486995466)
def test_cos_deriv2_y():
    x = AutoDiff(4, "x", H=True)
    y = AutoDiff(5, "y", H=True)
    f = ef.cos(x * y)
    assert np.isclose(f.der2['y'], -6.529312989014271)
def test_cos_deriv2_x():
    x = AutoDiff(4, "x", H=True)
    y = AutoDiff(5, "y", H=True)
    f = ef.cos(x * y)
    assert np.isclose(f.der2['x'], -10.202051545334799)