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

Function trigFunction

src/compute-engine/library/trigonometry.ts:614–654  ·  view source on GitHub ↗
(
  operator: string,
  complexity: number,
  description?: string
)

Source from the content-addressed store, hash-verified

612 if (!shouldNumericize(numericApproximation, x)) return undefined;
613 return apply(
614 x,
615 (x) => sinc(x),
616 (x) => bigSinc(x)
617 );
618 },
619 },
620
621 /** FresnelS(x) = ∫₀ˣ sin(πt²/2) dt — odd function, S(∞) = 1/2 */
622 FresnelS: {
623 description: 'Fresnel sine integral.',
624 complexity: 5200,
625 broadcastable: true,
626 signature: '(number) -> real',
627 type: () => 'finite_real',
628 evaluate: ([x], { numericApproximation, engine: ce }) => {
629 if (!isNumber(x) || x.im !== 0) return undefined;
630 // Exact special values, regardless of numericApproximation
631 if (x.isSame(0)) return ce.Zero;
632 if (x.isInfinity) return x.isPositive ? ce.Half : ce.Half.neg();
633 if (!shouldNumericize(numericApproximation, x)) return undefined;
634 return apply(
635 x,
636 (x) => fresnelS(x),
637 (x) => bigFresnelS(x)
638 );
639 },
640 },
641
642 /** FresnelC(x) = ∫₀ˣ cos(πt²/2) dt — odd function, C(∞) = 1/2 */
643 FresnelC: {
644 description: 'Fresnel cosine integral.',
645 complexity: 5200,
646 broadcastable: true,
647 signature: '(number) -> real',
648 type: () => 'finite_real',
649 evaluate: ([x], { numericApproximation, engine: ce }) => {
650 if (!isNumber(x) || x.im !== 0) return undefined;
651 // Exact special values, regardless of numericApproximation
652 if (x.isSame(0)) return ce.Zero;
653 if (x.isInfinity) return x.isPositive ? ce.Half : ce.Half.neg();
654 if (!shouldNumericize(numericApproximation, x)) return undefined;
655 return apply(
656 x,
657 (x) => fresnelC(x),

Callers 1

trigonometry.tsFile · 0.85

Calls 9

elementaryFunctionTypeFunction · 0.90
trigSignFunction · 0.90
checkArityFunction · 0.90
evalTrigFunction · 0.90
constructibleValuesFunction · 0.90
isNumberFunction · 0.90
angularQuantityToRadiansFunction · 0.85
inverseHyperbolicPoleFunction · 0.85
_fnMethod · 0.65

Tested by

no test coverage detected