function y = f(x)

N = length(x);
y = zeros(N,1);
c = 0.999999;


for i = 1:N
    y(i) = 0;
    for j = 1:N
        y(i) = y(i) + (i - 0.5)/(i + j - 1) * x(j);
    end
    y(i) = (-0.5*c/N)*y(i) + 1;
    y(i) = -1/y(i) + x(i);
end
