-
Notifications
You must be signed in to change notification settings - Fork 8
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
Expression.equals fails sometimes, expandAndSimplify is the culprit #117
Comments
I'm not so sure that simplification is the right way to go about this, I just used what I had available. |
I think you're right, expanding makes sense. I'm not entirely sure expanding is going to give a canonical form, though (which seems to be the problem here anyway), so that'll need to be fixed. The simple solution is to call expand until the expression no longer changes, but that's pretty slow. |
I started experimenting with writing a canonicalization function on this branch. It still needs work. There is currently an issue with distribution of division, which I find odd, because distribution of powers appears to work OK and division is just multiplication by Pow(base, -1). My approach, so far, is as follows:
Also, although I wrote a separate implementation, I think there is some overlap between |
That looks really good! I'd definitely expect overlap between But yeah, looks great so far! |
So
@expr.expandAndSimplify
isn't fully simplifying. I'm not really sure why, but one possible (bad?) solution is to just keep simplifying until the expression no longer changes.The text was updated successfully, but these errors were encountered: