Coder Social home page Coder Social logo

richardath / projects Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 220.45 MB

Big-integer calculator with factorization

C 47.83% C++ 9.43% Batchfile 0.10% Assembly 19.73% Makefile 4.29% M4 1.65% Python 0.57% Shell 3.39% Cuda 8.29% Roff 0.06% GDB 0.01% HTML 0.34% TeX 1.28% Perl 0.18% AngelScript 2.75% ActionScript 0.10%
factorization calculator-app biginteger algorithms-ecm gmp algorithms-siqs

projects's Introduction

This is a calculator and factorisation program based on Dario Alpern's program. See https://www.alpertron.com.ar/ECM.HTM

It factorises numbers or numeric expressions using fast algorithms ECM and SIQS. ECM = Lenstra elliptic-curve factorization see https://en.wikipedia.org/wiki/Lenstra_elliptic-curve_factorization SIQS = Self-initializing quadratic sieve see http://www.mersennewiki.org/index.php/Self-Initializing_Quadratic_Sieve or https://en.wikipedia.org/wiki/Quadratic_sieve

HISTORY

the program was converted from browser-based to a console window. The advantage is that it is somewhat faster, and the calculator part has been carefully tested. The disadvantage is that you have to download and build it. In order to do that you need GMP or MPIR multi-precision library and the Boost multi-precision library.

Changes include:

C++ rather than C

The calculator part was extensively rewritten to use GMP/MPIR extended precision and the Boost multiprecision library. Wherever possible GMP functions were used instead of DAs version.

FACTORIZATION

As mentioned above it uses algorithms ECM and SIQS.

The factoriser is essentially DAs program, with an interface function that converts GMP/MPIR extended precision numbers to DAs BigIntegers and vice versa. The progress messages it produces have been modified to work with a console window instead of a Web Browser.

My attempt to speed up factorisation failed completely, so I took an entirely different approach.

A feature was added to allow use of Msieve as an alternative to the original ECM & SIQS factorisation. My conclusion was that for larger numbers (> about 50 digits) Msieve is usually significantly faster, provided that the -i option is used with Msieve. The -e option causes greater use of ECM within Msieve. The default is to use ECM only for factors < 15 digits. In addition I modified the function choose_max_digits within the source file gmp_ecm.c to increase the use of ECM still further.

Use of Msieve is controlled by Msieve on/off commands. Note: msive must be installed separately and the path to it must be correct.

Also an interface to YAFU, which is generally faster than Msieve. Again YAFU must be installed separately and the path to it must be correct. For numbers > 95 digits YAFU neeeeds GGNFS to be installed as well. Use of YAFU is controlled by YAFU ON/OFF commands.

Turning YAFU on turns Msieve off and vice versa. If both are off the original ECM/SIQS is used.

To build Msieve requires some components of GMP-ECM, as well as Pthreads

To build YAFU requires components of Msieve, GMP-ECM and Pthreads.

Some other unrelated stuff is also included in the solution:

Int128 - allows use of 128-bit integers with visual studio. I had intended to use this in the factorisation but never actually did so.

Baillie-PSW - a copy of a program I found that demonstrates various primality-testing functions

For more information see readme.txt file

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.