function y=globnewton(x1,k)
				#k lepeses globalisan konvergens Newton-
				#modszer,f=0-ra, f es x oszlopvektor
				#gradF sorai f komponenseinek gradiensei
x=x1;
for i=1:k fx=f(x);fn=norm(fx)^2;gradfx=gradf(x);p=-gradfx\fx;
    if norm(p)>100 p=100/norm(p)*p;end;xuj=x+p;gradf1=2*fx'*gradfx;
    dx=xuj-x;fxuj=f(xuj);fnuj=norm(fxuj)^2;g2=fnuj;
    if fnuj-fn>10^(-4)*gradf1*dx L2=1;gder=gradf1*p;
       L1=-gder/2/(fnuj-fn-gder);if L1>1/2 L1=1/2;elseif L1<0.1 L1=0.1;end;
       xuj=x+L1*p;fxuj=f(xuj);fnuj=norm(fxuj)^2;g1=fnuj;dx=xuj-x;
    end;
    while fnuj-fn>10^(-4)*gradf1*dx G1=g1-fn-L1*gder;G2=g2-fn-L2*gder;
         a=(G1/L1^2-G2/L2^2)/(L2-L1);b=(-L2*G1/L1^2+L1*G2/L2^2)/(L2-L1);
         L2=L1;L1=(-b+sqrt(b^2-3*a*gder))/3/a;
         if L1>L2/2 L1=L2/2;elseif L1<L2/10 L1=L2/10;
         elseif L1!=conj(L1) L1=L2/2;end;
         xuj=x+L1*p;fxuj=f(xuj);fnuj=norm(fxuj)^2;g2=g1;g1=fnuj;dx=xuj-x;
    end;x=xuj;
end;y=x;
