Computation of a chemical potential using a residence weight algorithm.