14 March 2008 04:20:09 PM NORMAL_PRB C++ version Test the routines from the NORMAL library for computing pseudorandom sequences of normally distributed numbers. TEST01 C4_NORMAL_01 computes pseudorandom complex values normally distributed in the unit circle. The initial seed is 123456789 1 1.67904 -0.472768 2 -0.56606 -0.231124 3 1.21293 0.535037 4 1.26938 1.04954 5 -1.66609 -1.86523 6 -2.24246 0.735809 7 0.0396751 -1.35074 8 0.673068 0.00777484 9 -0.275127 0.37494 10 2.164 0.1856 TEST02 C8_NORMAL_01 computes pseudorandom complex values normally distributed in the unit circle. The initial seed is 123456789 1 1.67904 -0.472769 2 -0.56606 -0.231124 3 1.21293 0.535037 4 1.26938 1.04954 5 -1.66609 -1.86523 6 -2.24246 0.735809 7 0.0396749 -1.35074 8 0.673068 0.00777484 9 -0.275127 0.37494 10 2.164 0.1856 TEST03 I4_NORMAL computes pseudonormal integer values with mean A and standard deviation B. The mean A = 70 The standard deviation B = 10 The initial seed is 123456789 1 87 2 65 3 64 4 68 5 82 6 75 7 83 8 80 9 53 10 51 TEST04 I8_NORMAL computes pseudonormal integer values with mean A and standard deviation B. The mean A = 70 The standard deviation B = 10 The initial seed is 12345678987654321 1 78 2 72 3 50 4 85 5 59 6 63 7 78 8 64 9 75 10 69 TEST05 R4_NORMAL computes pseudonormal values with mean A and standard deviation B. The mean A = 10 The standard deviation B = 2 The initial seed is 123456789 1 13.3581 2 9.05446 3 8.86788 4 9.53775 5 12.4259 6 11.0701 7 12.5388 8 12.0991 9 6.66783 10 6.26954 TEST06 R4_NORMAL_01 computes pseudonormal values with mean 0 and standard deviation 1. The initial seed is 123456789 1 1.67904 2 -0.472769 3 -0.56606 4 -0.231124 5 1.21293 6 0.535037 7 1.26938 8 1.04954 9 -1.66609 10 -1.86523 TEST07 R8_NORMAL computes pseudonormal values with mean A and standard deviation B. The mean A = 10 The standard deviation B = 2 The initial seed is 123456789 1 13.3581 2 9.05446 3 10.2864 4 9.47529 5 8.86788 6 9.53775 7 8.14893 8 11.0899 9 12.4259 10 11.0701 TEST08 R8_NORMAL_01 computes pseudonormal values with mean 0 and standard deviation 1. The initial seed is 123456789 1 1.67904 2 -0.472769 3 0.143179 4 -0.262355 5 -0.56606 6 -0.231124 7 -0.925536 8 0.544953 9 1.21293 10 0.535037 TEST09 R8_NORMAL_01 computes pseudonormal values with mean 0 and standard deviation 1. Verify that we can change the seed and get the desired results. The initial seed is 123456789 I Seed(in) Seed(out) R8_NORMAL_01 1 123456789 2053676357 1.67904 2 2053676357 469049721 -0.472769 3 469049721 1781357515 0.143179 4 1781357515 2053676357 -0.262355 5 2053676357 1206231778 -0.56606 Resetting seed to repeat, after an ODD number of steps. 6 123456789 2053676357 1.67904 7 2053676357 469049721 -0.472769 8 469049721 1781357515 0.143179 9 1781357515 2053676357 -0.262355 10 2053676357 1206231778 -0.56606 Resetting seed to repeat, after an EVEN number of steps. 11 123456789 2053676357 1.67904 12 2053676357 469049721 -0.472769 13 469049721 1781357515 0.143179 14 1781357515 2053676357 -0.262355 15 2053676357 1206231778 -0.56606 TEST10 R8_NORMAL_01 computes a sequence of normally distributed pseudorandom numbers. Initial SEED = 12345 First 10 values: I Input Output R8_NORMAL_01 SEED SEED 1 12345 1790989824 1.08874 2 1790989824 207482415 -1.86779 3 207482415 2035175616 0.570304 4 2035175616 1790989824 -0.194448 5 1790989824 77048696 0.319471 6 77048696 2035175616 0.0732642 7 2035175616 24794531 2.57299 8 24794531 77048696 0.186985 9 77048696 109854999 2.83414 10 109854999 24794531 0.943666 Now call R8_NORMAL_01 1000 times. Average value = 0.0113276 Expecting 0 Variance = 1.02406 Expecting 1 TEST11 R8_NORMAL_01 computes pseudorandom normal values one at a time. R8MAT_NORMAL_01 computes a matrix of values. For the same initial seed, the results should be identical, but R8MAT_NORMAL_01 might be faster. Initial seed is 123456789 I J A[I,J] B[I,J] (R8_NORMAL_01) (R8MAT_NORMAL_01) 0 0 1.67904 1.67904 9 0 0.535037 -1.86523 19 1 -0.503402 -0.275993 29 2 -2.04721 0.620309 39 3 -0.457185 -0.384676 49 4 0.119926 -2.8698 59 5 0.717468 0.971005 69 6 -0.342645 -0.287301 79 7 0.691355 -1.90593 89 8 -1.19295 -0.827487 99 9 -0.121009 -1.10849 TEST12 R8_NORMAL_01 computes pseudeorandom normal values one at a time. R8VEC_NORMAL_01 computes a vector of values. For the same initial seed, the results should be identical, but R8VEC_NORMAL_01 might be faster. Initial seed is 123456789 I A[I] B[I] (R8_NORMAL_01) (R8VEC_NORMAL_01) 1 -0.472769 -0.472769 2 0.143179 -0.56606 3 -0.262355 -0.231124 4 -0.56606 1.21293 5 -0.231124 0.535037 6 -0.925536 1.26938 7 0.544953 1.04954 8 1.21293 -1.66609 9 0.535037 -1.86523 NORMAL_PRB Normal end of execution. 14 March 2008 04:20:09 PM