added trigamma function and fixed digamma implementations