Post Reply 
WP 34S --> WP 31S
04-13-2014, 12:17 PM
Post: #301
RE: WP 34S --> WP 31S
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
Find all posts by this user
Quote this message in a reply
04-13-2014, 02:19 PM (This post was last modified: 04-13-2014 03:51 PM by Thomas Klemm.)
Post: #302
RE: WP 34S --> WP 31S
(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.
Find all posts by this user
Quote this message in a reply
04-13-2014, 09:25 PM
Post: #303
RE: WP 34S --> WP 31S
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
Find all posts by this user
Quote this message in a reply
04-14-2014, 01:17 AM
Post: #304
RE: WP 34S --> WP 31S
What if "coding the iterative version" isn't supported by the language?
Find all posts by this user
Quote this message in a reply
04-14-2014, 01:33 AM
Post: #305
RE: WP 34S --> WP 31S
OK, I can't make more sense of this calculator à la HP than this layout:

[Image: wp31s_slanted.png]

   

Discussion in the next few days, I guess.
Find all posts by this user
Quote this message in a reply
04-14-2014, 08:42 AM
Post: #306
RE: WP 34S --> WP 31S
How about running a poll? Should be in a new thread, however.

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

d:-)
Find all posts by this user
Quote this message in a reply
04-14-2014, 10:12 AM
Post: #307
RE: WP 34S --> WP 31S
(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
Find all posts by this user
Quote this message in a reply
Post Reply 




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