Fix precision loss in tabulated normal distribution
commitd44d7d6bebdb7fa52090b744854d49f34099e044
authorErik Lindahl <erik@kth.se>
Sun, 8 May 2016 20:49:36 +0000 (8 22:49 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 10 May 2016 14:55:17 +0000 (10 16:55 +0200)
tree9034deaf9dddae3ad388c956557244477fe7bc08
parent4ce2aa504d36a646f3b084c871ee0059446144a9
Fix precision loss in tabulated normal distribution

The tabulated normal distribution was generated by
simply integrating a gaussian function, which led to
severe loss-of-precision for double precision tables.
Fixed by implementing proper inverse error functions
in the math module, and using this to fill the table
directly.

Fixes #1930.

Change-Id: I74b72b4a6d36f1eb382c6456501ce5644c92725e
src/gromacs/math/functions.cpp
src/gromacs/math/functions.h
src/gromacs/math/tests/functions.cpp
src/gromacs/math/tests/refdata/FunctionTest_ErfInvDouble.xml [new file with mode: 0644]
src/gromacs/math/tests/refdata/FunctionTest_ErfInvFloat.xml [new file with mode: 0644]
src/gromacs/random/tabulatednormaldistribution.cpp
src/gromacs/random/tabulatednormaldistribution.h
src/gromacs/random/tests/CMakeLists.txt
src/gromacs/random/tests/refdata/TabulatedNormalDistributionTest_Output16.xml
src/gromacs/random/tests/refdata/TabulatedNormalDistributionTest_OutputDouble14.xml
src/gromacs/random/tests/tabulatednormaldistribution.cpp