Skip to content

Extremely long time to compute simple series #26100

Open
@elexunix

Description

$ python3
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import series, exp
>>> from sympy.abc import x
>>> from time import time
>>> for n in range(1, 101):
...     t0 = time(); _ = series(exp(1 - exp(x)), x, n=n); print(n, time() - t0)
... 
1 0.05832052230834961
2 0.0792999267578125
3 0.12102556228637695
4 0.142164945602417
5 0.20810937881469727
6 0.2985231876373291
7 0.4627223014831543
8 0.7917144298553467
9 1.592421054840088
10 3.8713343143463135
11 12.383564710617065
12 45.100839614868164
13 175.42633605003357
14 698.1054706573486
15 2677.1742584705353

I expected to find, say, the first 20 coefficients without any problems. This seems to be just a composition of two polynomials of degree 20, which can be computed very fast..

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions