Programming puzzle: Longest list of regular numbers?
|
04-18-2017, 10:09 PM
(This post was last modified: 04-19-2017 03:27 PM by Claudio L..)
Post: #25
|
|||
|
|||
RE: Programming puzzle: Longest list of regular numbers?
(04-18-2017 07:22 PM)Han Wrote:(04-18-2017 07:13 PM)pier4r Wrote: Just saw this: http://www.hpmuseum.org/forum/thread-8201.html For the record: newRPL running Han's program, unmodified. I did copy/paste from the forum, replaced \<< and other characters with the real Unicode ones and saved as a pure .txt file, put it on an SD card, read the file and compiled with STR->. For the 1429th value (using 1430 as argument on Han's program, as it counts from one): 1429 ==> newRPL: 0.687 seconds 9733 ==> newRPL: 39.87 seconds without GC (doing MEM before running), 85.21 seconds with heavily fragmented memory (second run immediately after). EDIT: 14999 ==> newRPL: 113.57 seconds, result is 1.236950581248E20 17499 ==> newRPL: 159.46 seconds, result is 1.549681956E21 (only 48 kbytes free memory after) To answer the original challenge, interpolating linearly between the timings at 17500 and 15000 results, newRPL would obtain 15349 results in 120 seconds. END EDIT I maxed out my patience before maxing out the memory. I want to clarify this entry is to report Han's algorithm speed, all credit goes to him for the program as I didn't even read the code. EDIT: MEM reports 131 kbytes free with all 15000 values on the stack. Also worth clarifying that since these numbers are < 2^63, simple 64-bit integers can be used. For larger numbers the variable precision floating point kicks in and should slow down considerably. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)