use cdec's logval with the eigen library to improve numerical stability