Avoid accumulating the error arising from the difference between the internal and external simulation steps.
The order of iteration in this loop is significant, because it affects the assignment of canonic expression ids, and thus the sorting order of expressions. In order to stabilize it, convert the key list to an ordered set.
It turns out that it is not always faster, so make it controllable.
Implement MADD-aware treeify of sums when requested via :cuda-flags (:treeify-madd t); also force MADD in two special cases of ordered inner loop code.
Add code to determine that e.g. (+ a b c d) and (+ a c d) have a common subpart, and split it off so that it can be further exploited by the common subexpression elimination pass. Works by doing a O(N^2) intersection of all similar terms, and then extracting subsets in a certain order of precedence.
This allows tracking the reference properly.
The FFI wrappers throw an exception if that's not the case.
This is useful for some delayed initialization, or execute script interface hijacking (e.g. for dumps) The hooks are allowed to be symbols in order to accommodate for global function redefinition.
Wrap the lexer in a defcontext and reformat the code in Emacs. Also add the following enhancements: - Use && and || for boolean operations. - Add a boolean not operator: ! - Forbid non-whitespace between ; and the following newline to avoid confusion with lisp comments. - Support using #| ... |# comments inside formulas. - Support reverting to the lisp syntax via $(...) - Support backquote antiquotations via $,...
This allows removing the cached-simplifier hack. As a side effect, it uncovered a bug in the simplify pass.
It expands to a sequence of (text) and (recurse) calls. The code becomes less verbose, but somewhat more obscure.
The latter seems to be more organized.
If a significant number of terms belong to an outer loop level, group them into one term (significant number being 3, or 2 non-numeric). Additionally, convert the level computation from lists to FSet, implement a new macro for processing pipeline definition, and use it to include splitting into optimize-tree. Finally, fix correct-loop-levels: it must invalidate the level cache, or the destructive changes may be ignored.
As a positive side effect, add automatic removal of redundant items, i.e. (- a a) or (* a (/ a)).
The refactoring code destructively modifies some of the index range parameters, so they must remain shared throughout the expression restructuring passes. When the ranging spec is a list, ensuring this is difficult. This changes the mutable part of the range specification into a structure, providing macros to easily create and match such nodes. Code throughout the library is switched to the new format.