diff --git a/compute-awc-swb-period-length.py b/compute-awc-swb-period-length.py index f742448683e70d677ea761ac79968185cdd9d653..ab9454c11c745d46311498f5b45222d4c051a54a 100644 --- a/compute-awc-swb-period-length.py +++ b/compute-awc-swb-period-length.py @@ -246,8 +246,6 @@ def main(): sys.exit(3) m = compute_modulus(b, r, s) - - #print('b=2^{:d} r={:d} s={:d}'.format(w, r, s)) key = (kind, w, r, s) ps = \ @@ -260,8 +258,6 @@ def main(): ps_awc_32_29_17 if kind=='awc' and w== 32 and r == 29 and s == 17 else \ factorize(kind, w, r, s, m-1) - #print('Found {:d} prime factors'.format(len(ps))) - assert ps is None or (m-1) % reduce(operator.mul, ps, 1) == 0 min_period, max_period = \ @@ -271,11 +267,12 @@ def main(): p2_min = math.log(min_period) / math.log(2) p2_max = math.log(max_period) / math.log(2) + floor = lambda x: int(math.floor(x)) + + msg = '{:4d} {:4d} {:3d} {:3d}' + out = msg.format(floor(p2_min),floor(p2_max),floor(p10_min),floor(p10_max)) - #print('Period length 2^{:.2f} 2^{:.2f}'.format(p2_min, p2_max)) - #print('Period length 10^{:.2f} 10^{:.2f}'.format(p10_min, p10_max)) - msg = '{:7.2f} {:7.2f} {:6.2f} {:6.2f}' - print(msg.format(p2_min, p2_max, p10_min, p10_max)) + print(out) if __name__ == '__main__': diff --git a/find-awc-swb-prngs.sh b/find-awc-swb-prngs.sh index d2cf71e3c62cbaece05b6e4aecc9168cd786dd59..a43a8e215d9e328fb7e5b3dac1e6d53f7566b66f 100644 --- a/find-awc-swb-prngs.sh +++ b/find-awc-swb-prngs.sh @@ -166,7 +166,7 @@ find_awc_swb_prngs() echo "Found \$num_generators \$type parameter combinations" - echo 'type b r s t log2period log10period' + echo 'type b r s t log2period log10period' while read gen do local b="\$(awk '{print \$2}' <<<"\$gen")"