function norm=rel_error_of_dx(dx,x)
%
%  
%
%  parameter
threshold=1e-4;
%
n=size(x,1);
if n ~= size(dx,1)
    error('rel_error_of_dx: different dimension of dx and x');
end;
norm=0;
for i=1:n
    if abs(x(i))< threshold    
        scal=threshold;
    else
        scal=abs(x(i));
    end;
    norm=norm+(dx(i)/scal)^2;
end;
norm=sqrt(norm);