Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@qubyte/gamma

qubyte17MIT2.0.0

the gamma function (Γ)

Γ, gamma, factorial, mathematics, lanczos, approximation, es, module

readme

gamma

gamma function in javascript using the lanczos approximation for small values and the spouge approximation for larger values

example

> import gamma from 'gamma'
> gamma(5)
23.999999999999996
> gamma(1.6)
0.8935153492876909

methods

import gamma from 'gamma'

gamma(z)

Return the gamma function over z. Complex numbers aren't supported, only reals.

log(z)

import { log } from 'gamma'

Return the natural log of the gamma function for z.

This function is used internally by the spouge approximation to compute large values.

install

With npm do:

npm install @qubyte/gamma

kudos

Implementation transliterated from the python script on the wikipedia entry for the lanczos approximation.

Spouge approximation from Niggler.

license

MIT