Wed Oct 8 08:55:58 2025 sphere_monte_carlo_tests(): python version: 3.10.12 numpy version: 1.26.4 Test sphere_monte_carlo(). sphere01_area_test sphere01_area returns the volume of the unit sphere. sphere01_area() = 12.5664 sphere01_monomial_integral_test(): sphere01_monomial_integral() returns the integral of a monomial over the surface of the unit sphere in 3D. Compare with a Monte Carlo estimate. If any exponent is odd, the integral is zero. We will restrict this test to randomly chosen even exponents. Ex Ey Ez MC-Estimate Exact Error 4 8 2 0.00202171 0.00195282 6.9e-05 4 2 2 0.0407281 0.0398932 0.00083 8 2 6 0.000567853 0.000574358 6.5e-06 2 8 4 0.00197714 0.00195282 2.4e-05 4 4 8 0.000343374 0.000344615 1.2e-06 6 8 0 0.00975483 0.00976408 9.2e-06 0 8 0 1.33858 1.39626 0.058 8 0 2 0.125998 0.126933 0.00094 2 6 8 0.000576108 0.000574358 1.8e-06 4 2 2 0.0407281 0.0398932 0.00083 8 0 8 0.00392494 0.0040205 9.6e-05 2 8 2 0.00988605 0.00976408 0.00012 0 6 4 0.0529457 0.0543999 0.0015 2 0 8 0.127799 0.126933 0.00087 2 4 4 0.0109837 0.01088 0.0001 0 0 6 1.81668 1.7952 0.021 0 8 0 1.33858 1.39626 0.058 4 4 8 0.000343374 0.000344615 1.2e-06 4 0 2 0.356816 0.359039 0.0022 6 6 4 0.000253152 0.000246153 7e-06 sphere01_monte_carlo_test Use sphere01_sample to estimate integrals over the surface of the unit sphere. N 1 X^2 Y^2 Z^2 X^4 X^2Y^2 Z^4 1 12.566371 1.970822 9.154389 1.441160 0.309090 1.435710 0.165278 2 12.566371 6.399669 2.753503 3.413198 3.551199 0.982686 0.982776 4 12.566371 3.719153 6.188527 2.658691 2.486434 0.474346 1.749144 8 12.566371 4.569844 4.239472 3.757055 2.841783 0.695371 1.638632 16 12.566371 3.034894 4.413040 5.118436 1.607267 0.619597 3.222377 32 12.566371 4.075402 3.470944 5.020025 2.392153 0.790737 3.249293 64 12.566371 4.781301 3.588334 4.196735 2.883224 0.980938 2.550111 128 12.566371 3.670457 4.537658 4.358256 2.078212 0.725427 2.676584 256 12.566371 4.369848 4.334433 3.862089 2.750678 0.875855 2.338460 512 12.566371 4.308910 4.075655 4.181806 2.636542 0.815314 2.508909 1024 12.566371 3.905787 4.309041 4.351542 2.292050 0.815794 2.717735 2048 12.566371 4.129569 4.210763 4.226039 2.463765 0.829162 2.535736 4096 12.566371 4.162821 4.189482 4.214068 2.477927 0.838368 2.525230 8192 12.566371 4.152563 4.191786 4.222021 2.490477 0.834106 2.555594 16384 12.566371 4.189653 4.194629 4.182089 2.519805 0.834715 2.506741 32768 12.566371 4.201351 4.169766 4.195254 2.521457 0.839426 2.510874 65536 12.566371 4.183365 4.194601 4.188405 2.512744 0.836089 2.508555 Exact 12.566371 4.188790 4.188790 4.188790 2.513274 0.837758 2.513274 sphere01_sample_test sphere01_sample samples the unit sphere. Sample points on the unit sphere. Row: 0 1 2 Col 0 : -0.277671 -0.318464 -0.906355 1 : 0.786807 0.0754388 0.612571 2 : -0.0759109 0.912387 0.402229 3 : 0.487327 0.56647 0.664548 4 : -0.628347 -0.650571 0.426542 5 : -0.661182 0.35905 -0.658727 6 : -0.839611 0.0738972 0.538139 7 : -0.45153 -0.206118 0.868122 8 : 0.264245 0.962917 -0.0544625 9 : 0.224639 -0.809569 -0.542342 sphere_monte_carlo_tests(): Normal end of execution. Wed Oct 8 08:55:59 2025