Ask Your Question
1

Integer polynomial factorization and RecursionError

asked 2 years ago

nickux gravatar image

Hi all,

I use sage to factorize integer polynomials, sometimes with very large coefficients. But when the polynomial is too large (for example a degree 3885), I get the following error

RecursionError: maximum recursion depth exceeded during compilation

I have tried to set a higher recursion limit through, e.g.

sys.setrecursionlimit(10000)

But I still get the same error. The script file is also large (more than 7Mb) and the sage.py file is even larger (22Mb).

Thanks for your help.

Preview: (hide)

Comments

Please provide an example illustrating the issue.

Max Alekseyev gravatar imageMax Alekseyev ( 2 years ago )

Sure. Here is a link to a script file producing such an error https://nick-ux.org/~regnault/example.sage (example.sage)

nickux gravatar imagenickux ( 2 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 2 years ago

nickux gravatar image

Ok.

I manage to find a workaround. For people interested in, I directly wrote a python code rather than letting sage writing its own python. From there, I split the polynomial such that each smaller polynomial contains at most 1000 terms. Then I define the full polynomial as the sum of these smaller ones.

Preview: (hide)
link

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2 years ago

Seen: 240 times

Last updated: Jan 10 '23