Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Modified _eval_nseries of Mul #14419

Closed
wants to merge 2 commits into from
Closed

[WIP] Modified _eval_nseries of Mul #14419

wants to merge 2 commits into from

Conversation

ArighnaIITG
Copy link
Member

Fixes #14068 .

Modified _eval_nseries in class Mul in sympy.core.mul according to the lines of @jksuom 's comment here.

NOW

>>> f = Function("f")
>>> x, logx = symbols('x logx')
>>> self = f(x)/x**10
>>> self._eval_nseries(x, 10, logx)
f(0)/x**10 + Subs(Derivative(f(_x), _x), (_x,), (0,))/x**9 + Subs(Derivative(f(_x), (_x, 2)), (_x,), (0,))/(2*x**8) + Subs(Derivative(f(_x), (_x, 3)), (_x,), (0,))/(6*x**7) + Subs(Derivative(f(_x), (_x, 4)), (_x,), (0,))/(24*x**6) + Subs(Derivative(f(_x), (_x, 5)), (_x,), (0,))/(120*x**5) + Subs(Derivative(f(_x), (_x, 6)), (_x,), (0,))/(720*x**4) + Subs(Derivative(f(_x), (_x, 7)), (_x,), (0,))/(5040*x**3) + Subs(Derivative(f(_x), (_x, 8)), (_x,), (0,))/(40320*x**2) + Subs(Derivative(f(_x), (_x, 9)), (_x,), (0,))/(362880*x) + Subs(Derivative(f(_x), (_x, 10)), (_x,), (0,))/3628800 + x*Subs(Derivative(f(_x), (_x, 11)), (_x,), (0,))/39916800 + x**2*Subs(Derivative(f(_x), (_x, 12)), (_x,), (0,))/479001600 + x**3*Subs(Derivative(f(_x), (_x, 13)), (_x,), (0,))/6227020800 + x**4*Subs(Derivative(f(_x), (_x, 14)), (_x,), (0,))/87178291200 + x**5*Subs(Derivative(f(_x), (_x, 15)), (_x,), (0,))/1307674368000 + x**6*Subs(Derivative(f(_x), (_x, 16)), (_x,), (0,))/20922789888000 + x**7*Subs(Derivative(f(_x), (_x, 17)), (_x,), (0,))/355687428096000 + x**8*Subs(Derivative(f(_x), (_x, 18)), (_x,), (0,))/6402373705728000 + x**9*Subs(Derivative(f(_x), (_x, 19)), (_x,), (0,))/121645100408832000 + O(x**10)

Previously , the same function gave only 10 terms with the last term coming upto O(1).
Here, it gives 20 terms with the last term being O(x**10).

@ArighnaIITG
Copy link
Member Author

@jksuom ,
I need some guidance in writing the test cases..

@ArighnaIITG ArighnaIITG changed the title Modified _eval_nseries of Mul [WIP] Modified _eval_nseries of Mul Mar 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

_eval_nseries of Mul is defective
2 participants