Post Reply 
[VA] SRC #011 - April 1st, 2022 Bizarro Special
04-03-2022, 07:16 PM
Post: #11
RE: [VA] SRC #011 - April 1st, 2022 Bizarro Special
Below is my attempt to implement the sextuple integral computation on the 10C.

Unfortunately, I didn't succeed to fit into the 10C memory, so this is a 41C version but using only the instruction set of the 10C (except the LBLs needed by the 41C).
The programs expects the number of random samples in X as an input.

I used a simple random number generator of mine (unless I knew it from past readings, can't say). The code is documented and easy to understand.

Now, the results. I run it with different numbers of random samples, between 20 and 999:
#samples integral
20 0.628
50 0.823
100 0.898
200 0.910
500 0.981
999 0.967

So I hardy get 1 correct digit if I round all results in FIX 0.
I'm even not sure if the integral is smaller or larger than 1.
Is it really a surprise? Even with 999 samples, this means an average of about 3 samples per dimension of each cube.

But probably Rd. Albizarro preferred a wrong result with 3 figures rather than one reliable estimation that would be big crime !

At the end, did it make any difference for Bizarro World ?

J-F


01*LBL "SRC11"
STO 02 STO 01 ; #samples
PI STO 00 ; rnd seed
0 STO 03 ; init sum

08*LBL 00
RCL 00 PI * FRC STO 00 ; z2
RCL 00 PI * FRC STO 00 ; z1
- X^2 ; (z2-z1)²
RCL 00 PI * FRC STO 00 ; y2
RCL 00 PI * FRC STO 00 ; y1
- X^2 + ; (y2-y1)²+(z2-z1)²
RCL 00 PI * FRC STO 00
1 + ; x2
RCL 00 PI * FRC STO 00 ; x1
- X^2 ; (x2-x1)²
+ ; d²
LASTX SQRT X<>Y ; (x2-x1) d²
ENTER^ SQRT * ; d^3
/ ; (x2-x1)/d^3
ST+ 03 ; add to sum
1 ST- 02 ; decr counter
RCL 02 X<>Y X<=Y? GTO 00 ; loop

63*LBL 01
RCL 03 RCL 01 / ; result
END
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [VA] SRC #011 - April 1st, 2022 Bizarro Special - J-F Garnier - 04-03-2022 07:16 PM



User(s) browsing this thread: