Issue 4142 in sympy: Wrong result from simplify

8 views
Skip to first unread message

sy...@googlecode.com

unread,
Feb 17, 2015, 9:22:00 AM2/17/15
to sympy-...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 4142 by van...@asu.cas.cz: Wrong result from simplify
https://code.google.com/p/sympy/issues/detail?id=4142

# Wrong result from simplify:

from sympy import Symbol,cos,sqrt,simplify,cosh,Rational

m=Symbol("m",positive=True)
e=Symbol("e",real=True,negative=False)

a1=cos(e)**2-cos(e)**4-Rational(1,4)+(cos(e)-cosh(m))**2+cos(2*e)**2/4
b1=(cos(e)-cosh(m))**2
print simplify(a1)-b1 # a1 is equal to b1, so the result is zero
# however, the original version and the simplified version yield
# different results in the following two identical expressions
# the first result is wrong, it has an opposite sign, because cosh(m) >
cos(e);
# the second result is true

print simplify(sqrt(a1))
print simplify(sqrt(simplify(a1)))

"""
Python 2.7.8 (default, Sep 30 2014, 15:34:38) [GCC] on linux2

output:

0
cos(e) - cosh(m)
Abs(cos(e) - cosh(m))

"""


--
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
Reply all
Reply to author
Forward
0 new messages