The coolest piece of mathematical software I’ve come across in the last few years is Chebfun, http://www.chebfun.org
Basic idea is to represent functions by high-degree polynomials which approximate them to near machine precision. After each operation, any terms which contribute at less than about 10^-15 are dropped, in the same way as bits get dropped after a standard floating point operation. This keeps the degree of the polynomial from growing exponentially.
The Chebfun team has found or invented a number of efficient algorithms for interacting with such polynomials, which make it practical to find roots, take integrals and derivatives, solve differential equations, combine multiple functions in various ways, and so on.
I think it must be the largest Matlab library anyone has yet built, and while I’m not the biggest fan of Matlab, they’ve done a great job integrating with the environment. Turns out Matlab has a bunch of object oriented features with operator and function overloading, so Chebfun can adopt most of the operators and functions for operating on regular Matlab arrays and overload them to work on their continuous function approximations. This makes for very clean and readable code for their users, though the internals get pretty complex.
Also recommended is Trefethen’s book Approximation Theory and Approximation Practice, which explains the mathematical ideas underlying the library. First 6 chapters are freely available online: http://www.chebfun.org/ATAP/
I greatly admire Trefethen's writing. I worry that there must be some really important aspects of numerical analysis that I ignore, simply because he hasn't written about them and so I understand them less well.
The clear exposition seems to have rubbed off on his whole Chebfun team at Oxford; all their papers are very readable. http://www.chebfun.org/publications/
I’ve also been reading lots of other papers in the field recently, and there’s at least a 2–3x slowdown and lots of extra mental effort when I try to read some other papers (though to be fair many other researchers are not native English speakers).
There are partial versions in Python and Julia, but porting the whole thing would be an enormous amount of work, at least a year of full time effort by a solid programmer.
One thing I would love to see is some kind of “Chebfun viewer” partial implementation ported to several languages and environments, that wouldn’t try to provide everything from the Matlab version, but would at least cover function evaluation, and maybe a few other features, and would support importing chebfuns exported from Matlab. Especially nice environments for such a thing would be C/C++ (ideally with SIMD/GPU implementation) and in-browser JavaScript.
Basic idea is to represent functions by high-degree polynomials which approximate them to near machine precision. After each operation, any terms which contribute at less than about 10^-15 are dropped, in the same way as bits get dropped after a standard floating point operation. This keeps the degree of the polynomial from growing exponentially.
The Chebfun team has found or invented a number of efficient algorithms for interacting with such polynomials, which make it practical to find roots, take integrals and derivatives, solve differential equations, combine multiple functions in various ways, and so on.
I think it must be the largest Matlab library anyone has yet built, and while I’m not the biggest fan of Matlab, they’ve done a great job integrating with the environment. Turns out Matlab has a bunch of object oriented features with operator and function overloading, so Chebfun can adopt most of the operators and functions for operating on regular Matlab arrays and overload them to work on their continuous function approximations. This makes for very clean and readable code for their users, though the internals get pretty complex.
Also recommended is Trefethen’s book Approximation Theory and Approximation Practice, which explains the mathematical ideas underlying the library. First 6 chapters are freely available online: http://www.chebfun.org/ATAP/