Reduce_sum performance

Thanks nhuurre for the suggestion. That’s interesting because I already tried the trick exp(n*log(x)) in the bigger version of my model, as I discussed in this thread, and this seemed to make the code slower than looping. Surprisingly, when I try the trick in the simple model above the model runs in only 12 s! It’s amazing the large effect small changes can have, and such effect can be different depending on the model.