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
(sin(x)/cos(x)).rewrite(tan(x)) should give tan(x) #16499
Comments
I see the rewriting works first by rewriting its elements Lines 1641 to 1644 in a7e6f09
because deep=True by default.And besides the fact that there is no individual rewriting method implemented in Mul , this may prevent any strategies to be implemented in top level.
I have one trivial example using pattern matching though,
But I suppose they are already handled better in |
Maybe a high-level Expr._eval_rewrite(tan) can call replace like that before recursing down. |
Also: In [44]: e
Out[44]:
cos(x)
──────
sin(x)
In [45]: e.rewrite(cot)
Out[45]:
2⎛x⎞
cot ⎜─⎟ - 1
⎝2⎠
───────────
⎛x⎞
2⋅cot⎜─⎟
⎝2⎠ |
Rewrite tan could be improved here:
I would like that to be just
tan(x)
.The text was updated successfully, but these errors were encountered: