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

early termination in diff #279

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

jverzani
Copy link
Contributor

@jverzani jverzani commented Mar 2, 2025

This implements suggestion in #225 to have a step for early termination in diff if possible.
This passes on #225; the additional allocations to check for early termination would be paid in every instance; whereas the suggestion of #225 only pays off in certain situations. (The allocation could be avoided by some call to basic_has_symbol, but even that had a performance cost)

  • extends diff interface closer to SymPy by allowing expressions like diff(ex, x, 2, y).
  • does not cover diff(ex, (x,2)) interface of SymPy, as that method is used otherwise. (would fix were it not breaking)
  • adds tests
  • clean up one verbose test by using repr

@jverzani jverzani mentioned this pull request Mar 2, 2025
@jverzani jverzani requested a review from isuruf March 3, 2025 20:55
@jverzani
Copy link
Contributor Author

jverzani commented Mar 3, 2025

There are two things here: one extends the interface, the other closes #225. The latter adds a check for whether the expression is zero. As such, it may be a performance concern. I didn't benchmark, But if there is a concern, I can modify this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant