Xavi Artigas - 2004-10-25

Hi,

Is there any good reason why, at the top of comm\rec_syst_conv_code.cpp, the function:

double com_logmap(double x, double y)
{

ifdef _MSC_VER

if (x>y) {
    return ( x + log( 1.0 + exp( -fabs(y-x) ) ) );
} else {
    return ( y + log( 1.0 + exp( -fabs(y-x) ) ) );
}

else

if (x>y) {
    return ( x + log( 1.0 + exp( -std::fabs(y-x) ) ) );
} else {
    return ( y + log( 1.0 + exp( -std::fabs(y-x) ) ) );
}

endif

}

cannot be substituted by:

double com_logmap(double x, double y)
{
if (x>y) {
return ( x + log( 1.0 + exp( y-x ) ) );
} else {
return ( y + log( 1.0 + exp( x-y ) ) );
}
}

I think the abs() is unnecessary, since we already know which one, x or y, is bigger, and that makes the #ifdef unnecessary too.

Am I right?

Xavi