MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / gammaCore

Function gammaCore

src/compute-engine/numerics/special-functions.ts:655–666  ·  view source on GitHub ↗
(ce: ComputeEngine, z: BigNum)

Source from the content-addressed store, hash-verified

653 if (k > 0 && term.abs().lt(tol)) break;
654 result = result.add(term);
655 pw = pw._mulToPrecision(u, p);
656 }
657
658 return result.sub(logProduct);
659}
660
661/**
662 * Bignum Gamma function. Precision scales with BigDecimal.precision.
663 *
664 * Reflection for z < 0.5; general case delegates to exp(bigGammaln(z)).
665 * Note: integer fast paths are in bigGammaln (returning exact ln(n!)).
666 * bigGamma goes through exp(ln(...)) so the result is a full-precision float.
667 */
668export function bigGamma(ce: ComputeEngine, z: BigNum): BigNum {
669 // Exact: positive integer → (z-1)! (precision-independent, skip the

Callers 3

bigGammaFunction · 0.85
bigBetaFunction · 0.85
zetaCoreFunction · 0.85

Calls 8

gammalnCoreFunction · 0.85
sinMethod · 0.80
mulMethod · 0.65
isZeroMethod · 0.65
divMethod · 0.65
subMethod · 0.65
expMethod · 0.65
ltMethod · 0.45

Tested by

no test coverage detected