NTL: A Library for doing Number Theory

NTL is a high-performance, portable C++ library providing data structures and algorithms for manipulating signed, arbitrary length integers, and for vectors, matrices, and polynomials over the integers and over finite fields.

On modern platforms supporting C++11, NTL can be compiled in thread safe and exception safe modes.

If you are interested in contributing to the development of NTL, please contact me (see contact info below). I have a few projects in mind, and would be happy to discuss other ideas as well.

Now available: NTL 9.6.2

More detailed information about recent changes


NTL wins a prize

NTL's author was recently awarded the ACM/SIGSAM Richard Dimick Jenks Memorial Prize for Excellence in Software Engineering applied to Computer Algebra for his work on NTL.


I've made a comparison between polynomial arithmetic in NTL and FLINT, based on NTL 9.6.2, FLINT 2.5.2, and GMP 6.1. You can see the results in this report. You can download all the test programs here.

Short synpopsis: in many settings NTL is faster, and in others FLINT is faster. It really depends on what you are doing. Please read the report for full details.

Thread boosting

As of version 9.5, NTL is now not only thread safe, but includes a new thread boosting feature, which utilizes multiple cores to speed up low-level computations. This is a work in progress, and as of now, only ZZ_pX arithmetic is thread boosted. You can see the effect of thread boosting in the context of polynomial factorization in this report. You can download the test programs here.

Short synposis: using 16 cores, NTL's (already pretty fast) algorithm for factoring polynomials over ZZ_p now runs 10-12 times faster. This is a result of boosting the low-level ZZ_pX arithmetic: the higher-level factoring routines are completely unchanged.

Pay what you like

NTL is freely available under a GPL license. If you find the software useful, please feel free to donate to the author whatever amount you would like by clicking on the paypal button below. And if you don't feel like donating, that's OK too.

Thanks for your help!

Back to Victor Shoup's Home Page