<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _factln(num):
 # type: (int) -> float """ Computes logfactorial regularly for tractable numbers, uses Ramanujans approximation otherwise. """


    if num < 20:
        log_factorial = log(factorial(num))
    else:
        log_factorial = num * log(num) - num + log(num * (1 + 4 * num * (
            1 + 2 * num))) / 6.0 + log(pi) / 2

    return log_factorial