Пример #1
0
 def test_Cos(self):
     """
     f = cos(x)
     f' = -sin(x)
     """
     expected = [(math.cos(x), -1 * math.sin(x)) for x in rng]
     t = ts.Timer(foo_range, count=len(rng), use_dual=True)
     out = ts.Cos(t)
     assert ts.run(out) == expected
Пример #2
0
 def test_Cos(self):
     t = ts.Timer(foo, count=2)
     out = ts.Cos(t)
     assert ts.run(out) == [math.cos(1), math.cos(2)]