Lines Matching +full:- +full:- +full:bins
4 * Use of this source code is governed by a BSD-style license that can be
18 // Min and max Anderson-Darling values allowable for k=32 in anderson_darling_test()
19 const double kADMin32 = 0.202; // p-value of ~0.1 in anderson_darling_test()
20 const double kADMax32 = 3.89; // p-value of ~0.99 in anderson_darling_test()
25 // and compute Anderson-Darling statistic to ensure these are uniform in anderson_darling_test()
28 double v = p[k]*(1.0 - p[31-k]); in anderson_darling_test()
29 if (v < 1.0e-30) { in anderson_darling_test()
30 v = 1.0e-30; in anderson_darling_test()
32 s += (2.0*(k+1)-1.0)*log(v); in anderson_darling_test()
34 double a2 = -32.0 - 0.03125*s; in anderson_darling_test()
39 static bool chi_square_test(int bins[256], int e) { in chi_square_test()
44 // compute chi-square in chi_square_test()
47 double delta = bins[j] - e; in chi_square_test()
57 double t = ((-0.0004406*z*z* + 0.0418198)*z*z + 0.9)*z; in normal_cdf()
58 t *= -1.77245385091; // -sqrt(PI) in normal_cdf()
65 int bins[256]; in test_random_byte() local
66 memset(bins, 0, sizeof(int)*256); in test_random_byte()
70 bins[(rand.nextU() >> shift) & 0xff]++; in test_random_byte()
73 REPORTER_ASSERT(reporter, chi_square_test(bins, 10000)); in test_random_byte()
77 int bins[256]; in test_random_float() local
78 memset(bins, 0, sizeof(int)*256); in test_random_float()
84 bins[(int)(f*256.f)]++; in test_random_float()
86 REPORTER_ASSERT(reporter, chi_square_test(bins, 10000)); in test_random_float()
102 // creating a z-score (# of deviations from the mean) for one iteration of this step
117 // pre-seed our string value in test_single_gorilla()
119 for (int i = 0; i < kWordWidth-1; ++i) { in test_single_gorilla()
131 int index = value & (kNumEntries-1); in test_single_gorilla()
133 int entry_shift = (value >> (kWordWidth-5)) & 0x1f; in test_single_gorilla()
147 // convert counts to normal distribution z-score in test_single_gorilla()
148 double z = ((kN-total)-kMean)/kStandardDeviation; in test_single_gorilla()
174 int bins[256]; in test_range() local
175 memset(bins, 0, sizeof(int)*256); in test_range()
179 bins[u - 17]++; in test_range()
182 REPORTER_ASSERT(reporter, chi_square_test(bins, 10000)); in test_range()
186 // check uniform distributions of each byte in 32-bit word in DEF_TEST()