27 December 2010 3:10:33.431 PM HALTON_PRB FORTRAN90 version Test the HALTON library. TEST01 HALTON computes the next element of a Halton sequence. HALTON_STEP_SET sets the step. In this test, we try several values of STEP. We repeat the test for several dimensions. We assume defaults SEED, LEAP and BASE. DIM_NUM = 1 N = 11 STEP = 0 SEED = 0 BASE = 2 STEP Halton 0 0.00000000 1 0.50000000 2 0.25000000 3 0.75000000 4 0.12500000 5 0.62500000 6 0.37500000 7 0.87500000 8 0.06250000 9 0.56250000 10 0.31250000 DIM_NUM = 1 N = 11 STEP = 5 SEED = 0 BASE = 2 STEP Halton 5 0.62500000 6 0.37500000 7 0.87500000 8 0.06250000 9 0.56250000 10 0.31250000 11 0.81250000 12 0.18750000 13 0.68750000 14 0.43750000 15 0.93750000 DIM_NUM = 1 N = 11 STEP = 1000 SEED = 0 BASE = 2 STEP Halton 1000 0.09277344 1001 0.59277344 1002 0.34277344 1003 0.84277344 1004 0.21777344 1005 0.71777344 1006 0.46777344 1007 0.96777344 1008 0.06152344 1009 0.56152344 1010 0.31152344 DIM_NUM = 1 N = 11 STEP = 1000000 SEED = 0 BASE = 2 STEP Halton 1000000 0.00883389 1000001 0.50883389 1000002 0.25883389 1000003 0.75883389 1000004 0.13383389 1000005 0.63383389 1000006 0.38383389 1000007 0.88383389 1000008 0.07133389 1000009 0.57133389 1000010 0.32133389 DIM_NUM = 2 N = 11 STEP = 0 SEED = 0 0 BASE = 2 3 STEP Halton 0 0.00000000 0.00000000 1 0.50000000 0.33333333 2 0.25000000 0.66666667 3 0.75000000 0.11111111 4 0.12500000 0.44444444 5 0.62500000 0.77777778 6 0.37500000 0.22222222 7 0.87500000 0.55555556 8 0.06250000 0.88888889 9 0.56250000 0.03703704 10 0.31250000 0.37037037 DIM_NUM = 2 N = 11 STEP = 5 SEED = 0 0 BASE = 2 3 STEP Halton 5 0.62500000 0.77777778 6 0.37500000 0.22222222 7 0.87500000 0.55555556 8 0.06250000 0.88888889 9 0.56250000 0.03703704 10 0.31250000 0.37037037 11 0.81250000 0.70370370 12 0.18750000 0.14814815 13 0.68750000 0.48148148 14 0.43750000 0.81481481 15 0.93750000 0.25925926 DIM_NUM = 2 N = 11 STEP = 1000 SEED = 0 0 BASE = 2 3 STEP Halton 1000 0.09277344 0.34750800 1001 0.59277344 0.68084134 1002 0.34277344 0.12528578 1003 0.84277344 0.45861911 1004 0.21777344 0.79195245 1005 0.71777344 0.23639689 1006 0.46777344 0.56973022 1007 0.96777344 0.90306356 1008 0.06152344 0.05121171 1009 0.56152344 0.38454504 1010 0.31152344 0.71787837 DIM_NUM = 2 N = 11 STEP = 1000000 SEED = 0 0 BASE = 2 3 STEP Halton 1000000 0.00883389 0.36106611 1000001 0.50883389 0.69439944 1000002 0.25883389 0.13884389 1000003 0.75883389 0.47217722 1000004 0.13383389 0.80551055 1000005 0.63383389 0.24995500 1000006 0.38383389 0.58328833 1000007 0.88383389 0.91662166 1000008 0.07133389 0.06476981 1000009 0.57133389 0.39810314 1000010 0.32133389 0.73143648 DIM_NUM = 3 N = 11 STEP = 0 SEED = 0 0 0 BASE = 2 3 5 STEP Halton 0 0.00000000 0.00000000 0.00000000 1 0.50000000 0.33333333 0.20000000 2 0.25000000 0.66666667 0.40000000 3 0.75000000 0.11111111 0.60000000 4 0.12500000 0.44444444 0.80000000 5 0.62500000 0.77777778 0.04000000 6 0.37500000 0.22222222 0.24000000 7 0.87500000 0.55555556 0.44000000 8 0.06250000 0.88888889 0.64000000 9 0.56250000 0.03703704 0.84000000 10 0.31250000 0.37037037 0.08000000 DIM_NUM = 3 N = 11 STEP = 5 SEED = 0 0 0 BASE = 2 3 5 STEP Halton 5 0.62500000 0.77777778 0.04000000 6 0.37500000 0.22222222 0.24000000 7 0.87500000 0.55555556 0.44000000 8 0.06250000 0.88888889 0.64000000 9 0.56250000 0.03703704 0.84000000 10 0.31250000 0.37037037 0.08000000 11 0.81250000 0.70370370 0.28000000 12 0.18750000 0.14814815 0.48000000 13 0.68750000 0.48148148 0.68000000 14 0.43750000 0.81481481 0.88000000 15 0.93750000 0.25925926 0.12000000 DIM_NUM = 3 N = 11 STEP = 1000 SEED = 0 0 0 BASE = 2 3 5 STEP Halton 1000 0.09277344 0.34750800 0.00512000 1001 0.59277344 0.68084134 0.20512000 1002 0.34277344 0.12528578 0.40512000 1003 0.84277344 0.45861911 0.60512000 1004 0.21777344 0.79195245 0.80512000 1005 0.71777344 0.23639689 0.04512000 1006 0.46777344 0.56973022 0.24512000 1007 0.96777344 0.90306356 0.44512000 1008 0.06152344 0.05121171 0.64512000 1009 0.56152344 0.38454504 0.84512000 1010 0.31152344 0.71787837 0.08512000 DIM_NUM = 3 N = 11 STEP = 1000000 SEED = 0 0 0 BASE = 2 3 5 STEP Halton 1000000 0.00883389 0.36106611 0.00005734 1000001 0.50883389 0.69439944 0.20005734 1000002 0.25883389 0.13884389 0.40005734 1000003 0.75883389 0.47217722 0.60005734 1000004 0.13383389 0.80551055 0.80005734 1000005 0.63383389 0.24995500 0.04005734 1000006 0.38383389 0.58328833 0.24005734 1000007 0.88383389 0.91662166 0.44005734 1000008 0.07133389 0.06476981 0.64005734 1000009 0.57133389 0.39810314 0.84005734 1000010 0.32133389 0.73143648 0.08005734 TEST0125 I4_TO_HALTON computes a Halton sequence. The user specifies all data explicitly. In this test, we call I4_TO_HALTON repeatedly. We use distinct primes as bases. DIM_NUM = 1 N = 11 STEP = 0 SEED = 0 LEAP = 1 BASE = 2 STEP Halton 0 0.000000 1 0.500000 2 0.250000 3 0.750000 4 0.125000 5 0.625000 6 0.375000 7 0.875000 8 0.062500 9 0.562500 10 0.312500 DIM_NUM = 2 N = 11 STEP = 0 SEED = 0 0 LEAP = 1 1 BASE = 2 3 STEP Halton 0 0.000000 0.000000 1 0.500000 0.333333 2 0.250000 0.666667 3 0.750000 0.111111 4 0.125000 0.444444 5 0.625000 0.777778 6 0.375000 0.222222 7 0.875000 0.555556 8 0.062500 0.888889 9 0.562500 0.037037 10 0.312500 0.370370 DIM_NUM = 3 N = 11 STEP = 0 SEED = 0 0 0 LEAP = 1 1 1 BASE = 2 3 5 STEP Halton 0 0.000000 0.000000 0.000000 1 0.500000 0.333333 0.200000 2 0.250000 0.666667 0.400000 3 0.750000 0.111111 0.600000 4 0.125000 0.444444 0.800000 5 0.625000 0.777778 0.040000 6 0.375000 0.222222 0.240000 7 0.875000 0.555556 0.440000 8 0.062500 0.888889 0.640000 9 0.562500 0.037037 0.840000 10 0.312500 0.370370 0.080000 TEST0126 I4_TO_HALTON computes a Halton sequence. The user specifies all data explicitly. In this test, we call I4_TO_HALTON repeatedly. We use the same value for all the bases. DIM_NUM = 3 N = 11 SEED = 0 0 0 LEAP = 1 1 1 BASE = 2 2 2 STEP Halton 0 0.000000 0.000000 0.000000 1 0.500000 0.500000 0.500000 2 0.250000 0.250000 0.250000 3 0.750000 0.750000 0.750000 4 0.125000 0.125000 0.125000 5 0.625000 0.625000 0.625000 6 0.375000 0.375000 0.375000 7 0.875000 0.875000 0.875000 8 0.062500 0.062500 0.062500 9 0.562500 0.562500 0.562500 10 0.312500 0.312500 0.312500 TEST02 HALTON_SEQUENCE computes N elements of a Halton sequence on a single call. DIM_NUM = 3 N = 10 STEP = 0 SEED = 0 0 0 STEP Halton 0 0.00000 0.00000 0.00000 1 0.500000 0.333333 0.200000 2 0.250000 0.666667 0.400000 3 0.750000 0.111111 0.600000 4 0.125000 0.444444 0.800000 5 0.625000 0.777778 0.400000E-01 6 0.375000 0.222222 0.240000 7 0.875000 0.555556 0.440000 8 0.625000E-01 0.888889 0.640000 9 0.562500 0.370370E-01 0.840000 TEST025 I4_TO_HALTON_SEQUENCE computes N elements of a Halton sequence on a single call. All arguments are specified explicitly. DIM_NUM = 3 N = 10 STEP = 0 SEED = 0 0 0 LEAP = 1 1 1 BASE = 2 3 5 STEP Halton 0 0.00000 0.00000 0.00000 1 0.500000 0.333333 0.200000 2 0.250000 0.666667 0.400000 3 0.750000 0.111111 0.600000 4 0.125000 0.444444 0.800000 5 0.625000 0.777778 0.400000E-01 6 0.375000 0.222222 0.240000 7 0.875000 0.555556 0.440000 8 0.625000E-01 0.888889 0.640000 9 0.562500 0.370370E-01 0.840000 DIM_NUM = 3 N = 10 STEP = 0 SEED = 1 2 3 LEAP = 1 1 1 BASE = 2 3 5 STEP Halton 0 0.500000 0.666667 0.600000 1 0.250000 0.111111 0.800000 2 0.750000 0.444444 0.400000E-01 3 0.125000 0.777778 0.240000 4 0.625000 0.222222 0.440000 5 0.375000 0.555556 0.640000 6 0.875000 0.888889 0.840000 7 0.625000E-01 0.370370E-01 0.800000E-01 8 0.562500 0.370370 0.280000 9 0.312500 0.703704 0.480000 DIM_NUM = 3 N = 10 STEP = 0 SEED = 1 1 1 LEAP = 3 3 3 BASE = 2 3 5 STEP Halton 0 0.500000 0.333333 0.200000 1 0.125000 0.444444 0.800000 2 0.875000 0.555556 0.440000 3 0.312500 0.370370 0.800000E-01 4 0.687500 0.481481 0.680000 5 0.312500E-01 0.592593 0.320000 6 0.781250 0.407407 0.920000 7 0.406250 0.518519 0.560000 8 0.593750 0.629630 0.800000E-02 9 0.218750 0.345679 0.608000 DIM_NUM = 3 N = 10 STEP = 0 SEED = 1 2 3 LEAP = 1 1 1 BASE = 2 2 2 STEP Halton 0 0.500000 0.250000 0.750000 1 0.250000 0.750000 0.125000 2 0.750000 0.125000 0.625000 3 0.125000 0.625000 0.375000 4 0.625000 0.375000 0.875000 5 0.375000 0.875000 0.625000E-01 6 0.875000 0.625000E-01 0.562500 7 0.625000E-01 0.562500 0.312500 8 0.562500 0.312500 0.812500 9 0.312500 0.812500 0.187500 TEST03 HALTON_STEP_SET specifies the next element of the Halton sequence to compute. In this test, we demonstrate how resetting STEP determines the next element computed. DIM_NUM = 1 N = 11 STEP = 0 SEED = 0 STEP Halton 0 0.00000 1 0.500000 2 0.250000 3 0.750000 4 0.125000 5 0.625000 6 0.375000 7 0.875000 8 0.625000E-01 9 0.562500 10 0.312500 N = 11 STEP = 6 STEP Halton 6 0.375000 7 0.875000 8 0.625000E-01 9 0.562500 10 0.312500 11 0.812500 12 0.187500 13 0.687500 14 0.437500 15 0.937500 16 0.312500E-01 N = 6 STEP = 0 STEP Halton 0 0.00000 1 0.500000 2 0.250000 3 0.750000 4 0.125000 5 0.625000 N = 5 STEP = 100 STEP Halton 100 0.148438 101 0.648438 102 0.398438 103 0.898438 104 0.859375E-01 TEST04 HALTON_BASE_GET gets the current Halton bases. HALTON_BASE_SET sets the current Halton bases. In this test, we compute a Halton sequence with the default base, then change the base, reset the seed, and recompute the sequence. DIM_NUM = 1 N = 10 STEP = 0 SEED = 0 BASE = 2 STEP Halton 0 0.00000 1 0.500000 2 0.250000 3 0.750000 4 0.125000 5 0.625000 6 0.375000 7 0.875000 8 0.625000E-01 9 0.562500 N = 10 SEED = 0 BASE = 3 STEP Halton 0 0.00000 1 0.333333 2 0.666667 3 0.111111 4 0.444444 5 0.777778 6 0.222222 7 0.555556 8 0.888889 9 0.370370E-01 N = 10 SEED = 0 BASE = 4 STEP Halton 0 0.00000 1 0.250000 2 0.500000 3 0.750000 4 0.625000E-01 5 0.312500 6 0.562500 7 0.812500 8 0.125000 9 0.375000 TEST045 HALTON_SEQUENCE computes N elements of a Halton sequence on a single call. DIM_NUM = 2 N = 101 STEP = 0 SEED = 0 0 BASE = 2 3 STEP Halton 0 0.0000 0.0000 1 0.5000 0.3333 2 0.2500 0.6667 3 0.7500 0.1111 4 0.1250 0.4444 5 0.6250 0.7778 6 0.3750 0.2222 7 0.8750 0.5556 8 0.0625 0.8889 9 0.5625 0.0370 10 0.3125 0.3704 11 0.8125 0.7037 12 0.1875 0.1481 13 0.6875 0.4815 14 0.4375 0.8148 15 0.9375 0.2593 16 0.0313 0.5926 17 0.5313 0.9259 18 0.2813 0.0741 19 0.7813 0.4074 20 0.1563 0.7407 21 0.6563 0.1852 22 0.4063 0.5185 23 0.9063 0.8519 24 0.0938 0.2963 25 0.5938 0.6296 26 0.3438 0.9630 27 0.8438 0.0123 28 0.2188 0.3457 29 0.7188 0.6790 30 0.4688 0.1235 31 0.9688 0.4568 32 0.0156 0.7901 33 0.5156 0.2346 34 0.2656 0.5679 35 0.7656 0.9012 36 0.1406 0.0494 37 0.6406 0.3827 38 0.3906 0.7160 39 0.8906 0.1605 40 0.0781 0.4938 41 0.5781 0.8272 42 0.3281 0.2716 43 0.8281 0.6049 44 0.2031 0.9383 45 0.7031 0.0864 46 0.4531 0.4198 47 0.9531 0.7531 48 0.0469 0.1975 49 0.5469 0.5309 50 0.2969 0.8642 51 0.7969 0.3086 52 0.1719 0.6420 53 0.6719 0.9753 54 0.4219 0.0247 55 0.9219 0.3580 56 0.1094 0.6914 57 0.6094 0.1358 58 0.3594 0.4691 59 0.8594 0.8025 60 0.2344 0.2469 61 0.7344 0.5802 62 0.4844 0.9136 63 0.9844 0.0617 64 0.0078 0.3951 65 0.5078 0.7284 66 0.2578 0.1728 67 0.7578 0.5062 68 0.1328 0.8395 69 0.6328 0.2840 70 0.3828 0.6173 71 0.8828 0.9506 72 0.0703 0.0988 73 0.5703 0.4321 74 0.3203 0.7654 75 0.8203 0.2099 76 0.1953 0.5432 77 0.6953 0.8765 78 0.4453 0.3210 79 0.9453 0.6543 80 0.0391 0.9877 81 0.5391 0.0041 82 0.2891 0.3374 83 0.7891 0.6708 84 0.1641 0.1152 85 0.6641 0.4486 86 0.4141 0.7819 87 0.9141 0.2263 88 0.1016 0.5597 89 0.6016 0.8930 90 0.3516 0.0412 91 0.8516 0.3745 92 0.2266 0.7078 93 0.7266 0.1523 94 0.4766 0.4856 95 0.9766 0.8189 96 0.0234 0.2634 97 0.5234 0.5967 98 0.2734 0.9300 99 0.7734 0.0782 100 0.1484 0.4115 TEST05 HALTON computes the elements of a vector Halton sequence. Each call produces the next value. By default, the bases are the first DIM_NUM primes. In this test, we call HALTON several times, with the default bases. DIM_NUM = 4 N = 11 STEP = 0 SEED = 0 0 0 0 BASE = 2 3 5 7 STEP Halton 0 0.00000 0.00000 0.00000 0.00000 1 0.500000 0.333333 0.200000 0.142857 2 0.250000 0.666667 0.400000 0.285714 3 0.750000 0.111111 0.600000 0.428571 4 0.125000 0.444444 0.800000 0.571429 5 0.625000 0.777778 0.400000E-01 0.714286 6 0.375000 0.222222 0.240000 0.857143 7 0.875000 0.555556 0.440000 0.204082E-01 8 0.625000E-01 0.888889 0.640000 0.163265 9 0.562500 0.370370E-01 0.840000 0.306122 10 0.312500 0.370370 0.800000E-01 0.448980 TEST06 HALTON_SEQUENCE computes the next N elements of a vector Halton sequence. Each call produces the next value. By default, the bases are the first DIM_NUM primes. In this test, we demonstrate how one call can compute many successive vector elements of the sequence. DIM_NUM = 4 N = 11 STEP = 0 SEED = 0 0 0 0 STEP Halton 0 0.00000 0.00000 0.00000 0.00000 1 0.500000 0.333333 0.200000 0.142857 2 0.250000 0.666667 0.400000 0.285714 3 0.750000 0.111111 0.600000 0.428571 4 0.125000 0.444444 0.800000 0.571429 5 0.625000 0.777778 0.400000E-01 0.714286 6 0.375000 0.222222 0.240000 0.857143 7 0.875000 0.555556 0.440000 0.204082E-01 8 0.625000E-01 0.888889 0.640000 0.163265 9 0.562500 0.370370E-01 0.840000 0.306122 10 0.312500 0.370370 0.800000E-01 0.448980 TEST07 HALTON_STEP_SET specifies which element of the Halton subsequence to compute. Here we show how STEP chooses the next element. DIM_NUM = 4 N = 10 STEP = 0 SEED = 0 0 0 0 STEP Halton 0 0.00000 0.00000 0.00000 0.00000 1 0.500000 0.333333 0.200000 0.142857 2 0.250000 0.666667 0.400000 0.285714 3 0.750000 0.111111 0.600000 0.428571 4 0.125000 0.444444 0.800000 0.571429 5 0.625000 0.777778 0.400000E-01 0.714286 6 0.375000 0.222222 0.240000 0.857143 7 0.875000 0.555556 0.440000 0.204082E-01 8 0.625000E-01 0.888889 0.640000 0.163265 9 0.562500 0.370370E-01 0.840000 0.306122 N = 10 STEP = 6 STEP Halton 6 0.375000 0.222222 0.240000 0.857143 7 0.875000 0.555556 0.440000 0.204082E-01 8 0.625000E-01 0.888889 0.640000 0.163265 9 0.562500 0.370370E-01 0.840000 0.306122 10 0.312500 0.370370 0.800000E-01 0.448980 11 0.812500 0.703704 0.280000 0.591837 12 0.187500 0.148148 0.480000 0.734694 13 0.687500 0.481481 0.680000 0.877551 14 0.437500 0.814815 0.880000 0.408163E-01 15 0.937500 0.259259 0.120000 0.183673 N = 6 STEP = 0 STEP Halton 0 0.00000 0.00000 0.00000 0.00000 1 0.500000 0.333333 0.200000 0.142857 2 0.250000 0.666667 0.400000 0.285714 3 0.750000 0.111111 0.600000 0.428571 4 0.125000 0.444444 0.800000 0.571429 5 0.625000 0.777778 0.400000E-01 0.714286 N = 5 STEP = 100 STEP Halton 100 0.148438 0.411523 0.320000E-01 0.291545 101 0.648438 0.744856 0.232000 0.434402 102 0.398438 0.189300 0.432000 0.577259 103 0.898438 0.522634 0.632000 0.720117 104 0.859375E-01 0.855967 0.832000 0.862974 TEST08 HALTON_BASE_GET gets the current bases. HALTON_BASE_SET sets the current bases. HALTON_SEQUENCE computes the next N elements of a vector Halton sequence. In this test, we compute the first 10 elements of the default sequence, then change bases, reset the seed and recompute the first 10 elements. DIM_NUM = 4 N = 10 STEP = 0 SEED = 0 0 0 0 BASE = 2 3 5 7 STEP Halton 0 0.00000 0.00000 0.00000 0.00000 1 0.500000 0.333333 0.200000 0.142857 2 0.250000 0.666667 0.400000 0.285714 3 0.750000 0.111111 0.600000 0.428571 4 0.125000 0.444444 0.800000 0.571429 5 0.625000 0.777778 0.400000E-01 0.714286 6 0.375000 0.222222 0.240000 0.857143 7 0.875000 0.555556 0.440000 0.204082E-01 8 0.625000E-01 0.888889 0.640000 0.163265 9 0.562500 0.370370E-01 0.840000 0.306122 N = 10 STEP = 0 BASE = 3 7 13 19 STEP Halton 0 0.00000 0.00000 0.00000 0.00000 1 0.333333 0.142857 0.769231E-01 0.526316E-01 2 0.666667 0.285714 0.153846 0.105263 3 0.111111 0.428571 0.230769 0.157895 4 0.444444 0.571429 0.307692 0.210526 5 0.777778 0.714286 0.384615 0.263158 6 0.222222 0.857143 0.461538 0.315789 7 0.555556 0.204082E-01 0.538462 0.368421 8 0.888889 0.163265 0.615385 0.421053 9 0.370370E-01 0.306122 0.692308 0.473684 TEST09 For the unit sphere in 2 dimensions (the circle): HALTON generates "U1" points, U1_TO_SPHERE_UNIT_2D samples the circle; DIM_NUM = 1 N = 5 STEP = 0 A few sample values: 1.0000 0.0000 -1.0000 0.0000 0.0000 1.0000 -0.0000 -1.0000 0.7071 0.7071 N = 1000 STEP = 0 Average the points, which should get a value close to zero, and closer as N increases. Average: -0.359712E-16 -0.222045E-17 Now choose a random direction, sample the same number of points, and compute the dot product with the direction. Take the absolute value of each dot product and sum and average. We expect a value near 2 / PI = 0.6366... Random V: 0.9885 0.1513 Average |(XdotV)| 0.6364 Random V: 0.9426 -0.3338 Average |(XdotV)| 0.6367 Random V: 0.9985 -0.0538 Average |(XdotV)| 0.6367 Random V: -0.9691 0.2467 Average |(XdotV)| 0.6367 Random V: -0.1522 -0.9884 Average |(XdotV)| 0.6367 TEST10 For the unit ball in 2 dimensions (the disk): U2_TO_BALL_UNIT_2D samples; DIM_NUM = 2 N = 5 STEP = 0 A few sample values: 0.0000 0.0000 -0.3536 0.6124 -0.2500 -0.4330 0.6634 0.5567 -0.3322 0.1209 N = 1000 STEP = 0 Average the points, which should get a value close to zero, and closer as N increases. Average: 0.588437E-03 0.106363E-03 Average the distance of the points from the center, which should be DIM_NUM/(DIM_NUM+1) = 0.6667 Average: 0.6655 Average the angle THETA, which should approach PI. Average: 3.1301 TEST11 For the unit sphere in 3 dimensions: U2_TO_SPHERE_UNIT_3D samples; DIM_NUM = 2 N = 5 STEP = 123456789 A few sample values: 0.7456 0.5857 0.3180 -0.9127 0.3659 -0.1820 0.0816 -0.5694 0.8180 0.1213 0.5780 -0.8070 -0.9324 -0.3057 0.1930 N = 1000 STEP = 0 Average the points, which should get a value close to zero, and closer as N increases. Average: 0.758100E-03 -0.260471E-04 -0.245313E-02 Now choose a random direction, sample the same number of points, and compute the dot product with the direction. Take the absolute value of each dot product and sum and average. Random V: -0.3037 -0.7706 0.5603 Average |(XdotV)| 0.5000 Random V: 0.5131 -0.7547 -0.4089 Average |(XdotV)| 0.4993 Random V: 0.8503 -0.5259 0.0206 Average |(XdotV)| 0.5000 Random V: 0.2153 0.9715 0.0996 Average |(XdotV)| 0.5001 Random V: -0.0536 0.2775 -0.9592 Average |(XdotV)| 0.4999 TEST12 For the unit ball in 3 dimensions: U3_TO_BALL_UNIT_3D samples; DIM_NUM = 3 N = 5 STEP = 0 A few sample values: 0.0000 0.0000 -0.0000 -0.2924 0.5065 0.0000 -0.3190 -0.5526 -0.3684 0.5595 0.4695 0.4217 -0.5770 0.2100 -0.6962 N = 1000 STEP = 0 Average the points, which should get a value close to zero, and closer as N increases. Average: 0.437565E-03 0.566738E-03 -0.171389E-02 Average the distance of the points from the center, which should be DIM_NUM/(DIM_NUM+1) = 0.7500 Average: 0.7487 Average the angle THETA, which should approach PI. Average: 3.1301 Average the angle PHI, which should approach PI/2. Average: 1.5714 TEST13 HALHAM_WRITE writes a Halton or Hammersley dataset to a file DIM_NUM = 3 N = 10 STEP = 0 SEED = 0 0 0 LEAP = 1 1 1 BASE = 2 3 5 STEP Halton 0 0.00000 0.00000 0.00000 1 0.500000 0.333333 0.200000 2 0.250000 0.666667 0.400000 3 0.750000 0.111111 0.600000 4 0.125000 0.444444 0.800000 5 0.625000 0.777778 0.400000E-01 6 0.375000 0.222222 0.240000 7 0.875000 0.555556 0.440000 8 0.625000E-01 0.888889 0.640000 9 0.562500 0.370370E-01 0.840000 The data was written to "halton_03_00010.txt". HALTON_PRB Normal end of execution. 27 December 2010 3:10:33.463 PM