Post Reply 
newRPL: all results mode?
01-25-2016, 02:31 PM (This post was last modified: 01-25-2016 02:41 PM by Claudio L..)
Post: #11
RE: newRPL: all results mode?
(01-24-2016 07:08 PM)Nigel (UK) Wrote:  I like this approach. With a function that finds the minimum and maximum values between the \\ delimiters it could be used for interval arithmetic as well as for its intended purpose.

It might be an idea to combine this approach with the following. Instead of returning \\...\\ directly, operators could return variables representing signs and/or integers as part of an expression. So \\4\\ sqrt would return 2*s1; \\9\\ sqrt would return 3*s2. Adding them would give 2*s1 + 3*s2. Then s1 and s2 could be substituted with lists, \\..\\ structures, or even just 1 or -1, using SUBST or the | operator.

This would also work with inverse trig functions. \\0.5\\ ASIN could return
Code:
\\ 30+360*n1 150+360*n2 \\ instead of just \\ 30 150 \\.

Is this too much complication?

Nigel (UK)

Returning expressions, using SUBST or the | operator are all CAS features. As of right now, I'm not developing the CAS. There's plain simple expression evaluation, but nothing more (roughly at the level of the 48 series).
While your approach is good and won't be discarded, it will be a while before those math functions return symbolic expressions.
Let's analyze sqrt(asin(\\0.5\\))
The square root would have to return all four solutions in a symbolic way, like this:

\\ '√(30+360*n1)' '-√(30+360*n1)' '√(150+360*n2)' '-√(150+360*n2)' \\

If you want numeric (approximated solutions), then you'd have to use approximated inputs:

'√(ASIN(\\0.5.\\))' EVAL --> \\ 30. 150. \\

Let's also see what would happen with symbolic expressions that cannot be evaluated numerically:

'√\\4\\+√\\3\\' --> \\ 2 -2 \\ \\ '√3' '-√3' \\ + --> \\ '2+√3' '-2+√3' '2-√3' '-2-√3' \\

I think your idea would work just fine, except for one thing:

\\ 0.5 \\ ASIN \\0.5\\ ASIN +

would evaluate to:
\\ '30+360*n1' '150+360*n2' \\ \\ '30+360*n1' '150+360*n2' \\ +
In both cases, the solution paths contain identical pseudo integer variables that would collide when the + operation is done.
How would the + operator know which variables were automatically created and which ones were not to avoid that collision?

\\ 'n1' \\ ASIN \\0.5\\ ASIN +

This would evaluate to:
\\ 'ASIN(n1)' '180-ASIN(n1)' \\ \\ '30+360*n1' '150+360*n2' \\ +

And then? How would you distinguish between the n1 in the first group and on the other group?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
newRPL: all results mode? - Claudio L. - 01-21-2016, 12:59 PM
RE: newRPL: all results mode? - rprosperi - 01-21-2016, 02:52 PM
RE: newRPL: all results mode? - Nigel (UK) - 01-21-2016, 04:14 PM
RE: newRPL: all results mode? - Claudio L. - 01-21-2016, 06:59 PM
RE: newRPL: all results mode? - rprosperi - 01-21-2016, 07:21 PM
RE: newRPL: all results mode? - Nigel (UK) - 01-22-2016, 09:13 AM
RE: newRPL: all results mode? - emece67 - 01-22-2016, 10:44 AM
RE: newRPL: all results mode? - Claudio L. - 01-22-2016, 01:41 PM
RE: newRPL: all results mode? - Claudio L. - 01-22-2016, 02:08 PM
RE: newRPL: all results mode? - Nigel (UK) - 01-24-2016, 07:08 PM
RE: newRPL: all results mode? - Claudio L. - 01-25-2016 02:31 PM
RE: newRPL: all results mode? - Nigel (UK) - 01-26-2016, 09:37 PM



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