Wolfram Library Archive

All Collections Articles Books Conference Proceedings
Courseware Demos MathSource Technical Notes
Title Downloads

Basic structural optimization of expressions

Terry Robb
Organization: RMIT University
Department: Department of Mathematics
Revision date


Basic structural optimization of expressions.

A classic program written in Mathematica version 2, and still working unchanged in Mathematica version 5.

In 19 lines, the definition of the Optimize[expr_] function manages to use no less that 28 diverse Mathematica functions including: Append, Apply, Count, DeleteCases, Depth, Drop, First, Flatten, Fold, FoldList, Last, Length, Level, List, Literal, Map, MapIndexed, Partition, Position, ReplaceAll, Reverse, Rule, Select, Table, Take, Transpose, and Union.

All it all does something very useful.

*Mathematica Technology > Programming

optimize, efficiency, compiling, optimization, expression, syntactic optimization, structural optimization
Downloads Download Wolfram CDF Player

Optimize.m (7.4 KB) - Mathematica Package