Imagine we know the summation of a list of numbers (that is computed by dynamic programming):
a+b+c+d+...
How can we compute the sum of exponentials of these numbers without re-iterating over all numbers:
Math.exp(a)+Math.exp(b)+Math.exp(c)+...
Just a side note, if needed: The numbers are the probabilities of the paths in a lattice structure. The summation of the probabilities of all paths is computed by dynamic programming. However, I need the exponential sum without re-iterating over the lattice structure.