Recursive Rewriting of Expressions
Requires a Wolfram Notebook System
Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.
Often a large expression has many subexpressions in common. Recursive rewriting consists of replacing each common part of an expression with a symbol instead of writing out the part explicitly. This shows the overall structure at different levels.[more]
Each such symbol is wrapped by a button; click one to see the level below it. Tooltips gives the subexpression with all constants replaced. Mouseover shows the ByteCount of the subexpression in red. Annotation shows the Leafcount, Length, and Depth of the argument. Finally, tree gives the TreeForm of the expression.[less]
Contributed by: Enrique Zeleny (August 2015)
Open content licensed under CC BY-NC-SA
This example use a root of a fourth-degree polynomial. A possible application is to shorten large arithmetic expressions to speed up their numerical evaluation. Based on an idea in .
 M. Trott, The Mathematica GuideBook for Programming, New York: Springer-Verlag, 2004.
"Recursive Rewriting of Expressions"
Wolfram Demonstrations Project
Published: August 3 2015