Work around compiler issue with random test
commitfa1d62c66cfd845fcfda33783a7881bca7aa8c1d
authorErik Lindahl <erik@kth.se>
Thu, 7 Jul 2016 23:05:17 +0000 (8 01:05 +0200)
committerErik Lindahl <erik@kth.se>
Fri, 8 Jul 2016 09:08:31 +0000 (8 11:08 +0200)
treee7a4c729d29596a1bc73bba9b93e01ca8648c071
parent55c3a19d9b4c373d321f6e126dacc19559127620
Work around compiler issue with random test

gcc-4.8.4 running on 32-bit Linux fails a few
tests for random distributions. This seems
to be caused by the compiler doing something
strange (that can lead to differences in the lsb)
when we do not use the result as floating-point
values, but rather do exact binary comparisions.
This is valid C++, and bad behaviour of the
compiler (IMHO), but technically it is not required
to produce bitwise identical results at high
optimization. However, by using floating-point
tests with zero ULP tolerance the problem
appears to go away.

Fixes #1986.

Change-Id: I252f37b46605424c02435af0fbf7a4f81b493eb8
src/gromacs/random/tests/exponentialdistribution.cpp
src/gromacs/random/tests/gammadistribution.cpp
src/gromacs/random/tests/normaldistribution.cpp
src/gromacs/random/tests/tabulatednormaldistribution.cpp
src/gromacs/random/tests/uniformrealdistribution.cpp