dEXP2 <-
function(x, alpha=1, log=FALSE)
{
if(alpha<0) stop("alpha must be less than 0")
log.f<-log(alpha)+(alpha-1)*log1p(-x)
if(log == FALSE) fy <- exp(log.f)
else fy <- log.f
fy <- ifelse(x <= 0 | x>=1, 0, fy)
fy
}
