Histogram distribution function