Skip to content

Algorithm improvements for very large numbers #169

@tczajka

Description

@tczajka

Implement better multiplication for large numbers.

Multiplication currently uses Toom-3, which is O(n^1.47) for n BigDigits. This can be improved to O(n log n) using the Fast Fourier Transform (on complex numbers with sufficient precision) or Number Theoretic Transform (using modular arithmetic with multiple primes), or slightly worse O(n log n log log n) using the Schönhage–Strassen algorithm. I am leaning towards the latter because it's only slightly slower asymptotically, but simpler, so I suspect it might actually be faster for all practical sizes.

It will probably make sense to split algorithms into separate modules.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions