Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce machine epsilon and add a distance epsilon
Reduce the value of the egs++ floating-point epsilon from 10e-10 to a value that is 4 times (2 bits away) from the true machine epsilon, and appropriately for single and double precision versions of the code. Add a distanceEpsilon constant that is independent of the machine epsilon, and much larger, but still entirely sufficient for physical dimensions (well below atomic dimensions in double precision). By default, the base geometry sets its boundaryTolerance to this constant. Its value is close to the previous value of epsilon (1e-10), which should curb any change in floating point error triggers in the geometry library at this point. Earlier in #177, the epsilon constant was introduced to remove hard-coded floating point comparison guards. The 1e-10 value was chosen because it matched most of the hard-coded values in the geometry library. However, this epsilon is now starting to be used as a general float guard (see #525 for example), where 1e-10 is not appropriate, as it effectively reduces the floating-point precision of the computation. Hence the need for independent epsilon values for computations and for geometrical purposes.
- Loading branch information