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 19:36:27 GMT


Gilles commented on MATH-631:

May I please know *why it is OK that a bit of code does loop counting and repeatedly computes
the same thing*!

You insist that I'd be "hacking" whereas I've indicated 3 or 4 times that there is no hack:
just a test that will exit the loop as soon as it detects that the algorithm has failed. Why
is it not understandable that the busy loop could last for a long time? The function is potentially
evaluated millions of times at the same point. What if the evaluation is costly? Imagine the
computation running for days, only to discover that it could have been be stopped after a
few seconds. Is that robust code and good advertising for a library? It is one thing to expect
that there are unknown bugs in CM, but refusing to fix a known one is so obviously wrong...

And may I please know *why it is OK that an algorithm that finds the right result does not
return it*.

I had been trying to provide alternatives to the removal, but I can't do much more if nobody
answers the above two questions.
You just have to run the code and print "x" and "x1" to see what is going on!

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