Skip to content

Latest commit

 

History

History
25 lines (19 loc) · 1.51 KB

README.md

File metadata and controls

25 lines (19 loc) · 1.51 KB

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