(c: any)
| 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). |
| 1456 | describe('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]; |
no outgoing calls
no test coverage detected