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

Function bigErf

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

Source from the content-addressed store, hash-verified

2703 * Reference: NIST DLMF 9.2, 9.4, 9.7
2704 */
2705export function airyBiPrime(x: number): number {
2706 if (!isFinite(x)) return NaN;
2707
2708 if (x > 9) {
2709 // Bi′(x) ~ x^{1/4} e^{ξ}/√π Σ v_k/ξ^k (DLMF 9.7.8)
2710 const xi = airyXi(x);
2711 const xiHi = xi[0];
2712 if (!Number.isFinite(xiHi)) return Infinity; // e^{ξ} overflows first
2713 let sum = 1;
2714 let t = 1; // u_k/ξ^k
2715 let prevAbs = Infinity;
2716 for (let k = 1; k <= 60; k++) {
2717 t *= airyURatio(k) / xiHi;
2718 const v = (t * (6 * k + 1)) / (1 - 6 * k); // v_k/ξ^k
2719 const av = Math.abs(v);
2720 if (av >= prevAbs) break; // divergent tail: stop at smallest term
2721 sum += v;
2722 prevAbs = av;
2723 if (av < 1e-18 * Math.abs(sum)) break;
2724 }

Callers 2

statistics.tsFile · 0.90
bigErfInvFunction · 0.85

Calls 9

withExtraPrecisionFunction · 0.85
bigErfSeriesFunction · 0.85
toNumberMethod · 0.80
toPrecisionMethod · 0.80
isZeroMethod · 0.65
negMethod · 0.65
isNaNMethod · 0.45
isFiniteMethod · 0.45
isNegativeMethod · 0.45

Tested by

no test coverage detected