optimized SoftMaxTree_updateOutput