Skip to content
All library documents

Common C++ Libraries for Quantitative Finance and Numerical Work

Article Quant Q&A · Author: Dmitri Nesteruk

Summary

The document surveys C++ libraries that practitioners and researchers report using for quantitative finance and numerical computing. For linear algebra, contributors mention Armadillo and Eigen; other reported tools include Boost’s math components, GSL, GLPK, NAG, Octave libraries, Intel’s math libraries, Yeppp, and dlib. QuantLib is identified as a finance-focused library, while Rcpp and RInside are noted for connecting C++ with R.

The evidence consists of practitioners’ personal choices and brief examples of project use, rather than a systematic comparison or benchmark. The recommendations therefore reflect individual preferences and experience, not a definitive ranking of popularity or performance. Library choice depends on the required operations, integration needs, performance constraints, and project context; the document does not evaluate these options against a common workload.

Key ideas

  • Armadillo and Eigen are presented as modern options for C++ linear algebra.
  • Boost, GSL, GLPK, NAG, and dlib are among the libraries contributors report using.
  • QuantLib provides finance-oriented functionality, and Rcpp-related tools support C++ and R integration.
  • The responses offer practitioner examples rather than comparative benchmarks or a comprehensive survey.

Tags

Full text
# What C++ math libraries are typically used by quants?


# What C++ math libraries are typically used by quants?












Before you mark question as off-topic, please read it - it is, actually, quant-related.

Basically, I'm working on an app that spits out a lot of C++ math. When it comes to simple things like exponents and trig, I can use an STL function. But when it comes to things like matrix operations or normal distributions or anything else that's not part of the STL, I'm not quite sure which library to support.

That's the reason for this question - I'd like to know what kind of C++ libs quants typically use (in addition to the STL and such) most. My idea is to support those which are the most common. (I'm thinking of things like BLAS, MKL, Boost.Math, etc.)

BTW, if anyone's interested, here's an overview of what I'm building.

## Answer by Dirk Eddelbuettel (score 22, accepted)

https://quant.stackexchange.com/a/2771

For linear algebra etc, I am partial to Armadillo with Eigen as an alternative. Both are modern (eg templated), actively developed and fairly high-performance.

I like my C++ together with R and stand behind a few projects like Rcpp and RInside which facilitate that integration; RcppArmadillo then brings Armadillo to R.

For quant stuff, there is of course QuantLib and my (too slow-moving :-/) RQuantLib.

## Answer by quant_dev (score 12)

https://quant.stackexchange.com/a/2772

What I use in my job:

- boost (the mathematical part)

- Eigen

- gsl

- glpk

and some scary legacy code ;-)

## Answer by John Channing (score 9)

https://quant.stackexchange.com/a/2774

The NAG library is quite commonly used

## Answer by babelproofreader (score 5)

https://quant.stackexchange.com/a/2773

For many numerical procedures you can link against Octave libraries if Octave is installed.

## Answer by Dominic Connor Quant Headhunt (score 2)

https://quant.stackexchange.com/a/8788

There's also the Intel math libraries.

See: https://software.intel.com/en-us/mkl

## Answer by rbm (score 2)

https://quant.stackexchange.com/a/22656

Just wanted to add one more library that may be of interest: http://www.yeppp.info/. It's not strictly a quant library but a:

> "SIMD-optimized mathematical library for x86, ARM, and MIPS processors on Windows, Android, Mac OS X, and GNU/Linux systems."

## Answer by salisboss (score 2)

https://quant.stackexchange.com/a/22724

On my capstone project on Extreme Value Theory, LMM and Swap Pricing I used dlib . It has a lot of various mathematical capabilities. My use focused on vector and optimization calculations.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.