You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: test_constructor_splitting.m
    path of file: ./repos/chebfun/tests/chebfun
    
    the code of the file until where you have to start completion: % Test file for chebfun constructor (splitting).

function pass = test_constructor_splitting(pref)

% Grab some preferences:
if ( nargin == 0 )
    pref = chebfunpref();
end

seedRNG(6178);
tol = 1e9;

% Test SQRT(X) on [0 1]:
F1 = @sqrt;
f1 = chebfu
    
function handles. (See issue #1151 on GitHub.)
f = chebfun({@(x) abs(x - 0.25), 0}, [0 0.5 1], 'splitting', 'on');
xx1 = linspace(0 + eps, 0.5 - eps, 20).';
err1 = norm(feval(f, xx1) - abs(xx1 - 0.25), inf);
xx2 = linspace(0.5 + eps, 1 - eps, 20).';
err2 = norm(feval(f, xx2), inf);
tol = 10*vscale(f)*eps;
pass(7) = max(err1, err2) < tol;

%% Test for function defined on unbounded domain:

% Function defined on [0 Inf]:

% Specify the domain: 
dom = [0 Inf];
domCheck = [0 100];

% Generate a few random points to use as test values:
x = diff(domCheck) * rand(100, 1) + domCheck(1);

op = @(x) 0.75+sin(10*x)./exp(x);
f = chebfun(op, dom, 'splitting', 'on');
x = sort(x);
fVals = feval(f, x);
fExact = op(x);
err = fVals - fExact;
pass(8) = norm(err, inf) < 1e6*eps*vscale(f);


%% Test SPLITTING ON with BLOWUP == 1:
op = @(x)tan(x);
f = chebfun(op, [-4 4], 'splitting', 'on', 'blowup', 1);

% Specify the domain: 
dom = [-4 -pi/2 pi/2 4];

% Generate random points to use as test values:
x1 = diff(dom(1:2)) * rand(100, 1) + dom(1);
x2 = diff(dom(2:3)) * rand(100, 1) + dom(2);
x3 = diff(dom(3:4)) * rand(100, 1) + dom(3);

err1 = op(x1)-f(x1);
err2 = op(x2)-f(x2);
err3 = op(x3)-f(x3);

err = [err1; err2; err3];
pass(9) = ( norm(err, inf) < 1e5*eps*vscale(f) );

%% Test for splitting on + unbndfun:

op = @(x)(sin(100*x)./exp(x.^2)+1).*(x.^2);
dom = [-inf inf];
dom_test = [-200 200];
x = diff(dom_test) * rand(100, 1) + dom_test(1);
f = chebfun (op, dom, 'exps', [2 2], 'splitting', 'on');
vals = f(x);
exact = op(x);
pass(10) = ( norm(vals-exact, inf) < 1e5*eps*vscale(f) );


% % Test X*LOG(X) on [0 1]:
% F4 = @(x) x.*log(x);
% f4 = chebfun(F4, [0, 1], pref, 'splitting', 'on', 'blowup', 'off');
% xx4 = linspace(f4.domain(1)+eps, f4.domain(end