Approximate distribution of a complicated function of a random variable If $X$ is a random variable cdf $F(x)$ such that $F$ is invertible then we have the standard method of finding the pdf of any function of $X$, say,  $\sin(X) $  or $ X^3+1 $.However,in many situations we have very complicated composite  functions of random variables(with known distributions ,however).To take an example ,let $X_1,X_2,\dots,X_n$ be iid random variables following uniform distributions in the interval (0,1).Consider the following random varibales
$$ Y=\max_{1 \leq i
\leq n}X_i$$
$$ Z= \frac{1}{2}\left\{ 1+X_{n-1}+ \sqrt{\left(1-X_{n-1}\right)^2+4Y} \right\}$$
To the best of my knowledge, it is almost impossible to analytically find the distribution of the  $Z$. However, it is straight-forward to numerically simulate $Z$.I want to know if there are some methods of finding the approximate distributions of random variables defined like $Z$. Any references/links/hints/suggestions will be greatly appreciated. I believe the problem is of immense significance in the theory of probability and machine learning and other applied disciplines, but I honestly do not know much about it.

The general field you are alluding to is referred to as density estimation. Various approaches within can be treated across two high level categories:
Parametric Approach
Maximum likelihood estimators (or Bayesian Estimators) are commonly employed to infer the parameter vector that characterizes the assumed distribution from the data. The key here is "assumed", and it is justifiable only if you have some valid reason to believe that the data at hand can be modeled by a known parametric family of distributions.
Non-parametric Approach
A histogram is a simple and ubiquitous form of a non-parametric density estimate. Many non-parametric approaches are extensions of the classical histogram, for instance a kernel density estimator. Usually, the much weaker assumption you have to make here is that the underlying density is smooth, e.g. continuously differentiable. This is a good source with examples.
Whether parametric or non-parametric, one thing to note is that multivariate densities are usually much harder to estimate, due to the curse of dimensionality.
Python's ever-growingly encompassing library scikit-learn has some good coverage on Kernel density estimators. You can find it here.
I have only included practical links here. If anything tickles your fancy, Google Scholar: "density estimation" is your friend.
