modified trigamma and added tests to check autodiff