Commit 2c442d26 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower Committed by TensorFlower Gardener
Browse files

Implement digamma for XLA

Compute the Lgamma function using Lanczos' approximation from "A Precision Approximation of the Gamma Function". SIAM Journal on Numerical Analysis series B. Vol. 1:
digamma(z + 1) = log(t(z)) + A'(z) / A(z) - kLanczosGamma / t(z)
t(z) = z + kLanczosGamma + 1/2
A(z) = kBaseLanczosCoeff + sigma(k = 1, n, kLanczosCoefficients[i] / (z + k))
A'(z) = sigma(k = 1, n, kLanczosCoefficients[i] / (z + k) / (z + k))

PiperOrigin-RevId: 204834091
parent 6bfa38ef
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment