Haskell math performance
- by Travis Brown
I'm in the middle of porting David Blei's original C implementation of Latent Dirichlet Allocation to Haskell, and I'm trying to decide whether to leave some of the low-level stuff in C. The following function is one example—it's an approximation of the second derivative of lgamma:
double trigamma(double x)
{
double p;
int i;
x=x+6;
…