Post Reply 
Calculate large factorials on a HP48 (SysRPL)
02-19-2014, 04:44 PM
Post: #5
RE: Calculate large factorials on a HP48 (SysRPL)
(02-19-2014 10:45 AM)Werner Wrote:  For both accuracy and speed, however, you'd be better off dividing by LN(10) only once, after the loop?

I agree with the speed reason, but when I wrote the program years ago I got better results adding the LOG instead of the LN numbers.

But your suggested modification is simple for own tests:
Code:
...
  #1+_ONE_DO (DO)
      INDEX@ UNCOERCE%%                 ( convert loop counter to long real )
      %%LN                                                 ( %%LN of number )
      %%+                                                       ( to result )
    LOOP
    OVER %%/                               ( convert result to sum of %%LOG )
    DUP %%FLOOR                                            ( fetch exponent )
...

Christoph
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Calculate large factorials on a HP48 (SysRPL) - Christoph Giesselink - 02-19-2014 04:44 PM



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