Terms in the sum are always less (or equal) to 1 (by definition) and are evaluated only if its contribution to the sum is significant -- for now that means if they are greater than 1e-8. This accuracy will be a free parameter of simulations in the future.
Solved problems with overflowing by not evaluating the exponential directly but by storing the highest exponent and writing the sum as:
Terms in the sum are always less (or equal) to 1 (by definition) and are evaluated only if its contribution to the sum is significant -- for now that means if they are greater than 1e-8. This accuracy will be a free parameter of simulations in the future.