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

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

The original implementation, for the "problem instance being examined here", 
would find the root with absolute accuracy lower than *10e-12* after 3560 
evaluations (note: using the default value of *1e-6*).
In fact, the root was found, at the required accuracy, after around 2200 
evaluations.

That does not sound like correct behavior.
The problem is that, "x0" never being updated, the convergence test always 
fails... until we reach the limitation of double precision, which entails an 
infinite loop.

In fact my fix should not be necessary, as things have gone awry before it 
would apply, but there is a bug to fix nonetheless.


> "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