Speeding up decimal multiplication

11/23/2020
by   Viktor Krapivensky, et al.
0

Decimal multiplication is the task of multiplying two numbers in base 10^N. Specifically, we focus on the number-theoretic transform (NTT) family of algorithms. Using only portable techniques, we achieve a 3x-5x speedup over the mpdecimal library. In this paper we describe our implementation and discuss further possible optimizations. We also present a simple cache-efficient algorithm for in-place 2n × n or n × 2n matrix transposition, the need for which arises in the "six-step algorithm" variation of the matrix Fourier algorithm, and which does not seem to be widely known. Another finding is that use of two prime moduli instead of three makes sense even considering the worst case of increasing the size of the input, and makes for simpler answer recovery.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/05/2018

Putting Fürer Algorithm into Practice with the BPAS Library

Fast algorithms for integer and polynomial multiplication play an import...
research
04/18/2023

Revisiting Fast Fourier multiplication algorithms on quotient rings

This work formalizes efficient Fast Fourier-based multiplication algorit...
research
09/05/2016

Automatic Library Generation for Modular Polynomial Multiplication

Polynomial multiplication is a key algorithm underlying computer algebra...
research
04/05/2021

Matrix Chain Multiplication and Polygon Triangulation Revisited and Generalized

The matrix-chain multiplication problem is a classic problem that is wid...
research
01/04/2021

Some fast algorithms multiplying a matrix by its adjoint

We present a non-commutative algorithm for the multiplication of a 2 x 2...
research
01/03/2018

Gaps between prime numbers and tensor rank of multiplication in finite fields

We present effective upper bounds on the symmetric bilinear complexity o...
research
12/23/2022

Optimizing the half-gcd algorithm

In this paper, we propose a carefully optimized "half-gcd" algorithm for...

Please sign up or login with your details

Forgot password? Click here to reset