More robust log_sum_exp()