Skip to content

mathinjenkins/stirling

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stirling

stirling calculates an approximation for factorials using Stirling's formula.

Method

The approximation is done using the equation where the value of is calculated using libpi, the value of e is calculated using libeuler. The square root is calculated using libsqrt, and the exponent is caclucated using libexponent.

Note that all of the used libraries (except libexponent) use some sort approximation to get the result. Therefore, the value of the factorial using this implementation of stirling formula is not accurate. In fact, since approximations are chained, the value might be badly inaccurate. This is intentional for thr purpose of the illustration of this project as outlined in What is Math in Jenkins?

Dependencies

Prerequisites

  • cmake
  • gcc or clang

Build

  • git clone --recursive git@github.com:mathinjenkins/stirling.git
  • cd stirling
  • ./build.sh

License

MIT License

Releases

No releases published

Packages

No packages published