On 4/17/08, David Ronis <ronis at ronispc.chem.mcgill.ca> wrote:
> I define a function C(s,sp):= A(s+sp)+B(s,sp)+B(sp,s); where A and B
> are defined earlier in the code. Clearly, C(s,sp) should be symmetric
> in s and sp. However, if I simply type C(s,sp) at the maxima prompt,
> what I get isn't. On the other hand, C(x,y) is.
>
> Is this a bug or what am I not understanding?
Yes, it is a bug. Here is a simpler example:
foo (xx, yy) := sum (F(i, xx) * G(i, yy), i, 1, n);
foo (yy, xx);
=> 'sum(G(i,xx)*F(i,yy),i,1,n) OK
foo (yy, xx), simpsum;
=> 'sum(F(i,xx)*G(i,yy),i,1,n) OOPS
The summand is evaluated twice when simpsum=true
(which is a mistake, should be evaluated exactly once)
and with xx bound to 'yy and vice versa (from the function
call foo(yy, xx)), xx and yy are mistakenly swapped.
Lest anyone blame me for this mess, I will point out that this bug
is present in code which I preserved when I revised the
summation stuff in 2005.
Shouldn't be too hard to fix ... I'll take a look at it.
Robert Dodier