Closed rtoy closed 3 months ago
Imported from SourceForge on 2024-07-03 01:59:52 Created by tomasriker on 2016-12-02 03:43:00 Original: https://sourceforge.net/p/maxima/bugs/3255/#bc92
Fixed by commit [0e4ed4].
Imported from SourceForge on 2024-07-03 01:59:56 Created by tomasriker on 2016-12-02 03:43:16 Original: https://sourceforge.net/p/maxima/bugs/3255/#8ac1
Imported from SourceForge on 2024-07-03 01:59:51 Created by tomasriker on 2016-12-01 03:06:49 Original: https://sourceforge.net/p/maxima/bugs/3255
Resimplification of an expression happens at quite some places within Maxima. It is currently implemented as follows: A global flag
dosimp
is set toT
, thensimplifya
is called. Whendosimp
isT
,simplifya
ignores the'simp
tag at the beginning of the internal representation of an expression and simplifies it anyway. This is problematic because the advantage of the'simp
tag cannot be used during resimplification. It may happen that the same subexpression is simplified multiple times. An extreme example can easily be constructed where normal simplification finishes instantly and resimplification takes several seconds:Tracing the rule functions shows that during resimplification, they are called many times for the same subexpression. This is because the
dosimp
flag is set toT
, and therefore already simplified subexpressions are treated as unsimplified.Proposed fix: When
simplifya
sees thatdosimp
is set toT
, it should remove all'simp
tags from the entire expression, then setdosimp
tonil
and continue simplifying normally. This way, intermediate simplified subexpressions don't have to be resimplified.