GithubHelp home page GithubHelp logo

foo123 / fast-factorial-functions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from peterluschny/fast-factorial-functions

0.0 3.0 0.0 2.11 MB

Swing, divide and conquer the factorial!

Home Page: http://www.luschny.de/math/factorial/FastFactorialFunctions.htm

Go 5.27% HTML 0.36% Java 30.54% C++ 8.06% C 15.56% C# 40.21%

fast-factorial-functions's Introduction

Fast Factorial Functions

Here you can find implementations of the most efficient algorithms to compute

See also this nice overview.

Additionally you can find in this repository

  • a small database of factorial algorithms which let you quickly find the most appropriate version for your needs.

  • An efficient sieve of Eratosthenes implemented in an object-oriented way.

Implementation languages

  • Project MpirBasedFunctions : C++
  • Project SilverFactorial64 : C#
  • Project JavaFactorial : Java
  • Project GoFactorial : Go

The C# and the Java version come with a small benchmark program. Here a screenshot of the Java version and a screenshot of the C# version.

Browsing the code

To browse the code the following two pages might be more convenient: primes and factorials.

Porting

If you want to port the algorithms to other languages the C# version is recommended as the point of departure. The benchmarks indicate that it is a good idea to start with the swing algorithm or (more demanding to implement, but at least twice as fast) the prime swing algorithm.

A good starting point for the binomial function is here.

Dependencies

To build the sources you need for

  • the C++ version the MPIR library and the boost library.

  • The C# version can be configured to use System.Numerics.BigInteger or to use the MPIR library (an interop is provided).

  • The Java version needs Mikko Tommila's Apfloat library. If you want to compile the benchmark program additionally Karsten Lentzsch's JGoodies is needed.

Acknowledgement

Sonia Keys ported the algorithms to Go.

Contributing

Please notify me of any bugs. Want to contribute new algorithms? Great, please contact me. If you already ported to some other language (Scala, F#, Phython, Ruby, Lisp) then please send me your code so I can incorporate it into this repository.

fast-factorial-functions's People

Contributors

peterluschny avatar

Watchers

James Cloos avatar Nikos M. 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.