HP Forums
WP 34S --> WP 31S - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: Not HP Calculators (/forum-7.html)
+--- Forum: Not quite HP Calculators - but related (/forum-8.html)
+--- Thread: WP 34S --> WP 31S (/thread-576.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16


RE: WP 34S --> WP 31S - Paul Dale - 04-13-2014 12:17 PM

You missed the reflection formula to produce an analytic continuation for entire real and complex domains (excepting negative integers and zero of course) Smile

The 34S does all of these BTW using a rather more modern approximation from memory. Sadly, this is one function that took a couple of goes to get accurate but worth the effort nonetheless.


- Pauli


RE: WP 34S --> WP 31S - Thomas Klemm - 04-13-2014 02:19 PM

(04-13-2014 11:10 AM)Paul Dale Wrote:  Factorial isn't tail recursive

It's easy if you try:
Code:
factorial(n) = factorial_helper(n, 1)

factorial_helper(n, prod) = 
    if n > 0 then
        factorial_helper(n - 1, prod * n)
    else
        prod

PS: There's something missing in your code leading to a stack overflow.


RE: WP 34S --> WP 31S - Paul Dale - 04-13-2014 09:25 PM

I'd still posit that coding the iterative version is now easier than the change to the tail recursive form Smile

Yes, I missed the exit condition, that wasn't my intention in that code snippet.


- Pauli


RE: WP 34S --> WP 31S - Thomas Klemm - 04-14-2014 01:17 AM

What if "coding the iterative version" isn't supported by the language?


RE: WP 34S --> WP 31S - Manolo Sobrino - 04-14-2014 01:33 AM

OK, I can't make more sense of this calculator à la HP than this layout:

[Image: wp31s_slanted.png]

[attachment=510]

Discussion in the next few days, I guess.


RE: WP 34S --> WP 31S - walter b - 04-14-2014 08:42 AM

How about running a poll? Should be in a new thread, however.

[Image: wp31s_slanted.png] vs. [Image: attachment.php?aid=406]

d:-)


RE: WP 34S --> WP 31S - Manolo Sobrino - 04-14-2014 10:12 AM

(04-14-2014 08:42 AM)walter b Wrote:  How about running a poll? Should be in a new thread, however.
d:-)

Let's go for it!

Smile