What is the ā€œeā€ variable in popular implementations of the Brent root search algorithm?

I read the standard (Numerical Recipes and GSL version C are identical) the implementation of the Brent root search algorithm and cannot understand the value of the variable "e". Usage assumes that "e" should be the previous distance between the brackets. But then, why is it set to "xm" (half the distance) when we use bisectorization?

+3
source share
3 answers

I am not familiar with the algorithm. However, I can compare the C source and the Wikipedia description of the algorithm. The algorithm seems straightforward and-ish (if you are familiar with root lookup methods), but the C implementation looks like a direct fortran port, so it's pretty hard to read.

My best guess is that it eis related to a conditional loop.

Wikipedia says (line 8 of the algorithm): repeat until f(b or s) = 0 or |b āˆ’ a| is small enough (convergence)

Source C says:   e = b - aand then if (fabs(e) <= tol ....

I hope that the purpose of the variables will be clearly described in the book, but apparently not :)


OK, you are here. I found the original implementation (in algol 60) here . In addition to a good description of the algorithm, he says (starting on page 50):

e p/q . |e| < & Delta; |p/q| & ge; 1/2|e|, , , , . , |e| , , , |e| & Delta; . ( e = m .)

, e Brent " ".

+4

E - "", , . 20 , epsilon , ( , ) , .

, , , epsilon . ... .

0

. , e, , .

-1

Source: https://habr.com/ru/post/1726831/


All Articles