commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MATH-631) "RegulaFalsiSolver" failure
Date Mon, 08 Aug 2011 19:36:27 GMT

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

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

        

Mime
View raw message