[INTERNAL] use 'boost::math::isnan' for NaN test (self-comparison may be optimized out with 'fast-math' compiler flag)