HP 49G Programming Challenge: OEIS A014261, Integers with exclusively Odd Digits

08302017, 01:39 PM
Post: #23




RE: HP 49G Programming Challenge: OEIS A014261, Integers with exclusively Odd Digits
(08302017 12:20 PM)Werner Wrote: An iterative version (even if I favour the recursive one) And here are Werner's timings on the 50g (don't have a 49g to give comparable values). In both cases I replaced / IP with IQUOT. 50000 runs with 50 as argument in 11.01 seconds on newRPL. 100 runs with 50 as argument in 26.66 seconds on 50g stock firmware. I thought this would've been a lot faster without using STO (especially on stock firmware, probably negligible difference on newRPL), but is not the case, perhaps doing MOD and IQUOT together in the main loop is hurting performance, maybe using IDIV2: Code: \<< It did improve to 10.13 sec. (from 11.01sec) on newRPL, and down to 23.33 sec. on stock firmware in exact mode, but slows down to 30.0 sec in approx mode (recompiled with reals, but why? perhaps IDIV2 needs to convert the reals back to integer?). I think for the 49g, and as long as it runs in exact mode, this is likely to be the winner entry (all credit to Werner of course), my entry clocked 24.2sec under the same conditions. Close, but slower. The weird part is my algorithm using IQUOT went even faster using reals in approx. mode, I can't understand why this algorithm (quite similar, actually) slows down with reals. So far it's a mystery to me. 

« Next Oldest  Next Newest »

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