commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luc Maisonobe (JIRA)" <>
Subject [jira] [Commented] (MATH-631) "RegulaFalsiSolver" failure
Date Sun, 07 Aug 2011 19:08:27 GMT


Luc Maisonobe commented on MATH-631:

All the above imply that one expects that the algorithm can find the solution.
However, in this implementation, it can't.
Therefore there is a bug, somewhere.

Here, the bug is in the algorithm itself, not in the implementation.

it leads to the impression that the "Regula Falsi" mathematical algorithm can fail to converge,
which is not correct (IIUC).

It is correct. Regula Falsi fails to converge, or rather it can take a too large number of
iteration to converge. This is exactly this behavior that has lead to the construction of
other algorithms like Illinois or Pegasus. These two algorithms try to detect the case when
the same end of the interval is always updated, and the other end remains unchanged. Once
they have detected this, they slightly change the value at one end to trick the linear evaluation
into choosing a value that is very likely to have the required sign to update this other end.
In fact, in many cases depending of the sign of the curvature near the root, as soon as one
end is very close to the root the linear interpolation will always remain on the same side
of the root and hence will update this end.

I agree with Dennis here, the change needed to ensure convergence is not tool long is to choose
a better algorithm, such as Illinois, Pegasus ... or the nth order bracketing solver I recently
added. Regula Falsi should remain the reference Regula Falsi, just as secant and Brent should
remain the reference ones.

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