GithubHelp home page GithubHelp logo

josemam / ll Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 10 KB

A simple Lucas-Lehmer primality test implementation for C++

License: GNU General Public License v2.0

C++ 65.61% Haskell 34.39%
lucas-lehmer primality-testing mersenne-numbers

ll's Introduction

LL

Simple Lucas-Lehmer primality test implementations for C++ and Haskell

My GitHub profile was empty, so I decided to add this. Why not?

These snippets perform a Lucas-Lehmer primality test for a given exponent. The C++ version works using Henrik Vestermark's arbitrary precision package. The Haskell implementation is way faster. And more elegant.

How to compile:

  • C++: save ll.cpp and Henrik Vestermark's package iprecision.h and precisioncore.cpp (you may find them here) at the same directory, then run g++ -o [any name for your executable file] ll.cpp precisioncore.cpp.
  • Haskell: run ghc -o [any name for your executable file] ll.hs -O2 -optc-O2.

Of course, there are better LL implementations all over the Internet (e.g.: check out prime95 for an excellent working SW or the large software list they suggest for many source code examples), so you will probably not want to start anything from this. I just wanted to upload something.

Anyway, if you still feel like updating this, you are welcome. Maybe a FFT-based multiplication in order to square number faster?

ll's People

Contributors

josemam avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.