8000 TEST: improving test coverage for sin/cos for input > 117435.992f · numpy/numpy@6f34f5f · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f34f5f

Browse files
author
Raghuveer Devulapalli
committed
TEST: improving test coverage for sin/cos for input > 117435.992f
1 parent 44d14ab commit 6f34f5f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

numpy/core/tests/test_umath.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,12 @@ def test_log_float32(self):
710710

711711
def test_sincos_float32(self):
712712
np.random.seed(42)
713-
x_f32 = np.float32(np.random.uniform(low=-100.,high=100.,size=1000000))
713+
N = 1000000
714+
M = np.int(N/20)
715+
index = np.random.randint(low=0, high=N, size=M)
716+
x_f32 = np.float32(np.random.uniform(low=-100.,high=100.,size=N))
717+
# test coverage for elements > 117435.992f for which glibc is used
718+
x_f32[index] = np.float32(10E+10*np.random.rand(M))
714719
x_f64 = np.float64(x_f32)
715720
assert_array_max_ulp(np.sin(x_f32), np.float32(np.sin(x_f64)), maxulp=2)
716721
assert_array_max_ulp(np.cos(x_f32), np.float32(np.cos(x_f64)), maxulp=2)

0 commit comments

Comments
 (0)
0