use double precision for large summations, #4408

This commit is contained in:
heckflosse
2018-02-21 14:28:54 +01:00
parent fc751a0cce
commit e69952d654
5 changed files with 13 additions and 14 deletions

View File

@@ -2002,8 +2002,7 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
hist16Q.clear();
}
float sum = 0.f;
// float sumQ = 0.f;
double sum = 0.0; // use double precision for large summations
#ifdef _OPENMP
const int numThreads = min (max (width * height / 65536, 1), omp_get_max_threads());
@@ -2023,7 +2022,6 @@ void ImProcFunctions::ciecam_02float (CieImage* ncie, float adap, int pW, int pw
hist16Qthr.clear();
}
// #pragma omp for reduction(+:sum,sumQ)
#pragma omp for reduction(+:sum)