【问题标题】:trigamma and digamma functions for bigfloat variable in pythonpython中bigfloat变量的trigamma和digamma函数
【发布时间】:2023-12-25 10:21:01
【问题描述】:

我需要在 python 中计算类型为 bigfloat 的变量的 scipy.special trigamma 和 digamma 函数,但我收到以下错误消息:

TypeError: ufunc 'psi' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule 'safe'

出于精确目的,我需要将变量保持为 bigfloat。 有谁知道我如何计算这些变量的二伽马和三伽马函数? 谢谢。

【问题讨论】:

    标签: python derivative gamma-function bigfloat


    【解决方案1】:

    gmpy2mpmathPython-FLINT 中提供了digamma 的多种精度实现。我不知道 trigamma 的任何实现。

    免责声明:我维护gmpy2

    【讨论】:

    • trigamma 是 polygamma 的一个特例