common subexpressions
- To: mathgroup at smc.vnet.net
- Subject: [mg107520] common subexpressions
- From: Francky Leyn <francky.leyn at telenet.be>
- Date: Tue, 16 Feb 2010 03:50:17 -0500 (EST)
Hello, I have the following problem: I have a set of nonlinear equations in which many common subexpressions are equal. I mean things like this: the expression a^2 appears muliple times in the set of equations. In that case, it is more efficient to store this expression a^2 in memory and reuse it multiple times. This is more efficient than calculating it every time it occurs. This is demonstrated at: http://www.wolfram.com/technology/guide/CommonSubexpressionDetectionCollection/ My question: does Mathematica have a command to type out these common subexpressions and the rewritten expressions explicitely? Best regards, Francky Leyn