Post Reply 
50g Mini-Challenge: Number of positive divisors of x!
10-02-2017, 08:42 AM
Post: #21
RE: 50g Mini-Challenge: Number of positive divisors of x!
(10-02-2017 06:43 AM)Gerald H Wrote:  
(10-02-2017 05:30 AM)Joe Horn Wrote:  I keep << -40 CF MEM DROP 0.5 WAIT TEVAL -40 SF >> assigned to a key for accurate timings.
Why do you have MEM in the programme? TEVAL does garbage collection.

Wow, so it does! I never knew that. Good to know. I've removed MEM DROP from my assignment. Thank you!

(10-02-2017 06:43 AM)Gerald H Wrote:  What's the point of 0.5 WAIT?

Short answer: Because I got annoyed having to tap the assigned key very rapidly, to prevent TEVAL's result from being polluted by the system slowdown caused by the keydown event.

Longer answer: Including 0.5 WAIT is only useful if TEVAL is executed via a key assignment. Try assigning just TEVAL by itself to a key, and you'll notice that you'll get the longest timings if you press and hold down the key during the entire TEVAL, and the fastest timings if you very rapidly tap the key (releasing the key before TEVAL even has a chance to begin), and various timings in between (when the key is released after TEVAL starts but before it finishes). Since my goal was reliably similar timings, I include 0.5 WAIT in the key assignment, which gives plenty of time for the key to be released before TEVAL begins to actually begin timing.

-40 CF turns off the "ticking" clock display, which causes a system interrupt once every second, which messes up timings. -40 SF is included because having the ticking clock display is the only known workaround for the Busy Bug.

<0|ΙΈ|0>
-Joe-
Visit this user's website Find all posts by this user
Quote this message in a reply
10-02-2017, 09:00 AM
Post: #22
RE: 50g Mini-Challenge: Number of positive divisors of x!
Thank you, Joe, have modified my key assignment accordingly.
Find all posts by this user
Quote this message in a reply
10-02-2017, 09:13 AM (This post was last modified: 10-02-2017 09:13 AM by pier4r.)
Post: #23
RE: 50g Mini-Challenge: Number of positive divisors of x!
(10-02-2017 05:30 AM)Joe Horn Wrote:  Note that you can determine such timings yourself using the 50g's TEVAL command.

Yes I know, but if someone else did already, the result is already computed. Thanks nevertheless for the input! (that lead Gerald to inform us that TEVAL activates the GC)

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
10-02-2017, 12:44 PM
Post: #24
RE: 50g Mini-Challenge: Number of positive divisors of x!
(10-01-2017 03:47 PM)pier4r Wrote:  John it seems that you have some knowledge of speed of some commands (considering also the other thread where you today wrote that CEIL is faster than 1 + IP ). By chance do you have some measurements in time for each command tested by you?

Well, I have been benchmarking HP calculator commands and functions since the HP-71B but everything is scribbled in various notebooks and folders. Turning my notes into machine-readable form would be a monumental task which is far from the top of my To-do list. :-)

Hopefully someone has posted this information before but I don't know where. If enough people are interested I would be happy to contribute some basic stats but a full spreadsheet or article would be beyond the time I have available for such things.

John
Find all posts by this user
Quote this message in a reply
10-02-2017, 01:24 PM
Post: #25
RE: 50g Mini-Challenge: Number of positive divisors of x!
There is this list

http://www.hpmuseum.org/cgi-sys/cgiwrap/...i?read=700

It may be best to start a new thread in General Forum.
Find all posts by this user
Quote this message in a reply
10-04-2017, 03:40 PM
Post: #26
RE: 50g Mini-Challenge: Number of positive divisors of x!
A more efficient version of the programme:

Size: 124.

CkSum: # 6E3Ch

Code:
::
  CK1&Dispatch
  # FF
  ::
    ZINT 1
    SWAP
    ZINT 0
    BEGIN
    FPTR2 ^Prime+
    2DUP
    Z>=
    WHILE
    ::
      2DUP
      ZINT 0
      SWAPROT
      BEGIN
      OVER
      FPTR2 ^ZQUOText
      ROTOVER
      FPTR2 ^RADDext
      3UNROLL
      FPTR2 ^DupQIsZero?
      UNTIL
      2DROP
      ZINT 1
      FPTR2 ^RADDext
      4ROLL
      FPTR2 ^RMULText
      3UNROLL
    ;
    REPEAT
    2DROP
  ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 




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