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 can't simplify a/(b/c) #1725

Closed
thunderkid opened this issue Jan 27, 2020 · 5 comments · Fixed by #1734
Closed

Simplify can't simplify a/(b/c) #1725

thunderkid opened this issue Jan 27, 2020 · 5 comments · Fixed by #1734

Comments

@thunderkid
Copy link

I'm finding that simplify isn't working well with ratios of monomials.
I think this is probably due to it not even being able to simplify a/(b/c) - it just returns the same thing.

This is most obvious when you give it a/(a/c). Instead of giving c it just gives you back a/(a/c).

To work around this, I'm currently trying to use a patchwork of simplify and rationalize calls.
eg I use rationalize for
a/(a/c) -> a*c/a
then use simplify for
a*c/a -> c

For more complex examples, I loop through rationalize then simplify several times. This approach is obviously very ugly and unpredictable, and anyhow can't be used for a lot of monomials since rationalize crashes on them due to #1724.

@josdejong
Copy link
Owner

Would be nice to improve this! Thanks for your feedback.

Anyone interested in looking into rules to simplify expressions like a/(b/c)?

@josdejong
Copy link
Owner

Fixed via #1734 (fix not yet published)

@thunderkid
Copy link
Author

Not sure how your new fix will perform on more general expressions, but I've just been testing the Algebrite library, which seems to do a pretty good job simplifying, eg, ratios of monomials. I'll be interested to test it against the new mathjs version when it's published. In principle, if the Algebrite engine still performs better, would it make sense to try to implement some of their CAS algorithms in mathjs, or is the underlying architecture too different? (Aside from being coffeescript...)

@josdejong
Copy link
Owner

Yes Algebrite is really impressive! I'm totally open to see if we can somehow integrate, or at least draw inspriation from the way Algebrite solves equations.

@josdejong
Copy link
Owner

This fix is published now in v6.6.1. Sorry for the delay.

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

Successfully merging a pull request may close this issue.

2 participants