fix a bug about HMM float overflow