5

Let $g(x) = \exp(f(x))$. Assuming numerical (or symbolic) values of $f(x), f'(x), f''(x), \ldots, f^{(n)}(x)$ are known, is there a way to compute $g'(x), g''(x), \ldots g^{(n)}(x)$ (or even the single value $g^{(n)}(x)$) for large $n$ that is faster than explicitly generating and evaluating the expanded symbolic derivative, a polynomial which has $p(n)$ (partition function) terms?

flag
1 
en.wikipedia.org/wiki/… – Steve Huntsman Jul 28 2010 at 0:07
2 
For a particular n the relevant polynomial is essentially the cycle index polynomial of S_n: qchu.wordpress.com/2009/06/24/… . So knowing how to do this computation for arbitrary f is essentially equivalent to knowing the cycle index polynomial, which encodes a lot of information. – Qiaochu Yuan Jul 28 2010 at 0:13
Thanks, this is the terminology I'm looking for. So I guess the question is: is there a better way than the naive one to evaluate this polynomial (the naive method being to generate the expanded polynomial and evaluate it term by term)? – Fredrik Johansson Jul 28 2010 at 1:18

2 Answers

2

Yes, you can. For example, the normal evaluation for $n=6$ requires 33 multiplications and 10 additions. But by using an optimized straight-line program which takes care of common subexpression elimination, you can reduce that to 17 multiplications, 10 additions and 4 assignments. For $n=8$, the reduction in multiplications goes from 84 down to 37, and at $n=12$, it goes from 397 down to 114.

Note that multiplication by constants (like $10f'(x)$) counts as a multiplication too.

You can experiment with these things by using the codegen package in Maple (especially the functions codegen[optimize] with the tryhard option, as well as codegen[cost]). If there is interest, I can post the details of the computation here.

Unfortunately, at this point, I do not immediately see a pattern in the results, so I am not sure how to automate this and produce optimized versions directly. But the answer to your original question is definitely 'yes'.

link|flag
Excellent! This doesn't really solve the problem for arbitrary n, though. – Fredrik Johansson Sep 9 2010 at 11:48
Indeed - and I did mention that in my answer. But I believe that at this point, you're all set for a bit of "experimental mathematics" where you stare at the results for sufficiently many n, see patterns, make conjectures, prove them, repeat. I would even be interested in helping such a project along - I just can't lead it, I've got too many other things already on the go. – Jacques Carette Sep 9 2010 at 12:25
0

Try automatic differentiation, which is exact but not symbolic. See also The Arithmetic of Differentiation by L. B. Rall.

link|flag
1 
I don't see how AD helps here. Rather, AD of nth order requires that the symbolic nth derivatives of atomic functions are already known. – Fredrik Johansson Jul 28 2010 at 1:09

Your Answer

Get an OpenID
or

Not the answer you're looking for? Browse other questions tagged or ask your own question.