commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <>
Subject [jira] [Commented] (MATH-1333) MullerSolver returns value that is out of bounds
Date Wed, 09 Mar 2016 16:00:43 GMT


Gilles commented on MATH-1333:

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:
x=64.25602375943637 x0=66.68753568924203 x2=100.04173804515072

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

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

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:
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.6
>            Reporter: Connor Petty
>         Attachments:
> 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

View raw message