Accurately computing the log-sum-exp and softmax functions | Synapse