commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Commented] (MATH-631) "RegulaFalsiSolver" failure
Date Mon, 08 Aug 2011 09:58:34 GMT


Gilles commented on MATH-631:

I think we should completely get rid of regula falsi and only keep the better algorithms.

That was my first idea. And that would be the simplest one, the safest one, and the only viable
one as I can't seem to state clearly enough that
* Problem 1: When the doc says "guaranteed convergence", the algorithm should provide the
* Problem 2: When the (absolute) accuracy threshold is set to 1e-6, and the correct root *is*
found (after 2200 iterations) within the requirements, it should be returned, instead running
idle and finish with an exception

The reason why we get stuck is irrelevant.

But why? If we *can* be more precise on the cause of failure, why not do it?

This limit is simply a safety limit, not a tuning parameter that user are expected to raise
once they hit it hoping they will converge later on.

In principle, some possible use would be to compare the efficiency of different methods where
the main criterion would be a time limitation (assuming that the function evaluation time
overwhelms the of the root solver algorithm time). Thus with the function that triggered this
* If you set maxeval to "3000", then both "Pegasus" (17 evals) and (a fixed) "RegulaFalsi"
(2200 evals) would fill the bill.
* If you set maxeval to "1000", then "Pegasus" will be the only winner.

+1 for removing it altogether, and include somewhere the reason for it not being implemented
in CM.

> "RegulaFalsiSolver" failure
> ---------------------------
>                 Key: MATH-631
>                 URL:
>             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:


View raw message