Let f(α)=0. With the initial value x0,x1,x2 and
wn:=f[xn,xn−1]+f[xn,xn−2]−f[xn−2,xn−1]
, define the sequence {xn} as
xn+1:=xn−wn±wn2−4f(xn)f[xn,xn−1,xn−2]2f(xn),
which converges to α of order p≈1.84 when n→∞.
Note, (wn±wn2−4f(xn)f[xn,xn−1,xn−2])∈C is selected as the larger of + and −.
The modulus of a complex number is calculated as ∣x+iy∣:=x2+y2.
The Muller method can be seen as an application of the secant method, still slower than the Newton-Raphson method, but it has the characteristic of being able to find complex roots. It solves using the root formula instead of derivatives or signs, so there’s no need to hang on to geometric meanings, and it covers complex numbers.
Example
Given (xi,f(xi))i=n−1n+1, the unique quadratic polynomialp2(x)=f(xn+1)+(x−xn+1)f[xn+1,xn]+(x−xn+1)(x−xn)f[xn+1,xn,xn−1]
satisfies p(xi)=f(xi) well. Let’s transform this into a quadratic equation for (x−xn+1).
Substituting x=xn+1 gives p2(xn+1)=f(xn+1)+0+0, so finding (x−xn+1) that makes it p2(x)=0 is essentially the same as finding f(xn+1)=0. Since the original goal was to find xn satisfying n→∞limf(xn)=0,
for p2(x)=f(xn+1)+wn(x−xn+1)+(x−xn+1)2f[xn+1,xn,xn−1],
use the quadratic formula for (x−x2). The formula yields
xn+1−xn=2f[x2,x1,x0]−wn±wn2−4f(xn)f[xn,xn−1,xn−2],
which, because actual computation is done by computers, due to issues like significant figures, advises to use the reverse rationalized
xn+1=xn−wn±wn2−4f(xn)f[xn,xn−1,xn−2]2f(xn) as the formula.
Meanwhile, it’s not necessary for f′ to exist, but if f’(α)=0, then it’s wn→f′(α) when n→∞, hence it can be used to find derivatives as well.
Implementation
Below is the implementation of the Muller method in R. In theory, it starts with three points (x0,x1,x2), but in practice, it can determine x2:=2x0+x1 with just x0,x1, so it uses only two initial values. Even if (x0,x1) is actually real, the data type must be complex.
dd<-function(f,X){if(length(X)==1){return(f(X))}
temp<-numeric(0)for(i in1:length(X)){temp[i]<-prod(X[i]-X[-i])}return(sum(f(X)/temp))}
Muller<-function(f,x0,x1){
x2<-(x0+x1)/2while(Mod(f(x2))>10^(-3)){
w = dd(f,c(x2,x1))+ dd(f,c(x2,x0))- dd(f,c(x0,x1))
p = w +sqrt(w^2-4*f(x2)*dd(f,c(x2,x1,x0)))
m = w -sqrt(w^2-4*f(x2)*dd(f,c(x2,x1,x0)))if(Mod(p)>Mod(m)){w<-p}else{w<-m}
x0<-x1
x1<-x2
x2 <-(x2 -((2*f(x2))/ w))}return(x2)}
f<-function(x){x^2+9}
Muller(f,-6+0i,-5+0i)
g<-function(x){x^2+ x +1}
Muller(g,-1i,-2+0i)
The following is the result of executing the above code. It successfully found one of the imaginary roots of f(x)=x2+9=, x=−3i, and one of the complex roots of g(x)=x2+x+1=0, x=−21+3i.
Atkinson. (1989). An Introduction to Numerical Analysis(2nd Edition): p73~74. ↩︎