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

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

The problem was due to the fact that at some point, the update formula always 
gave the same value: Nothing was being updated and the loop went on until the 
number of evaluations was exhausted.

I've committed a tentative solution in revision 1154614.
However:
# I'm not sure that it doesn't have any adverse side-effects on the bracketing 
property.
# It is quite probably not a pristine "regula falsi" algorithm anymore.

Please review.

Anyways, for the function that triggered the problem (see "testIssue631" in 
"RegulaFalsiSolverTest.java"), the (modified) {{RegulaFalsiSolver}} takes 3624 
evaluations (versus 17 for {{PegasusSolver}}). We should probably add a word of 
warning in the class Javadoc.


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