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 puts plus and minus signs next to eachother #2974

Closed
popiolek opened this issue Jun 19, 2023 · 2 comments
Closed

Simplify puts plus and minus signs next to eachother #2974

popiolek opened this issue Jun 19, 2023 · 2 comments

Comments

@popiolek
Copy link

Trying to use .simplify() function on string equations I came across some wiered behaviors.

Describe the bug
I would expect some simplifications, that I don't see in result:

  1. plus and minus signs are next to eachother (...a + -(3...)- I'd expect for plus to be reduced
  2. parenthesis is kept even though it doesn't have to be there (...+ -(3 * x) -...)
  3. Above simplifications work in case of ...+ (-2z)... being converted to ...- 2 * z - not sure if it's a bug, or some other problem.

To Reproduce

math.simplify("+3a + (-2z) + x * (-3)").toString({parenthesis: "auto", implicit: "hide"})

Result

"3 a + -(3 * x) - 2 * z"

Expected

"3 a - 3 * x - 2 * z"
@josdejong
Copy link
Owner

Thanks for reporting.

Anyone interested in debugging this and fine-tuning the rules of simplify?

@josdejong
Copy link
Owner

A fix is published now in v11.9.0

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

No branches or pull requests

2 participants