I have the pdf of a random variable $x$ and it looks like $1-\exp(-x)$. I want to find a way to construct a method that picks random $x$ according to this distribution. Let's say by using another variable that has a uniform distribution. I tried doing so by calculating the CDF but this is unsolvable from what I understand.
The CLT method would look like: $t=\int_{0}^{x}{1−\exp(−x')}dx'=x+\exp(−x)−1$ when always $x>0$ and we solve for the uniformly distributed variable $t$. It turns out the solution is called the lambert $W$ function. But the solution is sometimes complex for some values of t. So I guess I don't have a real valued solution everywhere? Is there a workaround to solve this?
Notice that this isn't a regular exponential distribution otherwise it would have been simple. What would be a suggestion for a workaround?
Thanks.