'Return self evaluated, if possible, replacing free symbols with
random complex values, if necessary.
The random complex value for each free symbol is generated
by the random_complex_number routine giving real and imaginary
parts in the range given by the re_min, re_max, im_min, and im_max
values. The returned value is evaluated to a precision of n
(if given) else the maximum of 15 and the precision needed
to get more than 1 digit of precision. If the expression
could not be evaluated to a number, or could not be evaluated
to more than 1 digit of precision, then None is returned.
Examples
>>> from sympy import sqrt
>>> from sympy.abc import x, y
>>> x._random()                         # doctest: +SKIP
0.0392918155679172 + 0.916050214307199*I
>>> x._random(2)                        # doctest: +SKIP
-0.77 - 0.87*I
>>> (x + y/2)._random(2)                # doctest: +SKIP
-0.57 + 0.16*I
>>> sqrt(2)._random(2)
1.4
See Also
sympy.utilities.randtest.random_complex_number'

def _random(self, n=None, re_min=(-1), im_min=(-1), re_max=1, im_max=1):

    free = self.free_symbols
    prec = 1
    if free:
        from sympy.utilities.randtest import random_complex_number
        (a, c, b, d) = (re_min, re_max, im_min, im_max)
        reps = dict(list(zip(free, [random_complex_number(a, b, c, d, rational=True) for zi in free])))
        try:
            nmag = abs(self.evalf(2, subs=reps))
        except (ValueError, TypeError):
            return None
    else:
        reps = {}
        nmag = abs(self.evalf(2))
    if (not hasattr(nmag, '_prec')):
        return None
    if (nmag._prec == 1):
        from mpmath.libmp.libintmath import giant_steps
        from sympy.core.evalf import DEFAULT_MAXPREC as target
        for prec in giant_steps(2, target):
            nmag = abs(self.evalf(prec, subs=reps))
            if (nmag._prec != 1):
                break
    if (nmag._prec != 1):
        if (n is None):
            n = max(prec, 15)
        return self.evalf(n, subs=reps)
    return None
