Post Reply 
(PC-12xx~14xx) qasi Adaptive Simpson quadrature
04-16-2022, 01:45 PM
Post: #3
RE: (PC-12xx~14xx) qasi Adaptive Simpson quadrature
(04-15-2022 01:45 AM)Albert Chan Wrote:  Hi, robve

I translated your BASIC code for HP71B
Example is for ∫(surd(x,-3), x=-2..3) ≈ 0.739024156626

>RUN
 .739024205098      10.99

HP71B can do recursive calls, without us handle recursive calling stacks.
I think this version is simpler, which I posted a few days ago.

Very nice. A bit surprised to see that the recursive version on the HP 71B takes much longer, about 1.7 times the execution time of the stack version:

>RUN
.73902427614 18.76

The quadrature should be comparable, but not necessarily identical as the summation order differs (in-order traversal sum versus a bottom-up sum in the recursive version that is typically more precise).

Applying tail-recursion optimization to the recursive version should speed this up some.

- Rob

"I count on old friends" -- HP 71B,Prime|Ti VOY200,Nspire CXII CAS|Casio fx-CG50...|Sharp PC-G850,E500,2500,1500,14xx,13xx,12xx...
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (PC-12xx~14xx) qasi Adaptive Simpson quadrature - robve - 04-16-2022 01:45 PM



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