cpp/numeric/random/piecewise linear distribution

produces random floating-point numbers, which are distributed according to a linear probability density function within each of the several subintervals. The distribution is such that the probability density at each interval boundary is exactly the predefined value.

The probability density for any is, where probability densities at interval boundaries  are calculated as  where  is the sum of all.

The set of interval boundaries and the set of weights at boundaries  are the parameters of this distribution.

satisfies all requirements of.