logmdigamma | R Documentation |
The difference between the log
and digamma
functions.
logmdigamma(x)
x |
numeric vector or array of positive values. Negative or zero values will return |
digamma(x)
is asymptotically equivalent to log(x)
. logmdigamma(x)
computes log(x) - digamma(x)
without subtractive cancellation for large x
.
Gordon Smyth
Abramowitz, M., and Stegun, I. A. (1970). Handbook of mathematical functions. Dover, New York.
digamma
log(10^15) - digamma(10^15) # returns 0 logmdigamma(10^15) # returns value correct to 15 figures
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.