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?
Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)
|
5
|
||||||||||||||
|
|
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 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'. |
||||||
|
You can accept an answer to one of your own questions by clicking the check mark next to it. This awards 15 reputation points to the person who answered and 2 reputation points to you.
|
0
|
Try automatic differentiation, which is exact but not symbolic. See also The Arithmetic of Differentiation by L. B. Rall. |
|||||
|

