HP-41 Challenge: Double Integrals by INTEG Recursion
|
06-01-2016, 06:51 PM
Post: #13
|
|||
|
|||
RE: HP-41 Challenge: Double Integrals by INTEG Recursion
.
Hola, Ángel: (06-01-2016 05:32 AM)Ángel Martin Wrote: Glad this thread pulled you in from your greener pastures Valentín, always a pleasure to read your comments. Thanks for your interest & kind comment, Ángel. Matter of fact I do read the forum from time to time and still use my HP calculators (mostly HP-71B and HP-15C) and write code for them. Alas, sharing it is a different matter as I'm still looking for an adequate venue for my many unpublished articles, routines, tips, challenges and assorted stuff. Quote:yet for a much humbler platform like the 41's the "buffer juggling" is a very elegant work-around Indeed it is. I hope you didn't take my comment as somewhat derogatory or unappreciative, far from it, I was just stating the raw fact that the HP-71B w/Math ROM makes computing multiple integrals a cinch. I've seen your 41C w/enhancements solution to your own challenge and I think it's as elegant and short as possible, given the limitations you mention. Congratulations. For the record, this is the HP-71B code to compute the quintuple integral using a Monte-Carlo approach, a straightforward 3-line affair with no Math ROM needed. >LIST 10 DESTROY ALL @ RANDOMIZE 1 @ B=.7*.8*.9*1.1 @ FOR K=1 TO 4 @ N=10^K 20 S=0 @ FOR I=1 TO N @ X=RND*.7 @ Y=RND*.8 @ Z=RND*.9 @ U=RND @ W=RND*1.1 30 S=S+SQR(6-X*X-Y*Y-Z*Z-U*U-W*W) @ NEXT I @ DISP N,S*B/N @ NEXT K >RUN 10 1.17631976176 100 1.19138525241 1000 1.18851295632 10000 1.18896583878 The output are the results for 10, 100, 1000 and 10000 random samples, the last having 5 correct digits (save one ulp) and about as fast as the INTEGRAL approach. Best regards. V. All My Articles & other Materials here: Valentin Albillo's HP Collection |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)