Post Reply 
Little explorations with HP calculators (no Prime)
10-22-2017, 03:51 PM (This post was last modified: 10-22-2017 08:42 PM by pier4r.)
Post: #238
RE: Little explorations with HP calculators (no Prime)
Thanks John!

Another tip. While playing around with large lists (1000 elements) I noticed that ADD was not that fast.

So quick test ADD vs DOLIST:
1000 elements (repeated only once)
ADD ~ 5 seconds
DOLIST ~ 5.6 seconds

Code:

gpTestAddDOLIST
  \<<
    @as usual, the more on does, the more one may notice.
    @damn me that I forget this or I don't appreciate it.
    
    @So playing around on the 50g (first and foremost one needs to
    @check part of the commands for an algorithm manually)
    @I observed that ADD is not that fast. Surely
    @multiplying a list by a scalar is quick, but adding two lists
    @ (admittedly of 1000 elements) was not that quick.
    @ So I wonder if Add is faster than DOlist or not.
    @first list
    100 RAND * IP 1000 NDUPN \->LIST
    @second list
    100 RAND * IP 1000 NDUPN \->LIST
    
    @add
    \<<
      DUP2 ADD
    \>>
    TEVAL
    
    @DOLIST
    \<<
      @due to the things on the stack. Some picks
      @Eh, named variables are more easier to manage
      @and resilient to changes
      PICK3 @ second list
      5 PICK @first list
      2
      \<< + \>>
      DOLIST
    \>>
    TEVAL
  \>>

edit:
Another info
generating 1000 values in a list with the SIN function takes time.
if, after every value, one stores it in a list with STO+
it takes around 600 seconds.

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Little explorations with HP calculators (no Prime) - pier4r - 10-22-2017 03:51 PM



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