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

Gilles commented on MATH-631:
-----------------------------

{quote}
So the function is called millions of time only if the users wishes so by 
setting the maxEvaluations to 
a number in the range of millions.
{quote}

No, the user should not expect that any algorithm will go on a single iteration 
more than necessary.
This is a plain bug.

Why do you see that a test such as I proposed (exit the loop early) is wrong 
while CM (and any good program) is full of tests to ensure that you don't do 
useless computations?
This has nothing to do with "regula falsi", it is robustness in the face of 
limited precision.

However, if you insist that the bug (failing to detect that it is stuck) is 
really an integral part of the algorithm, then removing it is not a "pathetic 
compromise", it is the only right thing to do!



> "RegulaFalsiSolver" failure
> ---------------------------
>
>                 Key: MATH-631
>                 URL: https://issues.apache.org/jira/browse/MATH-631
>             Project: Commons Math
>          Issue Type: Bug
>            Reporter: Gilles
>             Fix For: 3.0
>
>
> The following unit test:
> {code}
> @Test
> public void testBug() {
>     final UnivariateRealFunction f = new UnivariateRealFunction() {
>             @Override
>             public double value(double x) {
>                 return Math.exp(x) - Math.pow(Math.PI, 3.0);
>             }
>         };
>     UnivariateRealSolver solver = new RegulaFalsiSolver();
>     double root = solver.solve(100, f, 1, 10);
> }
> {code}
> fails with
> {noformat}
> illegal state: maximal count (100) exceeded: evaluations
> {noformat}
> Using "PegasusSolver", the answer is found after 17 evaluations.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to