File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -413,7 +413,7 @@ all_args="$all_args -Wformat=2"
413413all_args=" $all_args -Wno-format-nonliteral"
414414all_args=" $all_args -Wno-parentheses"
415415all_args=" $all_args -fvisibility=hidden -fvisibility-inlines-hidden"
416- all_args=" $all_args -fno-math-errno -fno-trapping-math"
416+ all_args=" $all_args -fno-math-errno -fno-trapping-math -fno-fast-math -ffp-contract=off "
417417# TODO: once we have highly efficient tightly looped code, try no -fpic and see if that makes better code. The compiler can save a register in this case. See https://akkadia.org/drepper/dsohowto.pdf
418418# TODO: check no-plt compiler option
419419all_args=" $all_args -fpic"
Original file line number Diff line number Diff line change @@ -1379,6 +1379,9 @@ static double Mean(const size_t cSamples,
13791379 // https://stackoverflow.com/questions/895929/how-do-i-determine-the-standard-deviation-stddev-of-a-set-of-values
13801380 // https://www.johndcook.com/blog/standard_deviation/
13811381
1382+ // do not put multiple floating point operations in the same statement since that can be optimized
1383+ // https://clang.llvm.org/docs/UsersManual.html
1384+
13821385 double factor = 1.0 ;
13831386 double mean;
13841387 size_t cNaN;
@@ -1440,7 +1443,8 @@ static double Mean(const size_t cSamples,
14401443 // if all the weights are zero, then weigh them all equally
14411444 ratio = double {1 } / static_cast <double >(cNormal);
14421445 }
1443- mean += numerator * ratio;
1446+ const double multiple = numerator * ratio;
1447+ mean += multiple;
14441448 }
14451449 if (nullptr != pWeight) {
14461450 ++pWeight;
You can’t perform that action at this time.
0 commit comments