function table_cd_test ( )

%*****************************************************************************80
%
% Test the function TABLE on pages 49/50 of conte/deboor
%
%  Reference:
%
%    Samuel Conte, Carl de Boor,
%    Elementary Numerical Analysis,
%    Third Edition,
%    SIAM, 2017,
%    ISBN: 978-1-611975-19-2.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'table_cd_test:\n' );
  fprintf ( 1, '  Test table_cd()\n' );

xx = -1:.1:1; fx = sin(xx); 
xb = .63; [fxb, IFLAG] = table_cd(xb,xx,fx,1e-3); 
fprintf('value = %12.7e, IFLAG = %d, error = %12.7e\n',[fxb,IFLAG,fxb-sin(xb)])
xb = .63; [fxb, IFLAG] = table_cd(xb,xx,fx,1e-18); 
 fprintf('value = %12.7e, IFLAG = %d, error = %12.7e\n',[fxb,IFLAG,fxb-sin(xb)])
xb = 1.2; [fxb, IFLAG] = table_cd(xb,xx,fx,1e-3); 
 fprintf('value = %12.7e, IFLAG = %d, error = %12.7e\n',[fxb,IFLAG,fxb-sin(xb)])

  return
end
