Ejemplo n.º 1
0
 def test_tan(self):
     lbs = np.linspace(-2 * math.pi, 2 * math.pi, 10)
     ubs = np.linspace(-2 * math.pi, 2 * math.pi, 10)
     for xl in lbs:
         for xu in ubs:
             if xu >= xl:
                 zl, zu = interval.tan(xl, xu)
                 x = np.linspace(xl, xu, 100)
                 _z = np.tan(x)
                 self.assertTrue(np.all(zl <= _z))
                 self.assertTrue(np.all(zu >= _z))
Ejemplo n.º 2
0
 def test_tan(self):
     if not numpy_available:
         raise unittest.SkipTest('Numpy is not available.')
     lbs = np.linspace(-2 * math.pi, 2 * math.pi, 10)
     ubs = np.linspace(-2 * math.pi, 2 * math.pi, 10)
     for xl in lbs:
         for xu in ubs:
             if xu >= xl:
                 zl, zu = self.tan(xl, xu)
                 x = np.linspace(xl, xu, 100)
                 _z = np.tan(x)
                 self.assertTrue(np.all(zl <= _z + 1e-14))
                 self.assertTrue(np.all(zu >= _z - 1e-14))