   Minimize arithmetic operations
  I used maple (math program) to symbolically solve a hellish system of nonlinear equations, related to interpolation in simulated fluid flow. However, the resulting answer is a mess with over _2 pages_ of additions, subtractions, multiplications, and divisions per result (well over 1000 operations each). I'm pretty sure its correct since I have checked many special cases in maple and they all agree with what I should get.To give you an idea, my resulting constants look like this:c1 = -5*p12*sz3^2*a2-b*p42*p33*s11*s23+p*p42*p33*s13*s12+b*p31*p41*s22*s22+...... (2 more pages of this junk)c2 = 2*b*p23*p43*s12^2+p23*p11*s33**s23+...... (2 more pages)...c10 = ...Now I want to use the results in my code, but the number of operations (1000+) is creating problems. I have to do these calculations for every element of a big mesh, at every timestep. Furthermore, actually typing the expressions into my code would be humongously tedious and error-prone.Is there a way to analyze a huge expression, so as to rewrite it in the most concise way possible (fewest operations) by grouping terms, factoring, etc?   
  See what Maple's simplify() can do for it.   ;  simplify() makes it worse! ):   ;  If simplify doesn't help, probably there isn't any simple way to write that equation. You shold probably try to use a numerical solver instead.   ;  Maybe you can find aproximations for some of your equations that aren't so complex?You might find, for instance that in the grand scheme of things, certain terms may be nearly constant for your needs.good game programming is about creating cheap illusions that look like reality, not about getting it as close to reality as possible!   ;  Factoring in Maple is usually done with factor(exp). If it doesn't feel any better, you can prompt Maple to output C code directly from the expression. Then at least the 'error-prone' part will have much less impact in your decision.   ;  Ok, I stared at the equations for many hours and managed to simplify it to around 200 operations per result. I think this will be sufficient for my purposes. Thanks everyone for your input.   