jax.scipy.special.spence#

jax.scipy.special.spence(x)[原始碼]#

Spence 函數,也稱為實數值的雙對數函數。

JAX 實現的 scipy.special.spence

其定義為

\[\mathrm{spence}(x) = \begin{equation} \int_1^x \frac{\log(t)}{1 - t}dt \end{equation}\]

與 SciPy 實現不同,這僅針對 z 的正實數值定義。對於負值,將返回 NaN

參數:
  • zfloat32, float64 型別的陣列。

  • x (陣列)

回傳值:

具有 dtype=z.dtype 的陣列。Spence 函數的計算值。

引發:

TypeError – 如果陣列 z 的元素不在 (float32, float64) 中。

回傳型別:

陣列

註記:有一種不同的慣例透過積分定義 Spence 函數

\[\begin{equation} -\int_0^z \frac{\log(1 - t)}{t}dt \end{equation}\]

這是我們的 spence(1 - z)。