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

Function p4

test/compute-engine/special-functions.test.ts:1453–1460  ·  view source on GitHub ↗
(c: any)

Source from the content-addressed store, hash-verified

1451// arguments). Both build on erf(z) = 1 − Γ(1/2, z²)/√π via
1452// incompleteGammaUpperComplex, reflected into the right half-plane (erf odd),
1453// with erfi(z) = −i·erf(i·z). Accuracy tracks that kernel (≲1e-12 for
1454// small/moderate |z|, degrading toward ~1e-7 in the large-|z| asymptotic
1455// region). Reference values from mpmath (dps=25).
1456describe('COMPLEX-ARGUMENT Erf, Erfi', () => {
1457 const expectComplex = (expr: any, re: number, im: number, tol = 1e-11) => {
1458 const v = expr.N();
1459 const scale = Math.hypot(re, im) * tol + tol;
1460 expect(Math.abs(v.re - re)).toBeLessThan(scale);
1461 expect(Math.abs(v.im - im)).toBeLessThan(scale);
1462 };
1463 const z = (re: number, im: number): any => ['Complex', re, im];

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected