def test_tan_illegal_arg(): with pytest.raises(AttributeError): assert ef.tan("thirty")
def test_tan_numeric_value(): assert np.isclose(ef.tan(4), np.tan(4))
def test_tan_no_sec_derivative_xy(): x = AutoDiff(4, "x") y = AutoDiff(5, "y") with pytest.raises(AttributeError): assert ef.tan(x * y).der2['xy']
def test_tan_numeric_input_no_deriv(): with pytest.raises(AttributeError): assert ef.tan(4).der
def test_tan_deriv2_xy(): x = AutoDiff(4, "x", H=True) y = AutoDiff(5, "y", H=True) f = ef.tan(x * x * y * y) assert np.isclose(f.der2['xy'], 376002.08725162304)
def test_tan_no_sec_derivative(): x = AutoDiff(4, "x") with pytest.raises(AttributeError): assert ef.tan(x).der2['x']
def test_tan_deriv2_y(): x = AutoDiff(4, "x", H=True) y = AutoDiff(5, "y", H=True) f = ef.tan(x * x * y * y) assert np.isclose(f.der2['y'], 300685.7009832602)
def test_tan_deriv2_x(): x = AutoDiff(4, "x", H=True) y = AutoDiff(5, "y", H=True) f = ef.tan(x * x * y * y) assert np.isclose(f.der2['x'], 469821.40778634406)
def test_tan_deriv_y(): x = AutoDiff(4, "x") y = AutoDiff(5, "y") f = ef.tan(x * x * y * y) assert np.isclose(f.der['y'], 579.8440901912758)
def test_tan_deriv_x(): x = AutoDiff(4, "x") y = AutoDiff(5, "y") f = ef.tan(x * x * y * y) assert np.isclose(f.der['x'], 724.8051127390946)
def test_tan_val(): x = AutoDiff(4, "x") y = AutoDiff(5, "y") f = ef.tan(x * x * y * y) assert np.isclose(f.val, 1.619884429116927)