HP Forums

Full Version: HP17bII+ recursive programing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Is there a way of performing recursive calculations, such, Fibonacci Series using a HP 17bII+. Is it possible to have access to intermediate values of the summation function?

I don't own one, and the site doesn't have specifics on the 17BII, but I'll take a stab at it-

Does the 17BII have RPL? If not, then any subroutine capabilities are in all likelihood only about 7-8 levels deep (assuming it's Saturn CPU based). Most recursion methods require fairly deep subroutine nesting to be of much value, so not much use on limited machines with shallow call/return stacks/registers.

Also, the limited information on other algebraic calculators that this site contains doesn't imply much in the way of programmability. Can you even access one formula entered from another one? If so, then that by definition is like a subroutine call, so any limits on subroutine depth would be measured in the number of formulas that can reference other entered formulas. Is there any conditionals allowed in a formula? If not, then recursion is pointless, as you need some means to control the recursion depth in the first place.

As for intermediate values, are you thinking of the x,y,x*y,x^2... summation registers? If that is the case, then there should be a recall function to get at the present summation total for each summation statistic kept. Note that each summation quantity is a running total, so there isn't "history" on each data point entered. This makes sense, as there is no intrinsic limit on the number of data points in a statistical analysis excepting rounding/overflow errors in the summations themselves. Normalizing the data reduces these effects and allows for much larger data sets without losing accuracy.

Any other information behind a keyboard function or statistical operation besides that returned by the function would simply not be available. Can't imagine how that would be possible, unless you can perform some feat of synthetic programming, and even then, probably not anything useful would be left in various working registers or scratch pad memory.

Hope that helps answer your questions.

sbirdasn.

Edited: 9 May 2005, 11:08 p.m.

Thanks for your reply. The programming capabilities are very, very limited on the HP17bII+. It only has the solve function and it is targetted at the financial sector. I bought it as a programming challenge for myself at Christmas. Being a mathematician I have written trignometric functions (summation formulae) for it (as it does not have any) and other simple programs. I do apologise, after reading your reply I think the question I should have asked is: Is there a register that holds the Solve intermediate values and can its value be accessed? This function is on other HP calculators.

By the way the calculator has RPN and algebraic modes of operation.

As a matter of course it is a nice calculator to use but really for anything regarding serious programming I will use my HP49G+, HP15C or what I like to use on my computer is Mathcad.

My 32S returns the final guess (X), previous guess (Y) and the value of the function at the last guess (Z) to the stack, regardless of whether a root was found. There is a display message to indicate root success/failure, but the stack information is helpful to tell whether a real root was found.

Because solve cannot always return an exact solution, these three values *should* be available. Unlike the more sophisticated models like my 48GX (which displays the reason for solve termination), with the 32S I have to deduce from the stack remains details as to what caused the termination.

Run solve and see if the stack is left in that condition on your calculator.

Hope that helps.

OT-- I'm with you when it comes to serious number crunching, and use Mathcad as well. Though I'm not pleased with their latest DRM measures and the fact that many versions break old documents without a conversion utility, so they likely won't be selling any newer versions to me (2001i is my last version).

sbirdasn.

Christopher Dean wrote:

Quote:
Being a mathematician I have written trignometric functions (summation formulae) for it (as it does not have any) and other simple programs.

Congratulations for the effort. W. B. Maguire II has implemented trig and inverse trig functions for the HP-17BII (think they are 17BII+ compatible). You can find them here:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=222

I don't know how fast the functions are evaluated. Anyway, they may run faster on the 17BII+ (he used Taylor series approximations).

I myself have written recently a trig program for the HP-12C, which I recognize is not so useful, as it uses all general purpose registers and two financial registers, but the technique might be useful on more powerful calculators. By using polynomial approximations with optimized coefficients, along with trigonometric transformations to reduce the domain ranges, I could get 9-digit accuracy and 3-second running time with only three constants for trig functions (inverse functions are accurate to 5-6 digits with only four constants). As memory doesn't appear to be a problem on the 17BII+, the range reduction technique should not be used because it may cause running time to increase. Also, the polynomial should be in Horner's form for better performance.
If you are interested, take a look at:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=487

It is always good to see different approaches to the same problem, just in case you want to share it.

Regards,

Gerson.

( 1234 to remove )

Edited: 10 May 2005, 7:04 p.m.

thanks for the links they are great. they could open new programming avenues for me as i think it is a great calculator