Пример #1
0
    def test_fuzz(self):
        for _ in range(100):
            len_x, len_y = random.randint(5, 200), random.randint(5, 200)
            xs = tuple(random.uniform(-100, 100) for _ in range(len_x))
            ys = tuple(random.uniform(-100, 100) for _ in range(len_y))

            slow = slow_a12(xs, ys)
            fast = rdiv.a12_fast(xs, ys)
            if slow != fast:
                print('xs =', xs)
                print('ys =', ys)
                assert_equal(slow, fast)
Пример #2
0
    def test_fuzz(self):
        for _ in range(100):
            len_x, len_y = random.randint(5, 200), random.randint(5, 200)
            xs = tuple(random.uniform(-100, 100) for _ in range(len_x))
            ys = tuple(random.uniform(-100, 100) for _ in range(len_y))

            slow = slow_a12(xs, ys)
            fast = rdiv.a12_fast(xs, ys)
            if slow != fast:
                print("xs =", xs)
                print("ys =", ys)
                assert_equal(slow, fast)
Пример #3
0
    def test_small(self):
        xs = [2, 2, 2, 2, 10]
        ys = [5, 5, 5, 5, 7]

        assert_equal(rdiv.a12_fast(xs, ys), 5 / 25)
Пример #4
0
    def test_small(self):
        xs = [2, 2, 2, 2, 10]
        ys = [5, 5, 5, 5, 7]

        assert_equal(rdiv.a12_fast(xs, ys), 5 / 25)