Alex Herbert created NUMBERS-211:
------------------------------------

             Summary: BrentSolver infinite loop when convergence is not possible
                 Key: NUMBERS-211
                 URL: https://issues.apache.org/jira/browse/NUMBERS-211
             Project: Commons Numbers
          Issue Type: Bug
          Components: rootfinder
    Affects Versions: 1.3
            Reporter: Alex Herbert


The BrentSolver can be configured with convergence accuracies that are not 
possible to achieve. This situation occurs when the relative accuracy for the 
values is zero, and the absolute accuracy is smaller than the difference 
between the values at the root.

An example is the function:
{noformat}
f(x) = x^2 - 2{noformat}
The root is at x = sqrt(2). If the solver is created with a relative accuracy 
of zero and an absolute accuracy below the ULP of sqrt(2), e.g. 1e-30, then the 
convergence criteria cannot be met. The algorithm will infinite loop with the 
bracket at sqrt(2) and sqrt(2) + 1 ULP.

Issue identified using a security scan.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to