Return the logarithm of the absolute value of the Gamma function at x.

def lgamma(x, context=None):
    """
    Return the logarithm of the absolute value of the Gamma function at x.

    """
    return _apply_function_in_current_context(
        BigFloat,
        lambda rop, op, rnd: mpfr.mpfr_lgamma(rop, op, rnd)[0],
        (BigFloat._implicit_convert(x),),
        context,
    )