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

sympy.polys.polyerrors.NotAlgebraic Exception #21761

Open
proy87 opened this issue Jul 19, 2021 · 3 comments
Open

sympy.polys.polyerrors.NotAlgebraic Exception #21761

proy87 opened this issue Jul 19, 2021 · 3 comments
Labels

Comments

@proy87
Copy link

proy87 commented Jul 19, 2021

factor(-exp(x)*tan(pi/7) + 1, extension=True)
Without the extension flag everything is OK.

@oscarbenjamin
Copy link
Contributor

This works fine on master:

In [1]: factor(-exp(x)*tan(pi/7) + 1, extension=True)
Out[1]: 
 ⎛                   5π⎞            ⎞       
 ⎜                tan ⎜─⎟            ⎟       
 ⎜ xπ⎞       ⎝73π⎞⎟    ⎛π-  - 5tan⎜─⎟ - ─────── + 3tan ⎜─⎟⎟⋅tan⎜─⎟
 ⎝          ⎝777⎠⎠    ⎝7In [2]: factor(-exp(x)*tan(pi/7) + 1)
Out[2]: 
   xπ- tan⎜─⎟ + 17

Seems to have been fixed in cc7e4c7 from #21442

@proy87
Copy link
Author

proy87 commented Jul 19, 2021

@oscarbenjamin , I thought that extension works only on factoring binomials, not coefficients. Is there any way I can factor x**2+1 into (x-I)(x+I), but leave Ix-1 unchanged? If I add extension=True, then Ix-1 is factored as I(Ix+I).

@oscarbenjamin
Copy link
Contributor

When factor is used with an extension field it seems it always factors into monic irreducibles and separates out the coefficient.

skirpichev added a commit to skirpichev/diofant that referenced this issue Jul 20, 2021
Using _minpoly_compose(sin(ex.args[0])/cos(ex.args[0]), x, dom) is
too slow.  _minpoly_tan() was adapted from sympy/sympy#21442.

Closes sympy/sympy#21430
Closes sympy/sympy#21761
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants