Compute the nth derivative for Psi or the Digamma function.
Copied from the GSL library function gsl_sf_psi_n_e in psi.c line 768.
the dependency between functions here in the GSL is a bit messy.
the function calls log factorial gsl_sf_lnfact_e which is part of the log gamma family
and indirectly depends on log gamma itself for approximation.
at the same time, log gamma indirectly also depends on polygamma.
this is a circular reference. Hence the approximation function needs to be passed through at runtime.
Compute the nth derivative for Psi or the Digamma function.
Copied from the GSL library function gsl_sf_psi_n_e in psi.c line 768. the dependency between functions here in the GSL is a bit messy. the function calls log factorial gsl_sf_lnfact_e which is part of the log gamma family and indirectly depends on log gamma itself for approximation. at the same time, log gamma indirectly also depends on polygamma. this is a circular reference. Hence the approximation function needs to be passed through at runtime.