|
|
|
|
|
|
|
|
A Package For Code Optimization Using Mathematica
|
|
|
|
|
|
Organization: | Wolfram Research, Inc. |
Department: | Kernel Technology |
|
|
|
|
|
|
0206-592
|
|
|
|
|
|
2004-09-21
|
|
|
|
|
|
The package Optimize.m provides an efficient (linear time) means of expression optimization for Mathematica. The term "optimization" is used in the sense of reducing the arithmetic operation count. For the most part only exact, or syntactic, sub-expressions are matched. For example: the x+y in (x+y)*f(x+y) is considered as common, but not in x+y+f(x+y). Code optimization has many applications including speeding up numerics and graphics, improving the performance of canonical simplification and reducing the memory required to represent/store an expression. Optimized procedures and compiled procedures are possible. The procedure Horner factors polynomials in Horner form, an efficient form for numerical evaluation. The procedure Cost gives a count of the operators present in an expression. Optimize.m can also be used in conjunction with the auxiliary package Format.m (item 60) to produce optimized C and FORTRAN statement sequences.
The package Optimize.m is now obsolete and has be replaced by the built-in function Experimental`OptimizeExpression since version 4.1 of Mathematica. The package Format.m no longer needs Optimize.m to create an optimized expression sequence.
|
|
|
|
|
|
|
|
|
|
|
|
Conversion, C, code optimization, fortran, sub-expressions
|
|
|
|
|
|
|
|
|
|
|
|
http://www.wolfram.com/products/applications/mathcode/
|
|
|
|
|
|
| Optimize.m (22.8 KB) - Mathematica Package |
|
|