36 vec
log2(
const vec &x) {
return apply_function<double>(
::log2, x); }
37 mat
log2(
const mat &x) {
return apply_function<double>(
::log2, x); }
40 double log_add(
double log_a,
double log_b)
47 double negdelta = log_b - log_a;
51 return (log_a + log1p(
std::exp(negdelta)));
double log_add(double log_a, double log_b)
Safe substitute for log(exp(log_a) + exp(log_b))
const double log_double_min
Constant definition to speed up trunc_log(), trunc_exp() and log_add()
Logarithmic and exponenential functions - header file.
vec exp(const vec &x)
Exp of the elements of a vector x.
vec log2(const vec &x)
log-2 of the elements
IT++ compatibility types and functions.