function QMCManifold2(N,t,r)
switch t
        case 1
            switch r
                case 1
                    FF=0.637848242027904;
                case 2
                    FF=1.297528862046102;
                case 3
                    FF=1.159852041305101;
                case 4
                    FF=0.145771246135679;
            end
        case 2
            switch r
                case 1
                    FF=0.712504034681439;
                case 2
                    FF=0.578397783759171;
                case 3
                    FF=1.318195439838512;
                case 4
                    FF=-0.016702772737230;
            end
        case 3
            switch r
                case 1
                    FF=0.343528272832302;
                case 2
                    FF=4.700517385919818;
                case 3
                    FF=1.306729852997971;                        
                case 4
                    FF=-0.012692747954474;
            end
        case 4
            switch r
                case 1
                    FF=0.729465700516434;
                case 2
                    FF=0.280864805817563;
                case 3
                    FF=1.340544583085376;
                case 4
                    FF=0.089499074722825;
            end
end
S=0:0.05:10;
for i=1:length(S)
x=linspace(0,1,ceil(N/sqrt(2)));
[X,Z]=meshgrid(x);
switch t
    case 1
        Y=fromsqu_to_con([X(:),Z(:)]);
    case 2
        Y=fromsqu_to_cyl([X(:),Z(:)]);
    case 3
        Y=fromsqu_to_tor([X(:),Z(:)]);
    case 4
        Y=fromsqu_to_sph([X(:),Z(:)]);
end
X=pts_MinEnRiesz(Y,N,S(i));
ff=f(r);
F=feval(ff,X(:,1),X(:,2),X(:,3));
FF1=sum(F)/N;
ErrR(i)=abs((FF-FF1)/FF);
i=i+1;
end

figure
plot(S,ErrR,'LineWidth', 1.5)
end