Skip to content

Commit

Permalink
Merge f369009 into b42421f
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev committed Jul 15, 2015
2 parents b42421f + f369009 commit 468ef6a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions sympy/functions/elementary/exponential.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,5 +827,17 @@ def _eval_is_algebraic(self):
else:
return s.is_algebraic

def _eval_nseries(self, x, n, logx):
if len(self.args) == 1:
from sympy import O, Add, Integer, factorial
x = self.args[0]
o = O(x**n, x)
l = S.Zero
if n > 0:
l += Add(*[Integer(-k)**(k - 1)*x**k/factorial(k)
for k in range(1, n)])
return l + o
return super(LambertW, self)._eval_nseries(x, n=n, logx=logx)


from sympy.core.function import _coeff_isneg
6 changes: 5 additions & 1 deletion sympy/functions/elementary/tests/test_exponential.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from sympy import (
symbols, log, Float, nan, oo, zoo, I, pi, E, exp, Symbol,
symbols, log, Float, nan, oo, zoo, I, pi, E, O, exp, Symbol,
LambertW, sqrt, Rational, expand_log, S, sign, conjugate,
sin, cos, sinh, cosh, tanh, exp_polar, re, Function, simplify)
from sympy.abc import x, y, z
Expand Down Expand Up @@ -364,6 +364,10 @@ def test_lambertw():
na = Symbol('na', nonzero=True, algebraic=True)
assert LambertW(na).is_algebraic is False

# See sympy/sympy#7259:
assert LambertW(x).series(x) == x - x**2 + 3*x**3/2 - 8*x**4/3 + \
125*x**5/24 + O(x**6)


def test_issue_5673():
e = LambertW(-1)
Expand Down

0 comments on commit 468ef6a

Please sign in to comment.