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

Function gauss2F1SeriesC

src/compute-engine/numerics/numeric-complex.ts:575–595  ·  view source on GitHub ↗
(
  a: Complex,
  b: Complex,
  c: Complex,
  z: Complex,
  maxTerms = 10_000
)

Source from the content-addressed store, hash-verified

573 }
574 const K = new Complex(Math.PI / 2, 0).div(a);
575 return K.mul(C_ONE.sub(sum));
576}
577
578//
579// ---------------- Carlson symmetric elliptic integrals (complex) ----------------
580//
581// Duplication-theorem algorithms (Carlson 1995, same series tails as the
582// machine-real kernels in numerics/special-functions.ts and as mpmath).
583// With principal-branch square roots the duplication theorem is valid for
584// arguments in the cut plane C ∖ (−∞, 0); arguments ON the negative real
585// axis are evaluated as their boundary value from above (Im → 0⁺), which
586// matches the mpmath/Mathematica convention for the incomplete elliptic
587// integrals built on them.
588//
589
590const CARLSON_TOL_C = 1e-24;
591
592/** Carlson R_C(x, y), complex, principal value for y on (−∞, 0). */
593export function carlsonRCComplex(x: Complex, y: Complex): Complex {
594 if (x.isNaN() || y.isNaN()) return C_NAN;
595 if (y.isZero()) return new Complex(Infinity, 0);
596 if (x.isZero()) return new Complex(Math.PI / 2, 0).div(y.sqrt());
597 // Cauchy principal value for real y < 0 (DLMF 19.2.20)
598 if (y.im === 0 && y.re < 0)

Callers 1

hypergeometric2F1ComplexFunction · 0.85

Calls 5

divMethod · 0.65
mulMethod · 0.65
addMethod · 0.65
isZeroMethod · 0.65
absMethod · 0.65

Tested by

no test coverage detected