Wed Oct 8 08:48:18 2025 pyramid_monte_carlo_test() python version: 3.10.12 numpy version: 1.26.4 Test pyramid_monte_carlo(). pyramid01_integral_test(): pyramid01_integral() returns the integral of a monomial over the unit pyramid in 3D. Compare to a Monte Carlo estimate. Number of sample points used is 500000 E1 E2 E3 MC-Estimate Exact Error 0 0 0 1.33333 1.33333 0 2 0 0 0.266717 0.266667 5e-05 4 0 0 0.114405 0.114286 0.00012 6 0 0 0.0636009 0.0634921 0.00011 0 2 0 0.26602 0.266667 0.00065 2 2 0 0.0633972 0.0634921 9.5e-05 4 2 0 0.0295952 0.0296296 3.4e-05 0 4 0 0.113985 0.114286 0.0003 2 4 0 0.0295989 0.0296296 3.1e-05 0 6 0 0.0633842 0.0634921 0.00011 0 0 1 0.333554 0.333333 0.00022 2 0 1 0.0444873 0.0444444 4.3e-05 4 0 1 0.0143142 0.0142857 2.9e-05 0 2 1 0.0444326 0.0444444 1.2e-05 2 2 1 0.00793845 0.00793651 1.9e-06 0 4 1 0.0142652 0.0142857 2.1e-05 0 0 2 0.133407 0.133333 7.3e-05 2 0 2 0.0127066 0.0126984 8.2e-06 4 0 2 0.00318313 0.0031746 8.5e-06 0 2 2 0.0127057 0.0126984 7.2e-06 2 2 2 0.00176593 0.00176367 2.3e-06 0 4 2 0.0031722 0.0031746 2.4e-06 0 0 3 0.0667087 0.0666667 4.2e-05 2 0 3 0.00476148 0.0047619 4.2e-07 0 2 3 0.00476654 0.0047619 4.6e-06 0 0 4 0.0381327 0.0380952 3.7e-05 2 0 4 0.00211498 0.0021164 1.4e-06 0 2 4 0.00211929 0.0021164 2.9e-06 0 0 5 0.0238455 0.0238095 3.6e-05 0 0 6 0.0159067 0.015873 3.4e-05 pyramid01_monte_carlo_test() pyramid01_sample() estimates integrals over the interior of the unit pyramid in 3D. N 1 Z X^2 Y^2 Z^2 X^2Z Y^2Z Z^3 X^2Y^2 X^2Z^2 1 1.33333 0.469779 0.00305389 0.126786 0.165519 0.00107599 0.0446712 0.0583182 0.000290394 0.000379109 2 1.33333 0.128629 0.648214 0.497674 0.0161775 0.0589452 0.0327039 0.00228778 0.256528 0.00717239 4 1.33333 0.5153 0.209099 0.143006 0.227315 0.0882533 0.0621414 0.109047 0.024521 0.0407379 8 1.33333 0.276335 0.361152 0.222527 0.0993522 0.0496913 0.0544996 0.0437029 0.0976434 0.00912411 16 1.33333 0.236265 0.339023 0.332514 0.0668921 0.0414599 0.0396673 0.0252004 0.0867191 0.00876593 32 1.33333 0.33441 0.251626 0.294873 0.151977 0.0377373 0.0469786 0.0889425 0.0619822 0.0107912 64 1.33333 0.342093 0.295178 0.233231 0.146749 0.050024 0.0387672 0.0798496 0.0566192 0.0142738 128 1.33333 0.322238 0.248088 0.286905 0.130847 0.0442245 0.0430669 0.0685353 0.0600031 0.0134863 256 1.33333 0.332807 0.278004 0.265473 0.139206 0.045135 0.0399486 0.0726823 0.0696029 0.0129898 512 1.33333 0.331034 0.255259 0.276767 0.131936 0.0439856 0.0462347 0.0662047 0.062833 0.0133122 1024 1.33333 0.336743 0.271489 0.264597 0.132174 0.0473878 0.0458918 0.063643 0.0632006 0.0139072 2048 1.33333 0.331919 0.264541 0.266283 0.134626 0.0429589 0.043087 0.0681776 0.0607147 0.0123164 4096 1.33333 0.326784 0.271702 0.267612 0.131282 0.0443919 0.0429443 0.0668226 0.0638549 0.0124142 8192 1.33333 0.329042 0.272948 0.268378 0.131474 0.0444002 0.043601 0.0658823 0.0645566 0.0125689 16384 1.33333 0.333488 0.266464 0.264456 0.133905 0.0443477 0.0441647 0.0672752 0.063049 0.0126312 32768 1.33333 0.331494 0.267404 0.266666 0.131667 0.0447204 0.0442067 0.0654215 0.0636996 0.0127524 65536 1.33333 0.332771 0.265473 0.266571 0.13264 0.0443515 0.0445324 0.0659961 0.0632164 0.0126535 Exact 1.33333 0.333333 0.266667 0.266667 0.133333 0.0444444 0.0444444 0.0666667 0.0634921 0.0126984 pyramid01_sample_test(): pyramid01_sample() samples points from the unit pyramid. Unit pyramid points Row: 0 1 2 Col 0 : -0.435696 -0.691921 0.0107828 1 : -0.55336 -0.302279 0.331917 2 : 0.169671 -0.381821 0.0210643 3 : 0.509439 0.333726 0.227934 4 : 0.518574 -0.29478 0.0798921 5 : -0.448856 0.591017 0.218174 6 : 0.426077 -0.00779901 0.294161 7 : -0.0194588 -0.302044 0.670577 8 : 0.204935 -0.706904 0.138982 9 : -0.737697 0.203387 0.190524 10 : -0.0136267 -0.707176 0.259071 11 : -0.0471301 -0.327761 0.319627 12 : -0.231071 -0.578243 0.288235 13 : -0.186372 0.60527 0.33352 14 : 0.0314592 0.134575 0.708012 15 : -0.434997 0.0822694 0.25552 16 : 0.214555 0.433537 0.0628292 17 : 0.154079 0.685761 0.148218 18 : -0.0522384 0.446677 0.244836 19 : 0.25059 -0.190944 0.260251 pyramid01_volume_test(): pyramid01_volume() returns the volume of the unit pyramid. pyramid01_volume() = 1.33333 r8_mop_test(): r8_mop() evaluates (-1.0)^I4 as an R8. I4 r8_mop(I4) 97 -1.0 -88 1.0 -80 1.0 27 -1.0 21 -1.0 -17 -1.0 1 -1.0 -84 1.0 -6 1.0 -8 1.0 pyramid_monte_carlo_test(): Normal end of execution. Wed Oct 8 08:48:32 2025