NASA’s Jet Propulsion Laboratory (JPL) has released two large math libraries under an open source (BSD) license. Via Degenerate Conic:
“MATH77 is a library of Fortran 77 subroutines implementing various numerical algorithms. It was developed over decades at JPL, and contains some very high-quality and time-tested code. The code is released under a BSD-type license. There is also a C version for people who love semicolons.”
This goldmine includes basic mathematical functions, random number generators, linear algebra routines, solvers for systems of nonlinear equations, curve fitting, interpolation, and quadrature routines, and much more. The libraries are available at Netlib and are accompanied by 619 pages of detailed documentation.