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

Simplify NaNMath.pow substitution #689

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

devmotion
Copy link
Contributor

Line 149 was wrong, but it seems it was not caught by the tests since this simplification is applied already when the expression is constructed. Which made me wonder whether we could remove this branch completely from the NaNMath.pow substitution.

@AayushSabharwal
Copy link
Contributor

Does this not lose the inv transformation?

@devmotion
Copy link
Contributor Author

Initially I assumed it would, but based on the tests I ran it didn't, which is why I opted for removing this special branch completely. My hypothesis was that it is already covered by the existing rewriting/simplification performed for ^ at construction of the symbolic expression, as mentioned in https://docs.sciml.ai/SymbolicUtils/stable/#Simplification.

@AayushSabharwal
Copy link
Contributor

The NaNMath.pow case hits this, since while a ^ (-2) might transform into 1 / a ^ 2, NaNMath.pow(a, -2) transforms into a ^ (-2) which needs the rewrite rule.

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.

2 participants