Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-956

Hardcoded numbers in "LevenbergMarquardtOptimizer"

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.1.1
    • 3.2
    • None
    • None

    Description

      The class contains numbers "2.2251e-308" and "2.2204e-16".
      The former is the "SAFE_MIN" defined in class "Precision".

      The latter is documented as

      2.2204e-16 is the machine epsilon for IEEE754
      

      However, the "EPSILON" defined in class "Precision" is equal to "1.1102230246251565E-16" (i.e. half the above number). This requires clarification.
      I would remove the seemingly incorrect comment (if we assume that the correct definition is in the comment for "EPSILON" in "Precision") and replace the hard-coded values with

      2 * Precision.EPSILON
      

      Do you agree?

      Attachments

        Activity

          People

            Unassigned Unassigned
            erans Gilles Sadowski
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: