Post Reply 
(49g 50g) Shoelace algorithm
08-24-2018, 07:57 PM
Post: #10
RE: ( HP49/50) Shoelace algorithm
(08-24-2018 05:02 PM)Thomas Klemm Wrote:  
(08-24-2018 02:08 PM)John Keith Wrote:  The ListExt Library command LRLLD is the equivalent of DUP TAIL SWAP HEAD + but ListExt is HP49/50 only.

Does that mean that we could use this?
Code:
« DUP LRLLD
  SWAP LROLL
  - * ∑LIST 2 /
»

Quote:HEAD is very slow and I try to avoid it whenever possible.

Do we know the reason? With a linked list HEAD and TAIL are usually fast.

Quote:Though much longer, 1. DUP SUB EVAL is about three times as fast as HEAD!

What about 1. GET?

Kind regards
Thomas

I won't have time to try the ListExt code until tomorrow but it looks about right.

I have no idea why HEAD is so slow, maybe some folks here with more System RPL knowledge can tell us.

1 GET is somewhere in between HEAD and 1. DUP SUB EVAL. I don't know the ratio off hand. I was using 1. DUP SUB EVAL mainly to illustrate how a built-in command is inexplicably slower than a User RPL equivalent.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(49g 50g) Shoelace algorithm - John Keith - 08-23-2018, 02:20 PM
RE: ( HP49/50) Shoelace algorithm - John Keith - 08-24-2018 07:57 PM



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