Question: Muller's method of finding sqrt(x^2+y2) and euclidean norm in general

The algorithm that I need to replicate is as follows:

real function f(x,y)

integer n; real a,b,c,x,y

f<-max(|x|,|y|)

a<-min(|x|,|y|)

for n=1 to 3 do

b<-(a/f)^2

c<-b/(4+b)

f<-f+2*c*f

a<-ca

end for

end function f

How can I define f,a as  functions that I am later using as variables(in f=f+2cf,b=(a/f)^2)? also, is n just a variable for iteration? 

 

Please Wait...