Hello CAS fans,
The CAS of the hp 50g is powerfull but restricted, restricted in that way, that it doesn't perform non-equivalent term changes (don't misunderstand me, that is good!).
But the built in mechanism to fix a range of a variable is (in my eyes clumsy) and don't work properly in such situations.
So my idea is using the match command (to versions: bottom-up or top-down) for programming in user-RPL such non-equivalent rules (for example: ln(x^2) --> 2*ln(x) which is only possible for x > 0).
So the responsiblity is on the side of the user. He has to have in mind what the range of the used variables is.
It would be nice to have a lot of this programs for extending the CAS.
I will start with two rules:
The first one: XR2EXP will change the writing with root-sign into
writing with exponents (this doesn't touch the problem above, but it is a good exercise in using the match-command).
XR2EXP:The second: COLEX (COLlect EXponents) uses the rule: (A^B)^C = A^(B*C) (this touches the problem above) :
%%HP: T(3)A(R)F(,);
\<<
WHILE { '\v/&A' '&A^(1/2)' } \|^MATCH SWAP { 'XROOT(&A;&B)' '&B^(1/&A)' } \|^MATCH ROT OR
REPEAT
END
\>>
COLEX:Greetings
%%HP: T(3)A(R)F(,);
\<<
WHILE { '(&A^&B)^&C' '&A^(&B*&C)' } \|^MATCH SWAP EVAL EXP2POW XR2EX SWAP
REPEAT
END
\>>
peacecalc
Edited: 16 Dec 2012, 2:48 p.m.