Post Reply 
Programming Exercise (HP-15C, 15C LE - and others)
03-17-2014, 12:43 AM (This post was last modified: 03-17-2014 12:54 AM by Gerson W. Barbosa.)
Post: #4
RE: Programming Exercise (HP-15C, 15C LE - and others)
(03-16-2014 05:23 AM)Thomas Klemm Wrote:  I'm lazy and just leave a link to the HP-15C Mini-challenge: Speeding it up !

Quote:I took your HP-11C program that sums an alternating series ...

To those who haven't followed the link, that was Paul Dale replying to Valentin about a modification for the HP-42S of his (Valentin's) generic program for summing alternating series. That was not posted because it didn't meet Valentin's size requirement, I think. That HP-42S version might be interesting, but I guess it's gone by now.

(03-16-2014 05:23 AM)Thomas Klemm Wrote:  cf. Summation of infinite, alternating series

Quoting from Valentin's article:

"Find the sum of S = 1 -1/2 + 1/3 - 1/4 + 1/5 - ...

- we define the i-th term = 1/(1+i):

GTO B, P/R, 1, +, 1/x, RTN, P/R

- we'll use PSum = 10, NDif = 7 for maximum accuracy:

10, ENTER, 7, A

- after just one minute, we get the sum = 0.693147182 in the display. The
theoretically correct value is
Ln(2) = 0.693147181, so we've got 9 decimals accuracy."

My 28-step program (on the HP-11C) returns 0.69314271805 in 51 seconds, after summing the first 66 of the series and doing the necessary correction. But mine is specific program while Valentin's is a generic program. Also, I've used just a 2-term continued fraction to correct the sum.

The correct value to 16-digit accuracy is 0.6931471805599453.

Cheers,

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


Messages In This Thread
RE: Programming Exercise (HP-15C, 15C LE - and others) - Gerson W. Barbosa - 03-17-2014 12:43 AM



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