Post Reply 
[VA] SRC #012a - Then and Now: Probability
10-18-2022, 08:00 AM
Post: #67
RE: [VA] SRC #012a - Then and Now: Probability
(10-17-2022 06:29 PM)Dave Britten Wrote:  The results are in: it took around 4 hours to run the 30, 60 scenario on the pure-BASIC 1403H program.
What is the numeric result? I'm curious to compare the accuracy too, is the 1403H a 12-digit machine and does it manage the "round-to -even" rule? I gave a simple test to check it above.


(10-17-2022 08:16 PM)Albert Chan Wrote:  Here is a version that simulate swapping of array name.
Array P of x ≡ A(P, x)
Array Q of x ≡ A(Q, X)
Note: P, Q are now numbers 0 or 1, P+Q=1, not the array itself.
[..]

20 OPTION BASE 0 @ REAL A(1,(R+1)*(R+4)/2) @ P=0
I don't see the benefit of this version, you are still using the same amount of memory, and the access to the array A is slower which is not compensated by the gain of the MAT copy.

(10-17-2022 09:36 PM)Albert Chan Wrote:  When I time MAT P=ZER vs. MAT P=(0), I see no difference.
There is a difference, MAT P=ZER is about 2x faster:
10 DIM A(4096)
20 T=TIME @ MAT A=ZER @ T=TIME-T @ DISP T
20 T=TIME @ MAT A=(0) @ T=TIME-T @ DISP T
>RUN
.38
.76

(physical HP-71B)
However, if you target the smallest code, MAT A=(0) is one byte shorter :-)

J-F
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 #012a - Then and Now: Probability - J-F Garnier - 10-18-2022 08:00 AM



User(s) browsing this thread: 1 Guest(s)