Re: Using ROOT's root-finding algorithms

From: Lorenzo Moneta <Lorenzo.Moneta_at_cern.ch>
Date: Tue, 27 Mar 2012 16:49:27 +0000


Hi Amnon,

 The root-finding algorithms using derivatives need just an initial estimate of the root. They will not use a bisection, so they will find the root in the local region of the point. If you are sure your function is having a root in the interval [0,M] and the root is unique you can just use the middle as starting point. If the root instead sometimes might be outside the interval, then either use the Brent method or transform your variables in a -inf,+inf range using for example a sin transformation like: http://root.cern.ch/lxr/source/math/mathcore/src/MinimizerVariableTransformation.cxx#23

  Best Regards

 Lorenzo

On Mar 25, 2012, at 10:01 PM, Amnon Harel wrote:

> Dear ROOTers,
>
> I have some questions about how to best use ROOT's root-finding
> algorithms. I need to find the root of a 1D analytical function
> in a bound range [0, M]. The derivative of the function is available.
> As far as I can tell, in ROOT the algorithms that use the derivative
> do not accept a range. Does anyone know the rational for that?
>
> I need very fast performance, hence the use of the derivative.
> But perhaps Brent's method is so good that there's nothing
> to gain from a derivative?
>
> As a work-around, I can map (0, M) unto the entire real axis,
> and check the edges separately. This seems a generic trick, so
> I wonder if there's a reason, besides the obvious "no one got
> around to it", why this isn't available in ROOT?
>
> thanks,
> Amnon Harel
>
Received on Tue Mar 27 2012 - 18:49:33 CEST

This archive was generated by hypermail 2.2.0 : Thu Mar 29 2012 - 17:50:01 CEST