2014-07-31 00:14 阅读 116

Golang中的Psi功能(“ digamma”)

I've been searching for a scientific computing library for golang that implements the digamma function, which is the logarithmic derivative of the gamma function.

I've attempted to implement the function myself, but I can only find explicit formulas for the digamma function evaluated at integers, but I need to be able to evaluate it at non-integer numbers.

Is anyone aware of a scientific computing package for go or of a precise formula for digamma?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

3条回答 默认 最新

  • 已采纳
    dongyuan1984 dongyuan1984 2014-08-03 00:24

    Okay, I ported some other simpler C Code from here. Might have been a slight copout, but I didn't want to deal with all the dependencies in the GSL code suggested by Marc, and I don't have much experience with C so it would have been an ordeal. This code tests successfully against wolfram alpha, though, so it may not be too much of a tradeoff.

    I put the little file on github, though it's not a go package. Just a simple file that implements the function and has a main routine that tests it.

    Here's the link to that. Thanks to Brett Beutell for the help.

    点赞 评论 复制链接分享
  • dpwle46882 dpwle46882 2014-07-31 11:02

    I have looked through github, gitbucket & godoc with no avail for over 1 hour, I can assert with almost 100% certainty there is no go implementation for the Digamma function.

    Your best bet would be to port the GSL C Code found here.

    点赞 评论 复制链接分享
  • duanhu2414 duanhu2414 2016-04-13 22:23

    Here is another implementation ported from C++/Boost: Digamma

    点赞 评论 复制链接分享