stan::math::exp(Eigen::Matrix) will have an specialized version for double that will check for nan inputs