Comment #6 on issue 835 by [email protected]: limit((5**x+3**x)**(1/x), x, oo) TODO
http://code.google.com/p/sympy/issues/detail?id=835

in pull/61 this sort of expression generates the following:


    h[4] >>> log(1/x + (1/x)**log(4)).nseries(x, 0, 3)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "sympy\core\expr.py", line 875, in nseries
        return self._eval_nseries(x, n, taylor)
File "sympy\functions\elementary\exponential.py", line 452, in _eval_nseries
        obj = ln(lt) + ln(a)._eval_nseries(x, n)
File "sympy\functions\elementary\exponential.py", line 475, in _eval_nseries
        assert n>=0,`n`
    AssertionError: -5

The OP expression generates an infinite recursion that ends like this:
...
      File "sympy\core\power.py", line 715, in _eval_nseries
        nseries(x, n=n-e, taylor=taylor)).expand() +
      File "sympy\core\expr.py", line 875, in nseries
        return self._eval_nseries(x, n, taylor)
      File "sympy\core\power.py", line 715, in _eval_nseries
        nseries(x, n=n-e, taylor=taylor)).expand() +
      File "sympy\core\expr.py", line 875, in nseries
        return self._eval_nseries(x, n, taylor)
      File "sympy\core\power.py", line 704, in _eval_nseries
        b0 = b.limit(x,0)
      File "sympy\core\expr.py", line 889, in limit
        return limit(self, x, xlim, dir)
      File "sympy\series\limits.py", line 157, in limit
        return Add(*finite) + limit(Add(*unbounded), z, z0, dir)
      File "sympy\series\limits.py", line 166, in limit
        r = gruntz(e, z, z0, dir)
      File "sympy\series\gruntz.py", line 444, in gruntz
        return limitinf(e0, x)
      File "sympy\series\gruntz.py", line 343, in limitinf
        c0, e0 = mrv_leadterm(e,x)
      File "sympy\series\gruntz.py", line 399, in mrv_leadterm
        e_up = moveup([e],x)[0]
      File "sympy\series\gruntz.py", line 356, in moveup
        return [e.subs(x,exp(x)) for e in l]
      File "sympy\core\basic.py", line 705, in subs
        return self._subs_old_new(old, new)
      File "sympy\core\cache.py", line 85, in wrapper
        func_cache_it_cache[k] = r = func(*args, **kw_args)
      File "sympy\core\basic.py", line 714, in _subs_old_new
        return self._eval_subs(old, new)
      File "sympy\core\mul.py", line 936, in _eval_subs
Mul(*comms_final)._eval_subs(old,new))#*[c._eval_subs(old,new) for c in comm
    s_final])
      File "sympy\core\power.py", line 215, in _eval_subs
        b, e = self.base._eval_subs(old, new), self.exp._eval_subs(old, new)
      File "sympy\core\power.py", line 218, in _eval_subs
        return Pow(b, e)
      File "sympy\core\cache.py", line 85, in wrapper
        func_cache_it_cache[k] = r = func(*args, **kw_args)
      File "sympy\core\power.py", line 83, in __new__
        obj = b._eval_power(e)
File "sympy\functions\elementary\exponential.py", line 190, in _eval_power
        return exp(b.args[0] * e)
      File "sympy\core\multidimensional.py", line 136, in wrapper
        return f(*args, **kwargs)
      File "sympy\core\cache.py", line 85, in wrapper
        func_cache_it_cache[k] = r = func(*args, **kw_args)
      File "sympy\core\function.py", line 214, in __new__
        return Application.__new__(cls, *args, **options)
      File "sympy\core\multidimensional.py", line 136, in wrapper
        return f(*args, **kwargs)
      File "sympy\core\cache.py", line 85, in wrapper
        func_cache_it_cache[k] = r = func(*args, **kw_args)
      File "sympy\core\function.py", line 112, in __new__
        evaluated = cls.eval(*args)
      File "sympy\functions\elementary\exponential.py", line 40, in eval
        coeff = arg.as_coefficient(S.Pi*S.ImaginaryUnit)
      File "sympy\core\expr.py", line 317, in as_coefficient
        coeff = self.match(w * expr)
      File "sympy\core\basic.py", line 996, in match
        return pattern.matches(self, {})
      File "sympy\core\mul.py", line 562, in matches
        return AssocOp._matches_commutative(self, expr, repl_dict, evaluate)
      File "sympy\core\operations.py", line 173, in _matches_commutative
newexpr = self.__class__._combine_inverse(expr, self.__class__(*exact_part))

      File "sympy\core\mul.py", line 646, in _combine_inverse
        return Mul(*a)/Mul(*b)
      File "sympy\core\decorators.py", line 49, in __sympifyit_wrapper
        return func(a, sympify(b, strict=True))
      File "sympy\core\decorators.py", line 89, in binary_op_wrapper
        return func(self, other)
      File "sympy\core\expr.py", line 78, in __div__
        return Mul(self, Pow(other, S.NegativeOne))
      File "sympy\core\cache.py", line 85, in wrapper
        func_cache_it_cache[k] = r = func(*args, **kw_args)
      File "sympy\core\operations.py", line 39, in __new__
        c_part, nc_part, order_symbols = cls.flatten(map(_sympify, args))
      File "sympy\core\mul.py", line 298, in flatten
        c_part.sort(Basic.compare)
      File "sympy\core\basic.py", line 240, in compare
        c = cmp(self.__class__, other.__class__)
      File "sympy\core\core.py", line 258, in __gt__
        if cls.__cmp__(other)==1:
      File "sympy\core\core.py", line 228, in __cmp__
        if not isinstance(other, BasicType):
RuntimeError: maximum recursion depth exceeded while calling a Python object
    h[4] >>>

--
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