New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pretty print incorrect result with powers of sin #7927

Closed
cbm755 opened this Issue Aug 27, 2014 · 0 comments

Comments

Projects
None yet
2 participants
@cbm755
Copy link
Contributor

cbm755 commented Aug 27, 2014

In [38]: x = S('x')

In [39]: w = sin(x/2)

In [40]: f = w**w

In [41]: f
Out[41]: sin(x/2)**sin(x/2)

In [42]: pprint(f)
      ⎛x⎞⎛x⎞
sinsin⎜─⎟⎜─⎟
      ⎝2⎠⎝2⎠

viz. following which gives a clue what went wrong:

In [50]: pprint(w**cos(x))
   cos(x)⎛x⎞
sin      ⎜─⎟
         ⎝2⎠

I wonder if there should be some limit on complexity of b in using (a**b)(x) instead of (a(x))**b. If b is "too big" then prefer the latter?

@skirpichev skirpichev added the Printing label Aug 28, 2014

cbm755 added a commit to cbm755/sympy that referenced this issue Feb 26, 2015

pprint: lift the baseline for Pow in Func**Pow
If Pow has height larger than 1, it will need lifted further.  So
lift its baseline according to its height.  Add tests.

Fixes sympy#7927.

@jcrist jcrist closed this in #9058 Apr 15, 2015

mcho421 added a commit to mcho421/sympy that referenced this issue May 4, 2015

pprint: lift the baseline for Pow in Func**Pow
If Pow has height larger than 1, it will need lifted further.  So
lift its baseline according to its height.  Add tests.

Fixes sympy#7927.

skirpichev added a commit to diofant/diofant that referenced this issue Jul 1, 2015

pprint: lift the baseline for Pow in Func**Pow
If Pow has height larger than 1, it will need lifted further.  So
lift its baseline according to its height.  Add tests.

Fixes sympy/sympy#7927.

skirpichev added a commit to diofant/diofant that referenced this issue Jul 3, 2015

pprint: lift the baseline for Pow in Func**Pow
If Pow has height larger than 1, it will need lifted further.  So
lift its baseline according to its height.  Add tests.

Fixes sympy/sympy#7927.

skirpichev added a commit to diofant/diofant that referenced this issue Jul 3, 2015

pprint: lift the baseline for Pow in Func**Pow
If Pow has height larger than 1, it will need lifted further.  So
lift its baseline according to its height.  Add tests.

Fixes sympy/sympy#7927.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment