Debugging inverse CDF sampling for weights