mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-25 05:38:46 -05:00
Remove an unused variable. Protect against extreme values leading to FPEs.
This commit is contained in:
parent
fbf288e271
commit
69619dd31e
@ -434,11 +434,14 @@ int q65_intrinsics_fastfading(q65_codec_ds *pCodec,
|
||||
|
||||
// exponentiate and accumulate the normalization constant
|
||||
sumix = 0.0f;
|
||||
for (k=0;k<nM;k++) {
|
||||
fTemp = expf(pCurIx[k]-maxlogp);
|
||||
pCurIx[k]=fTemp;
|
||||
sumix +=fTemp;
|
||||
}
|
||||
for (k=0;k<nM;k++) {
|
||||
float x=pCurIx[k]-maxlogp;
|
||||
if(x < -85.0) x=-85.0;
|
||||
if(x > 85.0) x= 85.0;
|
||||
fTemp = expf(x);
|
||||
pCurIx[k]=fTemp;
|
||||
sumix +=fTemp;
|
||||
}
|
||||
|
||||
// scale to a probability distribution
|
||||
sumix = 1.0f/sumix;
|
||||
@ -663,9 +666,11 @@ int q65_check_llh(float *llh, const int* ydec, const int nN, const int nM, const
|
||||
float t = 0;
|
||||
|
||||
for (k=0;k<nN;k++) {
|
||||
t+=logf(pIntrin[ydec[k]]);
|
||||
pIntrin+=nM;
|
||||
}
|
||||
float x=pIntrin[ydec[k]];
|
||||
if(x < 1.0e-36) x = 1.0e-36;
|
||||
t+=logf(x);
|
||||
pIntrin+=nM;
|
||||
}
|
||||
|
||||
if (llh!=NULL)
|
||||
*llh = t;
|
||||
|
@ -124,7 +124,6 @@ subroutine display(nkeep,ftol)
|
||||
line3(k)(35:38)//line3(k)(46:74)
|
||||
if(out(1:3).ne.' ') then
|
||||
cfreq0=out(1:3)
|
||||
if(iw.lt.MAXLINES-1) iw=iw+1
|
||||
livecq=line3(k)(6:13)//line3(k)(28:31)//line3(k)(39:45)// &
|
||||
line3(k)(23:27)//line3(k)(35:38)//line3(k)(46:70)// &
|
||||
line3(k)(73:77)
|
||||
|
Loading…
Reference in New Issue
Block a user