14 March 2008 04:15:55 PM NORMAL_PRB Test the C NORMAL routines. TEST03 I4_NORMAL computes pseudonormal integers with mean A and standard deviation B. The mean A = 70.000000 The standard deviation B = 10.000000 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 integers with mean A and standard deviation B. The mean A = 70.000000 The standard deviation B = 10.000000 The initial seed is 123456789 1 87 2 65 3 71 4 67 5 64 6 68 7 61 8 75 9 82 10 75 TEST05 R4_NORMAL computes pseudonormal values with mean A and standard deviation B. The mean A = 10.000000 The standard deviation B = 2.000000 The initial seed is 123456789 1 13.358081 2 9.054463 3 8.867881 4 9.537752 5 12.425869 6 11.070074 7 12.538761 8 12.099085 9 6.667827 10 6.269544 TEST06 R4_NORMAL_01 computes pseudonormal values with mean 0 and standard deviation 1. The initial seed is 123456789 1 1.679040 2 -0.472769 3 -0.566060 4 -0.231124 5 1.212934 6 0.535037 7 1.269381 8 1.049543 9 -1.666086 10 -1.865228 TEST07 R8_NORMAL computes pseudonormal values with mean A and standard deviation B. The mean A = 10.000000 The standard deviation B = 2.000000 The initial seed is 123456789 1 13.358081 2 9.054462 3 10.286358 4 9.475290 5 8.867880 6 9.537752 7 8.148928 8 11.089906 9 12.425868 10 11.070074 TEST08 R8_NORMAL_01 computes pseudonormal values with mean 0 and standard deviation 1. The initial seed is 123456789 1 1.679040 2 -0.472769 3 0.143179 4 -0.262355 5 -0.566060 6 -0.231124 7 -0.925536 8 0.544953 9 1.212934 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.679040 2 2053676357 469049721 -0.472769 3 469049721 1781357515 0.143179 4 1781357515 2053676357 -0.262355 5 2053676357 1206231778 -0.566060 Resetting seed to repeat, after an ODD number of steps. 6 123456789 2053676357 1.679040 7 2053676357 469049721 -0.472769 8 469049721 1781357515 0.143179 9 1781357515 2053676357 -0.262355 10 2053676357 1206231778 -0.566060 Resetting seed to repeat, after an EVEN number of steps. 11 123456789 2053676357 1.679040 12 2053676357 469049721 -0.472769 13 469049721 1781357515 0.143179 14 1781357515 2053676357 -0.262355 15 2053676357 1206231778 -0.566060 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.088743 2 1790989824 207482415 -1.867793 3 207482415 2035175616 0.570304 4 2035175616 1790989824 -0.194448 5 1790989824 77048696 0.319471 6 77048696 2035175616 0.073264 7 2035175616 24794531 2.572988 8 24794531 77048696 0.186985 9 77048696 109854999 2.834141 10 109854999 24794531 0.943666 Now call R8_NORMAL_01 1000 times. Average value = 0.011328 Expecting 0.000000 Variance = 1.024058 Expecting 1.000000 TEST11 R8_NORMAL_01 computes pseudonormal 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.679040 1.679040 9 0 0.535037 -1.865228 19 1 -0.503402 -0.275993 29 2 -2.047214 0.620309 39 3 -0.457185 -0.384676 49 4 0.119926 -2.869798 59 5 0.717468 0.971005 69 6 -0.342645 -0.287301 79 7 0.691355 -1.905933 89 8 -1.192953 -0.827487 99 9 -0.121009 -1.108490 TEST12 R8_NORMAL_01 computes pseudeonormal 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.566060 3 -0.262355 -0.231124 4 -0.566060 1.212934 5 -0.231124 0.535037 6 -0.925536 1.269381 7 0.544953 1.049543 8 1.212934 -1.666087 9 0.535037 -1.865228 NORMAL_PRB Normal end of execution. 14 March 2008 04:15:55 PM