Project

General

Profile

Bug #1356

GMX_FLOAT_EPS and GMX_DOUBLE_EPS don't follow ISO C standards

Added by Berk Hess almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
core library
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

ISO C demands that EPS is the value of the least significant bit, whereas Gromacs uses half of that.
I don't know if this impacts any code, but we should change to the ISO C standard to avoid confusion.
It matters when you want to subtract one bit from 1, which might not happen with the halved value.

Associated revisions

Revision 97161d26 (diff)
Added by Erik Lindahl over 6 years ago

Modify single/double EPS to agree with ISO C

The previous Gromacs values were a factor 2 too tight. While
we're at it, we also added float modifiers to the single-precision
constants, increased the accuracy in the double max/min values,
and improved the least significant bit in one of the single-precision
values. The previous relative accuracies for the PME correction
analytical approximations where set fairly arbitrary by dividing a
tightly chose constant with GMX_REAL_EPS, and since this is now a
larger number the unit test tolerance for those corrections has been
increased slightly to avoid triggering false failures.

Fixes #1356.

Change-Id: If29d2ff4141d86fd019e0dbdbfb7737ead28c3d4

History

#1 Updated by Berk Hess almost 7 years ago

  • Status changed from New to Accepted

#2 Updated by Gerrit Code Review Bot over 6 years ago

Gerrit received a related patchset '1' for Issue #1356.
Uploader: Erik Lindahl ()
Change-Id: If29d2ff4141d86fd019e0dbdbfb7737ead28c3d4
Gerrit URL: https://gerrit.gromacs.org/3510

#3 Updated by Erik Lindahl over 6 years ago

  • Status changed from Accepted to Fix uploaded

#4 Updated by Gerrit Code Review Bot over 6 years ago

Gerrit received a related patchset '1' for Issue #1356.
Uploader: Erik Lindahl ()
Change-Id: I395e83d1b16e33121033c50c7be3253d550545b5
Gerrit URL: https://gerrit.gromacs.org/3546

#5 Updated by Erik Lindahl over 6 years ago

  • Status changed from Fix uploaded to Resolved
  • % Done changed from 0 to 100

#6 Updated by Erik Lindahl over 6 years ago

  • Status changed from Resolved to Closed

Note that I pushed an incorrect patch too, but the right one has now been merged: https://gerrit.gromacs.org/#/c/3510/

Also available in: Atom PDF