Git Product home page Git Product logo

nasa03 / fast-factorial-functions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from peterluschny/fast-factorial-functions

0.0 0.0 0.0 2.97 MB

Swing, divide and conquer the factorial!

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

License: MIT License

C++ 8.71% Python 2.32% Perl 0.75% Java 33.75% Go 5.60% C# 46.86% Julia 1.14% Makefile 0.12% Jupyter Notebook 0.75%

fast-factorial-functions's Introduction

Fast Factorial Functions

Project status: maintained and up-to-date.

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

See also this nice overview.

Short guide:

Implementation languages

  • Project MpirBasedFunctions : C++
  • Project SilverFactorial64 : C#
  • Project JavaFactorial : Java
  • Project GoFactorial : Go
  • Project SageMathFactorial : SageMath
  • Project PyFactorial : Python
  • Project JFactorial : Julia

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.

  • The C# version uses 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.

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#, Rust, Ruby, Lisp) then please send me your code so I can incorporate it into this repository.

Contributors

Sonia Keys ported the algorithms to Go.

Michael Saupe contributed a performance optimized python3 version with gmpy2.

fast-factorial-functions's People

Contributors

nathanhack avatar peterluschny 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.