Comment #16 on issue 829 by smi...@gmail.com: Improve simplify() to handle result from integrate(log(k**2-m**2), k)
http://code.google.com/p/sympy/issues/detail?id=829

simplify works fine on the original monstrosity and the modifications to simplify made as Mateusz improved polys are (should be) tested so I'm not sure that adding the following test is necessary. (It is, however, nice to know that the more efficient as_numer_denom routine allows this to be computed almost instantaneously, something that was not possible before that in even minutes of time.) So please mark it as you see fit. My vote is to just close the issue.

eq=S('''k**13/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 + 15*k**4*m**
... 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) - m**13/(-6*k**10*m**2
... + 15*k**8*m**4 - 20*k**6*m**6 + 15*k**4*m**8 - 6*k**2*m**10 + k**12 +
... m**12)*log(k**2 - m**2) + 2*m**13/(-6*k**10*m**2 + 15*k**8*m**4 -
... 20*k**6*m**6 + 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k + m)
... + k*m**12/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 + 15*k**4*m**8
... - 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) -
... m*k**12/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 + 15*k**4*m**8 -
... 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) -
... 40*k**6*m**7/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k + m) -
... 20*k**7*m**6/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) -
... 15*k**4*m**9/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) -
... 15*k**8*m**5/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) -
... 12*k**2*m**11/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k + m) -
... 12*k**10*m**3/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k + m) -
... 6*k**3*m**10/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) -
... 6*k**11*m**2/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) +
... 2*m*k**12/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 + 15*k**4*m**8
... - 6*k**2*m**10 + k**12 + m**12)*log(k + m) +
... 6*k**2*m**11/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) +
... 6*k**10*m**3/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) +
... 15*k**5*m**8/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) +
... 15*k**9*m**4/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) +
... 20*k**6*m**7/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k**2 - m**2) +
... 30*k**4*m**9/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k + m) +
... 30*k**8*m**5/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)*log(k + m) -
... 2*k**13/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 + 15*k**4*m**8 -
... 6*k**2*m**10 + k**12 + m**12) - 30*k**5*m**8/(-6*k**10*m**2 +
... 15*k**8*m**4 - 20*k**6*m**6 + 15*k**4*m**8 - 6*k**2*m**10 + k**12 +
... m**12) - 30*k**9*m**4/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12) -
... 2*k*m**12/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 + 15*k**4*m**8
... - 6*k**2*m**10 + k**12 + m**12) + 12*k**3*m**10/(-6*k**10*m**2 +
... 15*k**8*m**4 - 20*k**6*m**6 + 15*k**4*m**8 - 6*k**2*m**10 + k**12 +
... m**12) + 12*k**11*m**2/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12) +
... 40*k**7*m**6/(-6*k**10*m**2 + 15*k**8*m**4 - 20*k**6*m**6 +
... 15*k**4*m**8 - 6*k**2*m**10 + k**12 + m**12)''')
simplify(eq)
k*log(k**2 - m**2) - 2*k + 2*m*log(k + m) - m*log(k**2 - m**2)

In case anyone needs to rcover that expression, here it is in encoded form:

Copy the text between triple-# and paste it into an interactive session.

###
code = \
r'''begin 666 -
M'XL( .[#@U$"_\672Q*#( R&]SD%RXKC5,#GB;JP3N^_*PE4L3X&9R2N( GD
M&R(_( Q2*B/?G]?#]K0HQ&B;[(F60K.1V"LEND4N5(UVAV8E"M EF@V:S12M
MT.Q^<S5:JK11;'5F_9IRF@D"AQ!Q"(%M2.XA&*#%86AW67"&N+<L6/"XBNEK
MIR@G*]I630?L2-1?;2%RRW@4)37K+PKGJ+%[J%E!MVJ;9/NZ83TE8447PI0S
M.J5B<G D2E)'R/0:P01):F:MNEDMS6+6:A6@TTJUFF>U;$K5*RBS4FL:=HM2
M'9I#J32L9U9J".6]58WSWW*K>C;'K>H"BO=674#9M#J0*_:=!.>H^\>^]-R4
=7Q-?O./\F%_*,\GI,Y[Z=;C@'/H"GF=,E:T,
end
'''
def tug(string):
    """Return text of a uu encoded gzipped text."""
    import StringIO, uu, gzip
    f1 = StringIO.StringIO()
    f2 = StringIO.StringIO()
    f2.write(string)
    f2.seek(0)
    uu.decode(f2, f1)
    f2.seek(0)
    f2.flush()
    f1.seek(0)
    text = gzip.GzipFile(fileobj=f1, mode='rb')
    msg = text.read()
    [f.close() for f in [text, f1, f2]]
    return msg

code = tug(code)
import hashlib
if hashlib.md5(str(code)).hexdigest() == \
'6497254d2d424cb113cb172f731bed0e':
    sympify(code)
###

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

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


Reply via email to