[gmx-developers] stuff in double precision

David van der Spoel spoel at xray.bmc.uu.se
Mon Feb 5 20:54:45 CET 2007

Erik Lindahl wrote:
> Hi,
> On Feb 5, 2007, at 7:35 PM, David Mobley wrote:
>> The reason free energy calculations (absolute or relative) work (or
>> are supposed to work) isn't that they avoid subtracting large numbers
>> -- it's that they evaluate the potential energy of a particular
>> snapshot in different Hamiltonians (or, similarly, the free energy
>> derivative for a particular snapshot).
> Agreed, and of course we should get it to work that way. Using double is 
> a bad solution, simply because it's just pushing the problem towards 
> larger systems (OK, pretty large ones :-), but since some tabulated 
> interactions don't quite have full double precision it is probably wiser 
> to address the problem (e.g. summation order) rather than just using 
> double to hide it.
OK, let me rephrase, it may not be an ill-posed problem, but say you 
make the system 10 times larger, with automatically ten times larger 
energies in absolute numbers, then the maximum accuracy by definition 
becomes 1 kJ/mol, even if you have perfect convergence. From this is 
logically follows that accurate absolute free energy calculation for 
very large systems can not be obtained when using single precision 

So a possible workaround would be to
- only use the free energy code
- use double precision summation in the free energy loops only (you want 
to play, you got to pay...)

This means normal MD is not affected, and only one or a few routines 
have to be altered.

David van der Spoel, PhD, Assoc. Prof., Molecular Biophysics group,
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,  	75124 Uppsala, Sweden
phone:	46 18 471 4205		fax: 46 18 511 755
spoel at xray.bmc.uu.se	spoel at gromacs.org   http://folding.bmc.uu.se

More information about the gromacs.org_gmx-developers mailing list