stan-dev / nomad

Fast autodiff.
Other
19 stars 2 forks source link

Implement Polygamma #3

Closed betanalpha closed 10 years ago

betanalpha commented 10 years ago

Need the polygamma function in order to compute derivatives of the gamma function and its derivatives. Should be able to produce a reasonable implementation by leveraging the generic recursion relation to transform the domain to (0, 1) and expand the polygamma around 0. Bonus points for going the other way and using the asymptotic expansion for large arguments.

With a polygamma implementation we can then implement the last cmath functions, http://www.cplusplus.com/reference/cmath/

betanalpha commented 10 years ago

Implemented in Commit 345f6dab3058cffac6e292b6bc08affe7cb8fa4a, quadgamma may cause problems for small arguments.