An Overview of Math Libraries for Windows
Usage of Math Libraries
For computer programmers, calling pre-written subroutines to do complex calculations dates back to early
computing history. With minimal effort, any developer can write a function that multiplies two matrices, but
these same developers would not want to re-write that function for every new program that requires it.
Further, with good theory and practice, one can optimize practically any algorithm to run several times
faster, though it would typically take a several hours to days to match the performance of a highly
optimized algorithm. For example, compare a naïve matrix multiplication to a modern algorithm with
blocking that ensures efficient use of cache memory. At this point, it makes sense for the original
developer, who has a much larger problem to solve, to call on a pre-written function to perform this matrix
multiplication quickly and efficiently so that attention can be focused on the higher level application. The
first experience many developers have with such functions is the Numerical Recipes reference books.
Positioned as educational material on “The Art of Scientific Computing” the series contains complete
commented source code for hundreds of algorithms. While there is controversy around some of the
algorithms themselves, Numerical Recipes has exposed many programmers to the fundamental concept
of utilizing pre-written functions instead of starting from scratch. Numerical Recipes is available today as
source code in several languages at http://www.nr.com/. Using Numerical Recipes on Windows
®
is as
easy as copying the source into your application and compiling the code.
Historically, during the 1950s and 1960s the United States had what can be called a “software crisis”
partly because of the space race and cold war, but also partly because of the rapid advances in
computing hardware. At that time, one had to be a mathematician to program a computer. Even when
Fortran was developed in 1965, the complexities of the hardware and algorithms required a great deal of
mathematical knowledge. The software crisis arose because there were far more problems needing
solving than capable mathematicians (and therefore programmers), because programs were difficult and
time consuming to write, and because the software produced was very error prone. Commercial libraries
arrived in the early 1970s as a solution to the crisis and to address the issue of consistency of numerical
results across various computing platforms. Primarily these tools meant that programmers did not have to
reinvent the wheel to program well-known algorithms, but it also meant the resulting programs where
easier to read and follow. Improved reliability was (and still is for many users) another key reason to
justify using a library, as one can rely on a tested proven collection of shared knowledge instead of an
individual mathematicians particular view of the solution.
Scientific computing, and the use of math libraries, was traditionally limited to research labs and
engineering disciplines. In recent decades, this niche computing market has blossomed across a variety
of industries. While research institutes and universities are still the largest users of math libraries,
especially in the High Performance Computing (HPC) arena, industries like financial services and
biotechnology are increasingly turning to math libraries as well. Even the business analytics arena around
business intelligence and data mining is starting to leverage the existing tools. From bond pricing and
portfolio optimization to exotic instrument evaluations and exchange rate analysis, the financial services
industry has a wide variety of requirements for complex mathematical algorithms. Similarly, the biology
disciplines have aligned with statisticians to analyze experimental procedures which produce hundreds of
thousands of results. With this expanded industry use, and use in new environments like Microsoft
®
Windows
®
, use of math libraries has grown significantly.
Linear Algebra Libraries
The core area of the math library market implements linear algebra algorithms. More specialized
functions, such as numerical optimization and time series forecasting, are often invoked explicitly by
users. In contrast, linear algebra functions are often used as key background components for solving a
wide variety of problems. Eigen analysis, matrix inversion and other linear calculations are essential
components in nearly every statistical analysis in use today including regression, factor analysis,
discriminate analysis, etc. The most basic suite of such algorithms is the BLAS (Basic Linear Algebra
Subprograms) libraries for basic vector and matrix operations. BLAS are divided into three separate
levels. Level 1 contains functions that operate on two vectors; Level 2, on a vector and a matrix; and