|View source on GitHub|
Returns lgamma(y) - lgamma(x + y), accurately.
tfp.substrates.numpy.math.log_gamma_difference( x, y, name=None )
This is more accurate than subtracting lgammas directly because lgamma grows
x log(x) - x + o(x), and thus subtracting the value of lgamma for two
close, large arguments incurs catastrophic cancellation.
y >= 8, the method is to partition lgamma into the Stirling
approximation and the correction
log_gamma_correction, symbolically cancel
the former, and compute and subtract the latter.
||Floating-point Tensor, the difference lgamma(y) - lgamma(x+y), computed elementwise.|