You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (JIRA)" <ji...@apache.org> on 2016/03/09 17:00:43 UTC

[jira] [Commented] (MATH-1333) MullerSolver returns value that is out of bounds

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

Gilles commented on MATH-1333:
------------------------------

Confirmed.
Thanks for the report.

I've created a branch "feature-MATH-1333" on the repository with your example as a unit test (that is currently failing).

The problem is already present at line 161, where a comment indicates that "x" will be between "x0" and "x2" but a print shows that it is not:
{noformat}
x=64.25602375943637 x0=66.68753568924203 x2=100.04173804515072
{noformat}

Class {{MullerSolver2}} produces the expected answer.
 
The documentation (of these two classes) is unclear as to whether the code is strictly implementing the algorithm from the mentioned reference or if there is an adaptation.  The latter seems plausible from the comment:
{noformat}
Muller's original method would have function evaluation at complex point.
Since our f(x) is real, we have to find ways to avoid that.
{noformat}

In {{MullerSolver}}:
{noformat}
            // Muller's method employs quadratic interpolation through
            // x0, x1, x2 and x is the zero of the interpolating parabola.
{noformat}
In {{MullerSolver2}}:
{noformat}
            // quadratic interpolation through x0, x1, x2
{noformat}

Hence, at first sight, the interpolation step seems to be the same.
If the code duplication is confirmed, we should fix that first (and it will probably also fix the original problem).


> MullerSolver returns value that is out of bounds
> ------------------------------------------------
>
>                 Key: MATH-1333
>                 URL: https://issues.apache.org/jira/browse/MATH-1333
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.6
>            Reporter: Connor Petty
>         Attachments: BrokenMuller.java
>
>
> Not sure what went wrong here but in a bracket of [20,100] I got back -19.9!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)