Code covered by the BSD License
by Chebfun Team
30 Apr 2009
(Updated 05 Apr 2012)
Numerical computation with functions instead of numbers.
This file was selected as MATLAB Central Pick of the Week
function pass = minsamples_adapt
% Test for minsaples in adaptive mode on an infinite domain (unbounded maps)
% Rodrigo Platte, 2009.
shift = 1e3;
f = @(x) exp(-1*((x-shift).^2));
mpref = mappref;
f = chebfun(f,[-inf,inf],'minsamples',1024+1);
pass = abs(sum(f)-sqrt(pi)) < chebfunpref('eps')*1e5;