You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Luc Maisonobe (JIRA)" <ji...@apache.org> on 2013/03/26 16:17:16 UTC

[jira] [Commented] (MATH-956) Hardcoded numbers in "LevenbergMarquardtOptimizer"

    [ https://issues.apache.org/jira/browse/MATH-956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13614107#comment-13614107 ] 

Luc Maisonobe commented on MATH-956:
------------------------------------

I agree.

The reason for the difference is probably because at 1.0, the seperation between two normal numbers change, due to exponent change. For numbers just below 1.0, the least significant bit is twice smaller than the least significant bit of numbers just above 1.0. Of course, similar scale changes occur also around 0.5, 0.25, 0.125 ... on one side and around 2.0, 4.0, 8.0 ... on the other side.
                
> Hardcoded numbers in "LevenbergMarquardtOptimizer"
> --------------------------------------------------
>
>                 Key: MATH-956
>                 URL: https://issues.apache.org/jira/browse/MATH-956
>             Project: Commons Math
>          Issue Type: Task
>    Affects Versions: 3.1.1
>            Reporter: Gilles
>            Priority: Minor
>             Fix For: 3.2
>
>
> 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
> {noformat}
> 2.2204e-16 is the machine epsilon for IEEE754
> {noformat}
> 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
> {noformat}
> 2 * Precision.EPSILON
> {noformat}
> Do you agree?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira