To get a number (s), which is distributed according to the probability density function f(x) in [s-,s+], solve the following equation:

where R is a random number in [0,1].