ChebFun: Matlab Toolbox Numerical computation
The aim of the chebfun system is to “feel symbolic but run at the speed of numerics”. More precisely our vision is to achieve for functions what floating-point arithmetic achieves for numbers: rapid computation in which each successive operation is carried out exactly apart from a rounding error that is very small in relative terms [Trefethen 2007].
The implementation of chebfuns is based on the mathematical fact that smooth functions can be represented very efficiently by polynomial interpolation in Chebyshev points, or equivalently, thanks to the Fast Fourier Transform, by expansions in Chebyshev polynomials. For a simple function, 20 or 30 points often suffice, but the process is stable and effective even for functions complicated enough to require 1000 or 1,000,000 points. The chebfun system makes use of adaptive procedures that aim to find the right number of points automatically so as to represent each function to roughly machine precision (about 15 digits of relative accuracy).
Three quick examples:
What’s the integral of sin(sin(x)) from 0 to 10?
>> x = chebfun(‘x’,[0 10]); sum(sin(sin(x)))
ans = 1.629603118459496
What’s the maximum of sin(x)+sin(x2) over the same interval?
>> max(sin(x)+sin(x.^2))
ans = 1.985446580874097
How many roots does the Bessel function J0(x) have between 0 and 1000?
>> length(roots(chebfun(@(x) besselj(0,x),[0 1000])))
ans = 318
For more, see Chebfun Guide and Examples.
Reference:
[Trefethen 2007] L. N. Trefethen, “Computing numerically with functions instead of numbers”, Mathematics in Computer Science 1 (2007), 9-19.
This Guide is based on Chebfun Version 3, released in December 2009. Chebfun is available from the website http://www.maths.ox.ac.uk/chebfun/ and also from the MathWorks File Exchange.

