Code covered by the BSD License  

Highlights from
Chebfun V4

image thumbnail

Chebfun V4

by

 

30 Apr 2009 (Updated )

Numerical computation with functions instead of numbers.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

elementary
function pass = elementary
% Check that computations of elementary functions
% for chebfuns defined on infinite intervals are
% accurate.
%
% Rodrigo Platte, May 2009

tol = chebfunpref('eps');

f = chebfun(@(x) exp(-x), [0 inf]);
f2 = chebfun(@(x) sin(exp(-x)), [0 inf]);
f3 = sin(f);
pass(1) = norm(f2-f3,inf) < tol*100;

f2 = chebfun(@(x) cos(exp(-x)), [0 inf]);
f3 = cos(f);
pass(2) = norm(f2-f3,inf) < tol*100;

Contact us