Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce machine epsilon and add a distance epsilon #560

Merged
merged 1 commit into from
Mar 24, 2021
Merged

Commits on Mar 24, 2021

  1. 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.
    ftessier committed Mar 24, 2021
    Configuration menu
    Copy the full SHA
    4fb3273 View commit details
    Browse the repository at this point in the history