The variable \( r \), defined for \( r \in [0,\infty) \) needs to be related to to random numbers \( x'\in [0,1] \). To achieve that, we introduce a new variable $$ \begin{equation*} u=\frac{1}{2}r^2, \end{equation*} $$ and define a PDF $$ \begin{equation*} \exp{(-u)}du, \end{equation*} $$ with \( u\in [0,\infty) \). Using the results from example 2 for the exponential distribution, we have $$ \begin{equation*} u=-\ln{(1-x')}, \end{equation*} $$ where \( x' \) is a random number generated for \( x'\in [0,1] \).