Qualia  0.2
Macros
log_add.h File Reference
#include <qualia/core/common.h>
#include <math.h>
Include dependency graph for log_add.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define log1p(x)   log(1+(x))
 
#define LOG_2_PI   1.83787706640934548355
 
#define LOG_ZERO   -INF
 
#define LOG_ONE   0
 
real logAdd (real log_a, real log_b)
 
real logSub (real log_a, real log_b)
 logSub(log_a,log_b) = log(a-b) More...
 

Macro Definition Documentation

#define log1p (   x)    log(1+(x))
#define LOG_2_PI   1.83787706640934548355

Some simple functions for log operations.

Author
Samy Bengio (bengi.nosp@m.o@id.nosp@m.iap.c.nosp@m.h)
#define LOG_ONE   0
#define LOG_ZERO   -INF

Function Documentation

real logAdd ( real  log_a,
real  log_b 
)

logAdd(log_a,log_b) = log(a+b) = log(exp(log_a)+exp(log_b)) but done in a smart way so that if log_a or log_b are large but not their difference the computation works correctly.

real logSub ( real  log_a,
real  log_b 
)

logSub(log_a,log_b) = log(a-b)