8000 real_root and rewriting · sympy sympy · Discussion #27731 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

real_root and rewriting #27731

Answered by oscarbenjamin
bjodah asked this question in Q&A
Mar 10, 2025 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

The docstring says: This will only create a real root of a principal root.

How would you define in general the behaviour that you expect here? The input is some complex number and you want a real number that is a different root of the same polynomial?

Something like:

In [11]: [r for r in roots(minpoly(1/cbrt(-2))) if r.is_real]
Out[11]:
⎡  2/3 ⎤
⎢-2    ⎥
⎢──────⎥
⎣  2

In general it is probably better to use 1 / real_root(-2, 3) in the first place because I'm not sure how this is well defined if starting from arbitrary complex numbers.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bjodah
Comment options

bjodah Mar 10, 2025
Collaborator Author

Answer selected by bjodah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
0