Comment #20 on issue 1985 by asmeurer: as_real_imag() gives wrong answer when expanding quotient
http://code.google.com/p/sympy/issues/detail?id=1985

Well, that isn't true anymore. The way it is after my patch, as_real_imag() performs complex expansion to obtain the real and imaginary parts, and expand(comlex=True) and re() and im() just trivial call as_real_imag().

i.e., expand(complex=True) is (now) just a nice wrapper around

re_part, im_part = expr.as_real_imag()
return re_part + I*im_part

re() and im() are mostly useful as dummy/unevaluated type functions, except that they try to evaluate themselves by default (maybe they should really be Re() and Im(), which would also fix issue 1727, btw). Also, if as_real_imag() can't determine for sure, it falls back onto those (like in comment 13).

The main point of my patch is that now all the heavy lifting is done in as_real_imag() instead of _eval_expand_complex(), which is much better because it keeps the real and imaginary parts separate.

But these things should be moved into their respective issues, or new issues if they don't fit anywhere.

By the way, "complex" expansion refers to the the real+imag complex, not "complicated".

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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-issues?hl=en.

Reply via email to