In order to realize the algorithm for:
Def igs (f, a, b, n, eps=1-8, e maxiter=100) :
O function f (x) in the root of the [a, b] range, a1 - the interval [a, b] is divided into n: {x_i=a + I (b - a)/n, I=0,... N)
2 - find f (x_i) * f (x_i + 1) & lt; The intervals=0
If a 3 - (x_i)=0 f or f (x_i + 1)=0, so direct return the value
4 - calculation of c=(x_i x_i + + 1)/2
5 - if c
The principle of the algorithm is the same as dichotomy, but dichotomy is directly take intermediate value calculation, the above steps will be expected to range can be divided into n segments in each segment to calculate whether the subinterval cycle has a root, I would like to write for a long time or not to come out, please advise, thank you very much!