a b/safe.exp.R
1
safe.exp <- function (x) 
2
{
3
  xx = sign(x) * pmin(abs(x), 500)
4
  return(exp(xx))
5
}