Skip to content

Commit

Permalink
use std::log1p() with cl/icl on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kkm authored and kkm000 committed May 12, 2015
1 parent 0a17a84 commit 569c8c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/base/kaldi-math.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ inline double LogAdd(double x, double y) {

if (diff >= kMinLogDiffDouble) {
double res;
#ifdef _MSC_VER
#if _MSC_VER >= 1800 || __cplusplus >= 201103L
res = x + std::log1p(std::exp(diff));
#elif defined _MSC_VER
res = x + log(1.0 + exp(diff));
#else
res = x + log1p(exp(diff));
Expand All @@ -168,7 +170,9 @@ inline float LogAdd(float x, float y) {

if (diff >= kMinLogDiffFloat) {
float res;
#ifdef _MSC_VER
#if _MSC_VER >= 1800 || __cplusplus >= 201103L
res = x + std::log1p(std::exp(diff));
#elif defined _MSC_VER
res = x + logf(1.0 + expf(diff));
#else
res = x + log1pf(expf(diff));
Expand Down

0 comments on commit 569c8c2

Please sign in to comment.