On Wed, May 23, 2012 at 9:26 PM, [email protected]
<[email protected]> wrote:
> I am sorry for not participating in the pull request discussions.
> Maybe this was discussed, but why would you prefer this method instead
> of:
>
> In [3]: (f(x,y)+1).subs(f, Lambda([x, y], x+y))
> Out[3]: x + y + 1
>
> It seems that this does the same thing with a slightly different syntax.
At the suggestion of Aaron, the method also handles linear transforms
(which I am not sure the lambda handles):
```
assert (f(x, y) + f(x + 1, y)).rewrite(f(a - c, b), a**b) == \
(c + x)**y + (c + x + 1)**y
assert (f(x, y) + f(x + 1, y)).rewrite(f(1/a - c, b), a**b) == \
(1/(c + x))**y + (1/(c + x + 1))**y
```
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.