コード例 #1
0
 def test_Div(self):
     """
     f = x/x
     f' = 0
     """
     expected = [(1, 0) for x in pos_rng]
     t = ts.Timer(foo_pos, count=len(pos_rng), use_dual=True)
     out = ts.Div(t, t)
     assert ts.run(out) == expected
コード例 #2
0
 def test_Arccos(self):
     t = ts.Timer(foo, count=2)
     c = ts.Const(value=3)
     out = ts.Arccos(ts.Div(t, c))
     assert ts.run(out) == [math.acos(1 / 3), math.acos(2 / 3)]
コード例 #3
0
 def test_Div(self):
     t = ts.Timer(foo, count=2)
     out = ts.Div(t, t)
     assert ts.run(out) == [1, 1]
コード例 #4
0
 def test_Arcsin(self):
     t = ts.Timer(func, count=2)
     c = ts.Const(value=3)
     out = ts.Arcsin(ts.Div(t, c))
     assert ts.run(out) == [math.asin(1 / 3), math.asin(2 / 3)]