Nothing
#####
## DO NOT EDIT THIS FILE!! EDIT THE SOURCE INSTEAD: rsrc_tree/atoms/elementwise/loggamma.R
#####
## CVXPY SOURCE: atoms/elementwise/loggamma.py
## Loggamma -- piecewise linear approximation of log(gamma(x))
#' Elementwise log of the gamma function
#'
#' @description
#' Piecewise linear approximation of `log(gamma(x))`.
#' Has modest accuracy over the full range, approaching perfect accuracy
#' as x goes to infinity.
#'
#' @param x An Expression or numeric value (must be positive for DCP).
#' @returns A convex Expression representing log(gamma(x)).
#' @export
loggamma <- function(x) {
x <- as_expr(x)
Maximum(
2.18382 - 3.62887 * x,
1.79241 - 2.4902 * x,
1.21628 - 1.37035 * x,
0.261474 - 0.28904 * x,
0.577216 - 0.577216 * x,
-0.175517 + 0.03649 * x,
-1.27572 + 0.621514 * x,
-0.845568 + 0.422784 * x,
-0.577216 * x - log(x),
0.918939 - x - entr(x) - 0.5 * log(x)
)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.