Ask Your Question

Wrzlprmft's profile - activity

2013-08-08 13:02:54 +0200 commented answer Auto-substitute complex term to ease numeric evaluation

Thank you, but unfortunately, the automatisation (or more specifically the automatic detection of possible substitutions) is what I really need.

2013-08-07 12:55:32 +0200 received badge  Editor (source)
2013-08-07 12:55:00 +0200 asked a question Auto-substitute complex term to ease numeric evaluation

I have a very large symbolic term (mainly composed of sums, products and divisions) and, using substitutions, I want to reformulate it in a way that avoids repetitions and thus can be evaluated using less arithmetic operations.

For example, if I have a term like

X = (d*(a-b)/(1 + a-b))^2 + d*(a-b)/(1 + a-b) + exp(d*(a-b)/(1 + a-b)) + a-b,

I want a function that returns something like:

S1 = a-b
S2 = d*S1/(1+S1)
X  = S2^2 + S2 + exp(S2) + S1

Giving me instructions how to more efficiently calculate X: First calculate S1, then S2 using S1 and finally X using S1 and S2.

My actual problem is much nastier and I do not need optimal or near-optimal results, but any way of automatising such substitutions.