Status: Valid
Owner: ----
Labels: Type-Defect Priority-Medium Simplify
New issue 3609 by [email protected]: KeyError in trigsimp
(cot(x).equals(tan(x)))
http://code.google.com/p/sympy/issues/detail?id=3609
In [32]: cot(x).equals(tan(x))
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
<ipython-input-32-87c7ff14ecd9> in <module>()
----> 1 cot(x).equals(tan(x))
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/expr.pyc in
equals(self, other, failing_expression)
565 return False
566
--> 567 constant = diff.is_constant(simplify=False,
failing_number=True)
568 if constant is False or \
569 not diff.free_symbols and not diff.is_number:
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/expr.pyc in
is_constant(self, *wrt, **flags)
500 b = self._random(None, 1, 0, 1, 0)
501 if b is not None and b is not S.NaN:
--> 502 if b.equals(a) is False:
503 return False
504 # try random real
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/expr.pyc in
equals(self, other, failing_expression)
554 # simplification steps that are done will be very fast.
555 diff = (self - other).as_content_primitive()[1]
--> 556 diff = factor_terms(diff.simplify(), radical=True)
557
558 if not diff:
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/expr.pyc in
simplify(self, ratio, measure)
2744 from sympy.core.function import count_ops
2745 measure = measure or count_ops
-> 2746 return simplify(self, ratio, measure)
2747
2748 def nsimplify(self, constants=[], tolerance=None, full=False):
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/simplify.pyc
in simplify(expr, ratio, measure)
3727
3728 if expr.has(C.TrigonometricFunction) or
expr.has(C.HyperbolicFunction):
-> 3729 expr = trigsimp(expr, deep=True)
3730
3731 if expr.has(C.log):
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/simplify.pyc
in trigsimp(expr, **opts)
1440 result = g
1441 else:
-> 1442 result = trigsimpfunc(expr, deep)
1443
1444 return result
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/simplify.pyc
in <lambda>(x, d)
1424
1425 trigsimpfunc = {
-> 1426 'matching': (lambda x, d: _trigsimp(x, d)),
1427 'groebner': (lambda x, d: groebnersimp(x, d, **opts)),
1428 'combined': (lambda x, d: _trigsimp(groebnersimp(x,
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/simplify.pyc
in _trigsimp(expr, deep)
1635 # trig patterns to enter the cache
1636 if expr.has(*_trigs):
-> 1637 return __trigsimp(expr, deep)
1638 return expr
1639
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/cache.pyc in
wrapper(*args, **kw_args)
90 except KeyError:
91 pass
---> 92 func_cache_it_cache[k] = r = func(*args, **kw_args)
93 return r
94 return wrapper
/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/simplify/simplify.pyc
in __trigsimp(expr, deep)
1734 while m is not None:
1735 if m[a_t] == 0 or \
-> 1736 -m[a_t] in m[c].args or m[a_t] + m[c] == 0:
1737 break
1738 if d in m.keys() and m[a_t]*m[d] + m[c] == 0:
--
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.