# Best software to do big number calculations quickly

I am trying to do some work on some math conjecture. I am testing the conjecture numbers using very large math numbers (100+ digits ). I am currently using python to test these numbers.

In the conjecture's calculation, I quickly need to multiply and divide different large numbers several times. Python can do this quickly(~3000 calculations per minute). Is there any other faster software to achieve this.

• Have you tried any of the various GMP bindings for Python?At least at one point in the past that could lead to large speedups. – njuffa Dec 29 '18 at 22:02
• Are the numbers integers? – nicoguaro Dec 30 '18 at 17:26
• yes,numbers are intergers – Rahul Shah Dec 30 '18 at 18:12
• You can probably use SymEngine, it is written in C++ but can be used as a Python library. – nicoguaro Dec 31 '18 at 2:42
• Boost.Multiprecision? It has GMP bindings if you need it. – user14717 Jan 1 at 23:24

Why not give GMPY2 a try? From the introduction:

gmpy2 is a C-coded Python extension module that supports multiple-precision arithmetic. gmpy2 is the successor to the original gmpy module. The gmpy module only supported the GMP multiple-precision library. gmpy2 adds support for the MPFR (correctly rounded real floating-point arithmetic) and MPC (correctly rounded complex floating-point arithmetic) libraries. gmpy2 also updates the API and naming conventions to be more consistent and support the additional functionality.

GMPY2 supports the integer arithmetic I assume you need and I doubt you can find anything faster.

On *nix based systems, you'll need to make sure that the latest version of GMP is installed (GNU MP Bignum Library. On Windows, you can find a Python wheel courtesy of Christophe Gohlke here.

Using something such as numpy.divide, you most likely will see no considerable difference from doing it in C++. Although casting might be something to consider. C++ may see some improvement in this area as Python will have to deal with this in real-time. With C++ this will not pose an issue. (Python will now cast any ints to floats for doing division as well).

OP's comment on OP:

yes,numbers are intergers

For arbitrarily large integer calculations, MAPLE is an option worth trying. it has very efficient implementations for a number of such calculations.

• thanks........... – Rahul Shah May 7 at 16:15