[newbie] how to expand function to original variables



On Tue, 19 Feb 2013, Rupert Swarbrick wrote:

> Hugo Coolens <coolens at kahosl.be> writes:
>> I guess you mean something like this:
>>
>> 
>> subst([A=sqrt(p^2+2*p*sigma)-p,sigma=tau11+tau12+tau22,p=tau11*tau22],hjmax(A,sigma,p));
>>
>> This gives indeed the expression I wanted but I wonder whether this is
>> really the best way to go as I now have to supply once more the
>> information which I already supplied in statements 1, 2 and 3 in
>> the code below?
>
> Well, you should probably read Barton's original reply to you. That
> answers this question.
I followed your advice and this is what I guess should be the right way?
p:tau11*tau22;
sigma:tau11+tau12+tau22;
A:sqrt(p^2+2*p*sigma)-p;
hjmax(A,sigma,p):=sqrt((1+A/p)/((1-A/sigma^2)^2+A/p));
ev(hjmax(A,sigma,p));

Do you think this is OK?

thanks for your patience

hugo