-
Notifications
You must be signed in to change notification settings - Fork 157
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
implement coeff
#677
implement coeff
#677
Conversation
bf53d3d
to
7594e71
Compare
I am wondering the expected results of the following cases.
|
This is tricky. What do you expect for this case?
|
Thanks for the comments.
These examples work if you julia> ((x + 1)^4 + x)^3 |> expand |> e -> coeff(e, x^2)
93
julia> (x^2 - 1) / (x - 1) |> simplify |> e -> coeff(e, x)
1 I believe it should be up to the user to
julia> (x^(1//2) + y^0.5)^2 |> expand |> e -> coeff(e, x)
1 Works after expansion too.
Agreed, so maybe let's focus on examples not involving quotients (monomials). This PR isn't meant to be exhaustive, but incremental.
Maybe the wording wasn't right, but to me clarity of the code is an enhancement. Consistency is also imo a necessity. I'll rephrase that. |
84518ca
to
5f9b686
Compare
Nice! Could you add doc strings for |
We have the same problem of too many exported symbols in
Added. |
Codecov Report
@@ Coverage Diff @@
## master #677 +/- ##
==========================================
- Coverage 76.99% 76.93% -0.06%
==========================================
Files 23 23
Lines 2712 2710 -2
==========================================
- Hits 2088 2085 -3
- Misses 624 625 +1
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
resolve #612 |
Thank you!! |
Hi,
This is a proposition in order to obtain the coefficients from
Symbolic
expressions (focusing on monomials).Fix #216.
Fix #374.
Fix #236.
I've also rewritten
degree
as anfc
in the same pattern ascoeff
for consistency (enhanceafter #241).Open question (which needs to be settled forcoeff
°ree
): how do we handleSymbolicUtils.Div
?degree(x / y, x)
currently throws aStackOverflowError
(added as a@test_broken
intest/degree.jl
).EDIT: handling
Div
is outside the scope of this PR.