( operator: string, complexity: number, description?: string )
| 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), |
no test coverage detected