Post Reply 
Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant
02-23-2017, 09:01 PM
Post: #49
RE: Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant
(02-21-2017 12:33 PM)Werner Wrote:  to 'Kahan sum' an exploded list, you may use:
In: ob1..obN N
Out: Sum(ob1..obN)

Code:
\<<
  0 0 ROT
  1 SWAP START      @ xi s c
    ROT + DUP2 +    @ s y t
    ROT OVER -      @ y t s-t
    ROT +           @ s c
  NEXT
  DROP
\>>


Unfortunately, for 12-digit machines it makes no difference in RFC(25) and RFC(37) (summing small to large)

But RFC(37) is now only one ULP away from the exact 12-digit result.

SysRPL which doesn't round intermediate results to 12 digits might handle these and all others, no matter the summing order, I think. But I can't check this as I am SysRPL illiterate.

Gerson.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Programming exercise (RPL/RPN) - Reciprocal Fibonacci Constant - Gerson W. Barbosa - 02-23-2017 09:01 PM



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