'Runs tests for a unary function operating in the numerical real space.
Parameters
pyfunc : a python function definition holding that calls the numpy
functions to be tested.
x_types: the types of the values being tested, see numba.types
x_values: the numerical values of the values to be tested
flags: flags to pass to the CompilationCache::ccache::compile function
func_extra_types: the types of additional arguments to the numpy
function
func_extra_args:  additional arguments to the numpy function
ignore_sign_on_zero: boolean as to whether to allow zero values
with incorrect signs to be considered equal
prec: the required precision match, see assertPreciseEqual
Notes:
x_types and x_values must have the same length'

def run_unary(self, pyfunc, x_types, x_values, flags=no_pyobj_flags, func_extra_types=None, func_extra_args=None, ignore_sign_on_zero=False, abs_tol=None, **kwargs):

    for (tx, vx) in zip(x_types, x_values):
        if (func_extra_args is None):
            func_extra_types = func_extra_args = [()]
        for (xtypes, xargs) in zip(func_extra_types, func_extra_args):
            cr = self.ccache.compile(pyfunc, ((tx,) + xtypes), flags=flags)
            cfunc = cr.entry_point
            got = cfunc(vx, *xargs)
            expected = pyfunc(vx, *xargs)
            try:
                scalty = tx.dtype
            except AttributeError:
                scalty = tx
            prec = ('single' if (scalty in (types.float32, types.complex64)) else 'double')
            msg = ('for    input    %r    with    prec    %r' % (vx, prec))
            self.assertPreciseEqual(got, expected, prec=prec, msg=msg, ignore_sign_on_zero=ignore_sign_on_zero, abs_tol=abs_tol, **kwargs)
