08-Oct-2025 22:43:24 triangle_monte_carlo_test() MATLAB/Octave version 6.4.0 Test triangle_monte_carlo(). triangle_monte_carlo_test01(): Sample using triangle_unit_sample_01() Integrate triangle_unit_integrand_03() Integration region is the unit triangle. Use an increasing number of points P_NUM. Note that the sample routine is a "bad" sampler. P_NUM X^2 X*Y Y^2 1 0.113984 0.101398 0.090203 2 0.137660 0.046851 0.016873 4 0.092372 0.066827 0.053624 8 0.059586 0.058238 0.075536 16 0.091752 0.055661 0.062308 32 0.056980 0.048186 0.070518 64 0.064573 0.050037 0.087534 128 0.074835 0.043292 0.073150 256 0.065337 0.048333 0.076038 512 0.070183 0.047799 0.076570 1024 0.072107 0.047209 0.074731 2048 0.070792 0.047005 0.070737 4096 0.072060 0.047528 0.072344 8192 0.071439 0.047821 0.072293 16384 0.071867 0.047317 0.071472 32768 0.072098 0.047360 0.071622 65536 0.071803 0.047552 0.071653 triangle_monte_carlo_test02(): Sample using triangle_unit_sample_02() Integrate triangle_unit_integrand_03() Integration region is the unit triangle. Use an increasing number of points P_NUM. Note that the sample routine is a good" sampler. P_NUM X^2 X*Y Y^2 1 0.053359 0.071479 0.095753 2 0.045887 0.057562 0.074462 4 0.278916 0.048050 0.064766 8 0.086590 0.033947 0.068794 16 0.093388 0.056766 0.094300 32 0.083433 0.033639 0.055347 64 0.083797 0.042747 0.084111 128 0.076647 0.038938 0.085001 256 0.084999 0.041664 0.089779 512 0.086241 0.040301 0.081487 1024 0.085971 0.042434 0.082389 2048 0.081691 0.041642 0.082952 4096 0.085351 0.042560 0.083593 8192 0.083569 0.041406 0.082615 16384 0.084523 0.041919 0.082758 32768 0.084545 0.041690 0.082206 65536 0.083820 0.041461 0.083006 triangle_monte_carlo_test03(): Sample using triangle_unit_sample_03() Integrate triangle_unit_integrand_03() Integration region is the unit triangle. Use an increasing number of points P_NUM. Note that the sample routine is a good" sampler. P_NUM X^2 X*Y Y^2 1 0.071892 0.072809 0.073739 2 0.001215 0.013669 0.193382 4 0.006280 0.023187 0.183896 8 0.087889 0.028355 0.041950 16 0.101233 0.042266 0.078368 32 0.042797 0.038735 0.089562 64 0.115931 0.044498 0.081896 128 0.072526 0.041886 0.088118 256 0.079542 0.044128 0.088925 512 0.078392 0.042736 0.086421 1024 0.080778 0.041555 0.081229 2048 0.079958 0.040719 0.085090 4096 0.082574 0.041376 0.084712 8192 0.080684 0.040797 0.084053 16384 0.082889 0.041460 0.084290 32768 0.082212 0.041330 0.083150 65536 0.083324 0.041487 0.083729 triangle_monte_carlo_test04(): Sample using triangle_unit_sample_04() Integrate triangle_unit_integrand_03() Integration region is the unit triangle. Use an increasing number of points P_NUM. Note that the sample routine is a good" sampler. P_NUM X^2 X*Y Y^2 1 0.188053 0.081592 0.035401 2 0.147036 0.063077 0.030531 4 0.109564 0.029974 0.026531 8 0.096189 0.045964 0.079362 16 0.108953 0.043879 0.094993 32 0.087864 0.046126 0.094605 64 0.098849 0.042757 0.071125 128 0.087702 0.043195 0.082806 256 0.083931 0.044181 0.085717 512 0.082816 0.041151 0.083877 1024 0.085100 0.040088 0.081033 2048 0.085156 0.040813 0.082176 4096 0.084512 0.041200 0.083889 8192 0.083481 0.041659 0.081677 16384 0.084850 0.041727 0.082989 32768 0.082189 0.041538 0.083623 65536 0.083610 0.041643 0.083303 triangle_monte_carlo_test05(): Sample using triangle_unit_sample_01() Integrate triangle_integrand_user() Integration region is over a general triangle. Use an increasing number of points P_NUM. Note that the sample routine is a "bad" sampler. Triangle vertices: Row: 1 2 Col 1: 4 1 2: 8 3 3: 0 9 P_NUM 1 20.000000 108.646204 43.630906 590.199885 237.016617 95.182798 1287.547787 2808.843827 2 20.000000 106.695227 67.646947 599.472729 353.079363 230.815271 1944.392501 6355.330534 4 20.000000 70.477557 113.334110 284.247755 370.093481 671.093558 1395.310888 7202.300233 8 20.000000 84.563941 83.972355 377.841424 339.727618 371.466518 1448.539251 5863.167409 16 20.000000 84.446375 83.943400 391.904516 325.102880 385.837335 1412.261507 5504.411390 32 20.000000 84.291309 83.259105 377.317165 338.191190 364.306864 1461.758981 5994.414728 64 20.000000 79.371925 87.250844 347.260782 319.238385 418.010066 1322.008388 5430.037740 128 20.000000 80.231137 88.595243 348.451346 334.462150 424.629077 1386.287035 5924.712435 256 20.000000 81.219445 86.379312 361.540912 327.007600 408.453679 1384.612266 5728.827400 512 20.000000 79.455640 87.732518 349.760105 322.003596 420.931292 1334.268836 5533.792390 1024 20.000000 79.802226 86.894075 351.050979 322.759205 412.258806 1345.391732 5586.573384 2048 20.000000 79.484181 87.392508 346.435906 324.295768 414.744648 1338.210643 5604.927671 4096 20.000000 80.435367 86.559081 354.718105 324.768347 408.593339 1355.624570 5635.045624 8192 20.000000 79.861404 87.125859 350.275951 324.474836 413.551095 1348.906856 5633.432896 16384 20.000000 79.876032 86.595679 350.208831 322.345537 408.282179 1338.078942 5546.117784 32768 20.000000 80.075892 86.431399 351.460505 322.883669 407.079377 1343.110198 5569.193027 65536 20.000000 80.166331 86.528128 352.484642 323.626774 407.730399 1348.145906 5594.699069 triangle_monte_carlo_test06(): Sample using triangle_unit_sample_02() Integrate triangle_integrand_user() Integration region is over a general triangle. Use an increasing number of points P_NUM. Note that the sample routine is a "good" sampler. Triangle vertices: Row: 1 2 Col 1: 4 1 2: 8 3 3: 0 9 P_NUM 1 20.000000 98.402096 57.723059 484.148621 284.003497 166.597575 1397.326962 4032.899310 2 20.000000 101.062939 54.845921 541.046930 287.048938 153.634799 1583.808050 4705.174063 4 20.000000 78.725857 97.716037 333.681154 356.059192 514.220800 1407.885456 6431.481580 8 20.000000 102.116837 71.495013 557.686888 357.590203 282.710262 1913.292429 7133.497066 16 20.000000 81.864148 92.920390 401.168504 316.645708 512.034358 1370.840039 5524.828377 32 20.000000 82.390357 83.386352 389.340132 305.503555 410.650684 1333.947315 5290.965249 64 20.000000 75.753842 94.320065 343.942452 309.594255 508.925568 1281.441905 5341.035181 128 20.000000 80.881897 88.634814 388.294785 317.310041 442.754384 1418.471183 5628.727496 256 20.000000 78.908051 88.068181 362.452792 309.368442 441.224330 1328.288987 5375.738611 512 20.000000 80.498119 85.562902 374.671365 307.643669 419.676300 1342.138859 5304.752473 1024 20.000000 79.670666 87.366768 372.221025 305.836318 440.393977 1323.679225 5248.714023 2048 20.000000 80.311673 86.376715 377.120820 306.435315 430.220528 1340.846497 5290.884118 4096 20.000000 79.313086 86.913343 368.118120 304.170281 436.185454 1314.633750 5220.370981 8192 20.000000 80.017521 86.465146 373.786526 305.911943 431.353504 1330.358391 5263.480126 16384 20.000000 79.690956 86.951936 370.315602 306.912976 435.710147 1329.896106 5307.083386 32768 20.000000 80.246350 86.685700 375.552005 307.725711 433.676667 1342.580268 5334.037557 65536 20.000000 80.070171 86.547212 373.595879 306.776268 432.077802 1333.712745 5294.529941 triangle_monte_carlo_test07(): Sample using triangle_unit_sample_03() Integrate triangle_integrand_user() Integration region is over a general triangle. Use an increasing number of points P_NUM. Note that the sample routine is a "good" sampler. Triangle vertices: Row: 1 2 Col 1: 4 1 2: 8 3 3: 0 9 P_NUM 1 20.000000 66.889489 102.944055 223.710186 344.293761 529.873922 1151.481686 5926.909696 2 20.000000 31.743362 141.680293 61.834480 215.502797 1011.327647 408.300310 2705.444675 4 20.000000 85.704617 69.687956 396.563564 289.062348 283.193535 1323.668598 4999.883501 8 20.000000 85.948885 82.522849 429.085103 318.029263 393.478879 1526.893061 5803.171824 16 20.000000 72.152357 86.852022 321.258586 256.899255 456.950068 1058.871337 3899.748941 32 20.000000 89.338953 76.692894 449.291303 309.799631 346.091156 1479.999501 5400.447586 64 20.000000 77.167958 89.992541 354.763048 306.681531 465.039407 1304.386499 5350.756688 128 20.000000 80.809508 84.669690 372.783398 306.709235 414.028406 1325.339733 5252.800458 256 20.000000 81.459375 85.582525 383.709998 308.387930 422.673415 1362.049682 5340.410749 512 20.000000 80.604721 86.046637 377.054814 307.790120 427.699010 1346.933378 5348.879475 1024 20.000000 80.441270 85.373836 375.854649 304.106679 421.215890 1322.209768 5183.590187 2048 20.000000 79.539144 87.821164 370.191687 308.237596 444.523609 1334.452940 5350.556205 4096 20.000000 80.118174 86.834803 374.157454 307.443506 435.388488 1337.543556 5318.987224 8192 20.000000 80.159956 86.653214 374.470193 306.999220 433.480504 1338.035284 5303.295230 16384 20.000000 79.907230 86.451972 371.395636 306.262026 431.047788 1327.530846 5279.032247 32768 20.000000 79.653304 86.938721 370.205103 306.295224 435.911090 1326.624074 5287.340348 65536 20.000000 79.916690 86.709894 372.943580 306.143372 434.042663 1330.056835 5278.177587 triangle_monte_carlo_test08(): Sample using triangle_unit_sample_04() Integrate triangle_integrand_user() Integration region is over a general triangle. Use an increasing number of points P_NUM. Note that the sample routine is a "good" sampler. Triangle vertices: Row: 1 2 Col 1: 4 1 2: 8 3 3: 0 9 P_NUM 1 20.000000 39.738559 120.500282 78.957655 239.425379 726.015896 475.720982 2866.225617 2 20.000000 54.721558 84.476997 152.024017 228.120215 360.768846 625.625730 2602.881857 4 20.000000 61.498193 95.936315 222.746046 279.313717 484.181586 969.566664 4362.049212 8 20.000000 88.601218 83.283023 449.865593 318.646377 423.242118 1484.024364 5668.098984 16 20.000000 79.257430 83.188018 358.227993 286.904291 425.446511 1216.509120 4807.391975 32 20.000000 73.446937 80.453343 317.550944 255.109202 391.104688 1008.644855 3773.002721 64 20.000000 79.532139 87.364163 371.034698 309.137848 437.760855 1349.224670 5388.008738 128 20.000000 79.309834 87.414725 366.616785 305.600481 440.217893 1318.403042 5232.184007 256 20.000000 77.220216 88.378422 355.466323 296.626516 456.198638 1255.928554 5018.785275 512 20.000000 79.003245 87.596125 365.630160 305.408573 442.989060 1310.074652 5258.356867 1024 20.000000 81.763256 84.183619 385.442161 307.441990 408.931131 1358.261943 5309.961405 2048 20.000000 79.713968 86.727149 369.053157 307.304701 433.629346 1327.611837 5324.591510 4096 20.000000 79.735976 87.054350 371.966345 305.876845 437.807749 1330.010204 5286.254851 8192 20.000000 80.022256 86.700299 373.127863 307.273652 433.133851 1335.435128 5307.257756 16384 20.000000 80.156653 86.570983 374.958914 306.704333 432.838164 1336.486480 5299.794377 32768 20.000000 79.993263 86.569314 373.697997 306.018450 432.464044 1331.144156 5272.612846 65536 20.000000 80.100378 86.548576 374.183388 306.677128 432.259412 1334.732550 5293.249157 triangle_monte_carlo_test(): Normal end of execution. 08-Oct-2025 22:44:05