03 March 2022 05:22:41 PM LATTICE_RULE_TEST C++ version Test the LATTICE_RULE library. TEST01 FIBONACCI_LATTICE_Q applies a Fibonacci lattice rule to integrate a function over the unit square. These Fibonacci rules are only available in 2D. The spatial dimension DIM_NUM = 2 K M EXACT ESTIMATE ERROR 3 2 1 0.446909 0.553091 4 3 1 0.579554 0.420446 5 5 1 0.762059 0.237941 6 8 1 0.830249 0.169751 7 13 1 0.904672 0.0953279 8 21 1 0.933352 0.0666477 9 34 1 0.9628 0.0371998 10 55 1 0.974212 0.0257882 11 89 1 0.985652 0.0143481 12 144 1 0.990092 0.0099083 13 233 1 0.994496 0.00550447 14 377 1 0.996205 0.00379454 15 610 1 0.997893 0.00210657 16 987 1 0.998549 0.00145104 17 1597 1 0.999195 0.000805312 18 2584 1 0.999445 0.00055452 TEST02 FIBONACCI_LATTICE_T applies a symmetric Fibonacci lattice rule to integrate a function over the unit square. These Fibonacci rules are only available in 2D. The spatial dimension DIM_NUM = 2 K M EXACT ESTIMATE ERROR 3 2 1 1.09399 0.0939878 4 3 1 1.01094 0.0109399 5 5 1 1.02089 0.0208908 6 8 1 0.992019 0.00798091 7 13 1 1.00422 0.00422278 8 21 1 0.994979 0.00502114 9 34 1 1.00086 0.000863659 10 55 1 0.997742 0.00225808 11 89 1 1.00019 0.000193024 12 144 1 0.999079 0.000921086 13 233 1 1.00005 4.98543e-05 14 377 1 0.999638 0.000361757 15 610 1 1.00001 1.49971e-05 16 987 1 0.99986 0.000139836 17 1597 1 1.00001 5.05663e-06 18 2584 1 0.999946 5.36849e-05 TEST03 FIBONACCI_LATTICE_B applies an optimal Fibonacci lattice rule to integrate a function over the unit square. These Fibonacci rules are only available in 2D. The spatial dimension DIM_NUM = 2 K M EXACT ESTIMATE ERROR 3 2 1 1.09399 0.0939878 4 3 1 1.05524 0.0552401 5 5 1 1.02089 0.0208908 6 8 1 1.01071 0.0107082 7 13 1 1.00422 0.00422278 8 21 1 1.00221 0.00221155 9 34 1 1.00086 0.000863659 10 55 1 1.00051 0.000509764 11 89 1 1.00019 0.000193024 12 144 1 1.00014 0.000136427 13 233 1 1.00005 4.98543e-05 14 377 1 1.00004 4.21938e-05 15 610 1 1.00001 1.49971e-05 16 987 1 1.00001 1.44605e-05 17 1597 1 1.00001 5.05663e-06 18 2584 1 1.00001 5.25106e-06 TEST04 FIBONACCI_LATTICE_Q1 applies a Fibonacci lattice rule to integrate a function over the unit square. A nonlinear coordinate transformation is applied. These Fibonacci rules are only available in 2D. The spatial dimension DIM_NUM = 2 K M EXACT ESTIMATE ERROR 3 2 1 1.00554 0.00554444 4 3 1 0.999689 0.000310931 5 5 1 1.11043 0.110427 6 8 1 1.06238 0.0623753 7 13 1 1.03349 0.033491 8 21 1 1.0159 0.0159043 9 34 1 1.00731 0.00731387 10 55 1 1.00325 0.00324817 11 89 1 1.00142 0.00141798 12 144 1 1.00061 0.000608286 13 233 1 1.00026 0.000258045 14 377 1 1.00011 0.000108318 15 610 1 1.00005 4.51136e-05 16 987 1 1.00002 1.86566e-05 17 1597 1 1.00001 7.67122e-06 18 2584 1 1 3.13811e-06 TEST05 FIBONACCI_LATTICE_Q2 applies a Fibonacci lattice rule to integrate a function over the unit square. A nonlinear coordinate transformation is applied. These Fibonacci rules are only available in 2D. The spatial dimension DIM_NUM = 2 K M EXACT ESTIMATE ERROR 3 2 1 1.57116 0.571163 4 3 1 1.20225 0.20225 5 5 1 1.10458 0.104584 6 8 1 1.04774 0.0477413 7 13 1 1.00202 0.00202303 8 21 1 1.0013 0.00129708 9 34 1 1.00005 4.83588e-05 10 55 1 1.00006 6.14769e-05 11 89 1 1 3.05639e-07 12 144 1 1 3.02501e-06 13 233 1 1 4.99047e-08 14 377 1 1 1.57733e-07 15 610 1 1 4.52813e-09 16 987 1 1 8.51184e-09 17 1597 1 1 2.96412e-10 18 2584 1 1 4.67419e-10 TEST06 FIBONACCI_LATTICE_Q3 applies a Fibonacci lattice rule to integrate a function over the unit square. A nonlinear coordinate transformation is applied. These Fibonacci rules are only available in 2D. The spatial dimension DIM_NUM = 2 K M EXACT ESTIMATE ERROR 3 2 1 1.78763 0.787635 4 3 1 1.222 0.222003 5 5 1 1.05016 0.0501625 6 8 1 1.03126 0.0312567 7 13 1 0.997689 0.00231113 8 21 1 1.00083 0.000829408 9 34 1 0.999971 2.88462e-05 10 55 1 1.00005 4.67284e-05 11 89 1 0.999998 1.58749e-06 12 144 1 1 2.60249e-06 13 233 1 1 8.83358e-08 14 377 1 1 1.45038e-07 15 610 1 1 4.92139e-09 16 987 1 1 8.08287e-09 17 1597 1 1 2.74246e-10 18 2584 1 1 4.50447e-10 TEST07 LATTICE applies a lattice rule to integrate a function over the unit hypercube. The spatial dimension DIM_NUM = 2 The lattice rule order M will vary. The lattice generator vector: 0: 1 1: 2 I M EXACT ESTIMATE ERROR 1 5 1 0.760192 0.239808 2 13 1 0.957115 0.0428847 3 23 1 1.01607 0.0160743 4 37 1 1.04595 0.0459544 5 47 1 1.05654 0.0565361 6 61 1 1.06558 0.0655778 7 73 1 1.07059 0.0705896 8 89 1 1.07518 0.0751833 9 103 1 1.07804 0.0780386 10 113 1 1.07965 0.0796471 TEST08 LATTICE applies a lattice rule to integrate a function over the unit hypercube. The spatial dimension DIM_NUM = 2 The lattice rule order M will vary. The lattice generator vector Z will vary. The lattice generator vector: 0: 1 1: 21883 M Z[0] Z[1] EXACT ESTIMATE ERROR 53 1 1 1 1.1607 0.160699 53 1 2 1 1.06099 0.0609896 53 1 3 1 1.03092 0.0309236 53 1 4 1 1.00703 0.00703413 53 1 5 1 1.00299 0.00299381 53 1 6 1 1.00896 0.00896221 53 1 7 1 0.989136 0.0108644 53 1 8 1 0.991666 0.00833431 53 1 9 1 1.00945 0.0094475 53 1 10 1 0.984278 0.0157219 53 1 11 1 0.992941 0.0070591 53 1 12 1 0.982027 0.0179725 53 1 13 1 0.943609 0.0563906 53 1 14 1 0.988858 0.0111416 53 1 15 1 0.961547 0.0384529 53 1 16 1 0.984685 0.0153147 53 1 17 1 0.956489 0.0435115 53 1 18 1 1.03318 0.0331807 53 1 19 1 0.989046 0.0109543 53 1 20 1 0.992422 0.00757817 53 1 21 1 0.947847 0.0521529 53 1 22 1 0.969229 0.0307712 53 1 23 1 0.97592 0.0240803 53 1 24 1 0.958501 0.0414988 53 1 25 1 0.956891 0.0431092 53 1 26 1 0.89287 0.10713 53 1 27 1 1.0642 0.0641986 53 1 28 1 0.995337 0.00466262 53 1 29 1 0.993437 0.00656303 53 1 30 1 0.975887 0.0241134 53 1 31 1 0.982584 0.0174158 53 1 32 1 1.00463 0.00462986 53 1 33 1 0.959544 0.0404558 53 1 34 1 0.962793 0.0372071 53 1 35 1 0.920861 0.0791392 53 1 36 1 0.995744 0.00425606 53 1 37 1 0.967209 0.0327913 53 1 38 1 0.990532 0.00946764 53 1 39 1 0.962977 0.0370226 53 1 40 1 1.0094 0.00939616 53 1 41 1 0.969779 0.0302209 53 1 42 1 0.958991 0.0410092 53 1 43 1 0.967607 0.0323934 53 1 44 1 0.94291 0.0570902 53 1 45 1 0.96028 0.0397201 53 1 46 1 0.962918 0.0370819 53 1 47 1 0.94337 0.05663 53 1 48 1 0.949423 0.0505766 53 1 49 1 0.945882 0.0541178 53 1 50 1 0.922956 0.0770436 53 1 51 1 0.895767 0.104233 53 1 52 1 0.811426 0.188574 TEST085 LATTICE is a lattice rule for periodic functions. However, we apply it to a nonperiodic function just to see how it does. The spatial dimension DIM_NUM = 2 The lattice generator vector: 0: 1 1: 2 I M EXACT ESTIMATE ERROR 3 2 1 0 1 4 3 1 0.579554 0.420446 5 5 1 0.760192 0.239808 6 8 1 0.745448 0.254552 7 13 1 0.957115 0.0428847 8 21 1 1.00865 0.00864501 9 34 1 1.00852 0.00852307 10 55 1 1.06226 0.0622605 11 89 1 1.07518 0.0751833 12 144 1 1.07529 0.0752881 13 233 1 1.08821 0.0882067 14 377 1 1.0913 0.0912964 15 610 1 1.09133 0.0913296 16 987 1 1.09439 0.0943919 17 1597 1 1.09512 0.0951235 18 2584 1 1.09513 0.0951318 TEST09 LATTICE_NP0 applies a lattice rule to a nonperiodic function by reflecting the function about the midpoint and averaging. The spatial dimension DIM_NUM = 2 The lattice generator vector: 0: 1 1: 2 I M EXACT ESTIMATE ERROR 3 2 1 1.22092 0.220921 4 3 1 1.04886 0.048856 5 5 1 1.01996 0.0199573 6 8 1 1.01748 0.0174785 7 13 1 1.00525 0.00525303 8 21 1 1.00364 0.00364257 9 34 1 1.00347 0.00346517 10 55 1 1.00278 0.00278489 11 89 1 1.00269 0.0026943 12 144 1 1.00268 0.00268443 13 233 1 1.00265 0.00264648 14 377 1 1.00264 0.00264143 15 610 1 1.00264 0.00264088 16 987 1 1.00264 0.00263877 17 1597 1 1.00264 0.00263849 18 2584 1 1.00264 0.00263846 TEST10 LATTICE_NP1 applies a lattice rule to a nonperiodic function using a nonlinear transformation to integrate a function over the unit square. The spatial dimension DIM_NUM = 2 The lattice generator vector: 0: 1 1: 2 I M EXACT ESTIMATE ERROR 3 2 1 0 1 4 3 1 0.999689 0.000310931 5 5 1 1.10189 0.101893 6 8 1 0.997195 0.00280458 7 13 1 1.06404 0.0640378 8 21 1 1.05789 0.057889 9 34 1 1.05102 0.051019 10 55 1 1.05457 0.054574 11 89 1 1.05422 0.0542226 12 144 1 1.05384 0.0538392 13 233 1 1.05404 0.054037 14 377 1 1.05402 0.0540174 15 610 1 1.054 0.0539961 16 987 1 1.05401 0.0540071 17 1597 1 1.05401 0.054006 18 2584 1 1.054 0.0540048 TEST11 MONTE_CARLO applies a Monte Carlo scheme to estimate the integral of a function over the unit hypercube. The spatial dimension DIM_NUM = 2 K M EXACT ESTIMATE ERROR 2 100 1 1.01158 0.0115816 3 1000 1 0.971705 0.0282953 4 10000 1 0.994275 0.00572549 5 100000 1 0.997617 0.00238339 TEST12 LATTICE_PRINT prints out the lattice generated by a single generator vector. The spatial dimension DIM_NUM = 2 The generator vector: 0: 1 1: 3 The total lattice: 1 0 0 2 1 3 3 2 6 4 3 1 5 4 4 6 5 7 7 6 2 8 7 5 TEST13 FIND_Z20 finds the optimal lattice generator Z with Fourier coefficient smoothness ALPHA = 2, ' and copy exponent 0, for a rank 1 "method of good lattice points" rule. The spatial dimension DIM_NUM = 2 M Z(1) Z(2) (M = Fibonacci) 2 1 1 3 1 1 5 1 2 8 1 3 13 1 5 21 1 8 34 1 10 55 1 21 (M = 2**K) 4 1 2 8 1 3 16 1 6 32 1 14 64 1 27 128 1 54 256 1 94 512 1 198 1024 1 298 (M = 3*2**K) 6 1 2 12 1 5 24 1 10 48 1 14 96 1 22 192 1 73 384 1 146 768 1 225 1536 1 674 3072 1 849 (M = Prime) 113 1 35 173 1 64 229 1 94 281 1 109 349 1 135 409 1 169 463 1 179 541 1 200 TEST14 FIBONACCI_LATTICE_Q_NODES... The spatial dimension DIM_NUM = 2 The Fibonacci index K = 12 The Fibonacci value M = 144 The Fibonacci lattice nodes: Row: 0 1 Col 0: 0 0 1: 0.00694444 0.618056 2: 0.0138889 0.236111 3: 0.0208333 0.854167 4: 0.0277778 0.472222 5: 0.0347222 0.0902778 6: 0.0416667 0.708333 7: 0.0486111 0.326389 8: 0.0555556 0.944444 9: 0.0625 0.5625 10: 0.0694444 0.180556 11: 0.0763889 0.798611 12: 0.0833333 0.416667 13: 0.0902778 0.0347222 14: 0.0972222 0.652778 15: 0.104167 0.270833 16: 0.111111 0.888889 17: 0.118056 0.506944 18: 0.125 0.125 19: 0.131944 0.743056 20: 0.138889 0.361111 21: 0.145833 0.979167 22: 0.152778 0.597222 23: 0.159722 0.215278 24: 0.166667 0.833333 25: 0.173611 0.451389 26: 0.180556 0.0694444 27: 0.1875 0.6875 28: 0.194444 0.305556 29: 0.201389 0.923611 30: 0.208333 0.541667 31: 0.215278 0.159722 32: 0.222222 0.777778 33: 0.229167 0.395833 34: 0.236111 0.0138889 35: 0.243056 0.631944 36: 0.25 0.25 37: 0.256944 0.868056 38: 0.263889 0.486111 39: 0.270833 0.104167 40: 0.277778 0.722222 41: 0.284722 0.340278 42: 0.291667 0.958333 43: 0.298611 0.576389 44: 0.305556 0.194444 45: 0.3125 0.8125 46: 0.319444 0.430556 47: 0.326389 0.0486111 48: 0.333333 0.666667 49: 0.340278 0.284722 50: 0.347222 0.902778 51: 0.354167 0.520833 52: 0.361111 0.138889 53: 0.368056 0.756944 54: 0.375 0.375 55: 0.381944 0.993056 56: 0.388889 0.611111 57: 0.395833 0.229167 58: 0.402778 0.847222 59: 0.409722 0.465278 60: 0.416667 0.0833333 61: 0.423611 0.701389 62: 0.430556 0.319444 63: 0.4375 0.9375 64: 0.444444 0.555556 65: 0.451389 0.173611 66: 0.458333 0.791667 67: 0.465278 0.409722 68: 0.472222 0.0277778 69: 0.479167 0.645833 70: 0.486111 0.263889 71: 0.493056 0.881944 72: 0.5 0.5 73: 0.506944 0.118056 74: 0.513889 0.736111 75: 0.520833 0.354167 76: 0.527778 0.972222 77: 0.534722 0.590278 78: 0.541667 0.208333 79: 0.548611 0.826389 80: 0.555556 0.444444 81: 0.5625 0.0625 82: 0.569444 0.680556 83: 0.576389 0.298611 84: 0.583333 0.916667 85: 0.590278 0.534722 86: 0.597222 0.152778 87: 0.604167 0.770833 88: 0.611111 0.388889 89: 0.618056 0.00694444 90: 0.625 0.625 91: 0.631944 0.243056 92: 0.638889 0.861111 93: 0.645833 0.479167 94: 0.652778 0.0972222 95: 0.659722 0.715278 96: 0.666667 0.333333 97: 0.673611 0.951389 98: 0.680556 0.569444 99: 0.6875 0.1875 100: 0.694444 0.805556 101: 0.701389 0.423611 102: 0.708333 0.0416667 103: 0.715278 0.659722 104: 0.722222 0.277778 105: 0.729167 0.895833 106: 0.736111 0.513889 107: 0.743056 0.131944 108: 0.75 0.75 109: 0.756944 0.368056 110: 0.763889 0.986111 111: 0.770833 0.604167 112: 0.777778 0.222222 113: 0.784722 0.840278 114: 0.791667 0.458333 115: 0.798611 0.0763889 116: 0.805556 0.694444 117: 0.8125 0.3125 118: 0.819444 0.930556 119: 0.826389 0.548611 120: 0.833333 0.166667 121: 0.840278 0.784722 122: 0.847222 0.402778 123: 0.854167 0.0208333 124: 0.861111 0.638889 125: 0.868056 0.256944 126: 0.875 0.875 127: 0.881944 0.493056 128: 0.888889 0.111111 129: 0.895833 0.729167 130: 0.902778 0.347222 131: 0.909722 0.965278 132: 0.916667 0.583333 133: 0.923611 0.201389 134: 0.930556 0.819444 135: 0.9375 0.4375 136: 0.944444 0.0555556 137: 0.951389 0.673611 138: 0.958333 0.291667 139: 0.965278 0.909722 140: 0.972222 0.527778 141: 0.979167 0.145833 142: 0.986111 0.763889 143: 0.993056 0.381944 LATTICE_RULE_TEST Normal end of execution. 03 March 2022 05:22:41 PM