commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brent Worden" <brent.wor...@gmail.com>
Subject Re: [math] BrentSolver exception
Date Tue, 06 May 2008 20:22:24 GMT
Because opposite signs insures the endpoints bracket a root.  If the
endpoints capture a root, then the Brent algorithm is guaranteed to
work.

Your example does point out a problem, though,  Since one of the
endpoints evaluates to zero, the algorithm should stop and return that
as the root instead of throwing an exception.

Can you open a Jira issue with this example and/or a patch that fixes
the problem, and we can get it added to the code base.

Thanks,

Brent Worden

On Tue, May 6, 2008 at 2:58 PM, Al Lelopath <jdaues@gmail.com> wrote:
> I'm getting this exception:
> STDERR: java.lang.IllegalArgumentException: Function values at
> endpoints do not have different signs.  Endpoints:
> [-100000.0,1.7976931348623157E308]  Values: [0.0,-101945.04630982173]
> May 6, 2008 1:53:04 PM
> STDERR:         at org.apache.commons.math.analysis.BrentSolver.solve(BrentSolver.java:99)
> May 6, 2008 1:53:04 PM
> STDERR:         at org.apache.commons.math.analysis.BrentSolver.solve(BrentSolver.java:62)
>
> Why is having function values that don't have different signs a bad thing?
>
> (Though it does appear that they do have different signs
> [0.0,-101945.04630982173] if 0.0 is considered positive)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message