mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
* fix(simplify): Correct regression in simplify Also adds a 'debugConsole' option to simplify() so that it is possible to see the effect of each rule. This was critical to identifying the problem, which was that recent changes ended up with `simplifyConstant` in the wrong position in the list of rules. Correcting that also removed the need for the two rules coalescing negations with constants. Resolves #2393. * fix(simplify): Correct another regression based on rule ordering Disccovered that `x - (y-y+x)` had also stopped simplifying due to recent changes, again because of re-ordering of the rules. So added it to the tests, and fixed the rule ordering (adding a more extensive comment about it). A big part of the reason that rule ordering is so sensitive is that the reduction engine only checks once in each pass for each rule whether it matches. So an alternate fix to changing the rule ordering back would have been to re-check each rule after it's applied (in case its application created new instances of the rule) but since the re-ordering worked, that seemed simpler as a fix for now.