On Jul 13, 2012, at 3:35 PM, rl <someb...@bluewin.ch> wrote:

> What if either argument is something like x - y or y - x?  Would those
both be canonicalized to the same thing (with either choice)?


I meant using expand_func with option b.

Aaron Meurer


No.

a) We pull out some factors and get legendre objects of same argument:

In [6]: legendre(n, y-x)
Out[6]: (-1)**n*legendre(n, x - y)

In [7]: legendre(n, x-y)
Out[7]: legendre(n, x - y)

b) Nothing happens beside what sympy does with the "Add"

In [6]: legendre(n, x-y)
Out[6]: legendre(n, x - y)

In [7]: legendre(n, y-x)
Out[7]: legendre(n, -x + y)

- If there ever could be a case where someone would not want it changed, go
> with option b, because, as with all automatic simplifications, option a
> makes it impossible to not have it applied.
>

At the moment I see no reason to do so.
But this does absolutely not mean that there never will be a reason.

> I personally would vote for option a as it would be consistent with
functions like sin and cos.

Me too. Most objects do some simpler transformation at this point. Option
b) is probably an overkill
in turning off automatic simplification features, compared to the rest of
sympy.

-- 
You received this message because you are subscribed to the Google Groups
"sympy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sympy/-/jUEDJo-rQpAJ.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sympy@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to