better numerical stuff in sample_discrete_from_log_2d_destructive