Stan Math Library

Stan Math Library

differentiable C++ for linear algebra & probability


Download stable releases or clone the repository directly from GitHub.

The library is no longer entirely header only and depends on both the Sundials differential equation solving library and the Intel Thread Building Blocks library.

Documentation and Getting Started

A simple getting-started example for computing derivatives is provided in the

There is a make target to build the API documentation using doxygen (Doxygen).

Computing gradients of C++ functions is documented in the arXiv paper (arXiv).

Unit Testing

Unit tests aim to cover all of the library functionality.

Source Code and Issue Tracker

The Stan Math Library’s source code and issue tracker are hosted by GitHub.


The Stan Math Library is open-source licensed under the