@cortex-js/compute-engine 0.54.1 → 0.55.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compile.esm.js +24412 -0
- package/dist/compile.min.esm.js +941 -0
- package/dist/compile.min.umd.cjs +943 -0
- package/dist/compile.umd.cjs +24437 -0
- package/dist/compute-engine.esm.js +54357 -55186
- package/dist/compute-engine.min.esm.js +90 -99
- package/dist/compute-engine.min.umd.cjs +90 -99
- package/dist/compute-engine.umd.cjs +54581 -55410
- package/dist/core.esm.js +67441 -0
- package/dist/core.min.esm.js +1010 -0
- package/dist/core.min.umd.cjs +1012 -0
- package/dist/core.umd.cjs +67466 -0
- package/dist/interval.esm.js +13287 -0
- package/dist/interval.min.esm.js +18 -0
- package/dist/interval.min.umd.cjs +20 -0
- package/dist/interval.umd.cjs +13312 -0
- package/dist/latex-syntax.esm.js +14977 -0
- package/dist/latex-syntax.min.esm.js +7 -0
- package/dist/latex-syntax.min.umd.cjs +9 -0
- package/dist/latex-syntax.umd.cjs +15002 -0
- package/dist/math-json.esm.js +2 -2
- package/dist/math-json.min.esm.js +2 -2
- package/dist/math-json.min.umd.cjs +2 -2
- package/dist/math-json.umd.cjs +2 -2
- package/dist/numerics.esm.js +8618 -0
- package/dist/numerics.min.esm.js +5 -0
- package/dist/numerics.min.umd.cjs +7 -0
- package/dist/numerics.umd.cjs +8643 -0
- package/dist/types/big-decimal/big-decimal.d.ts +191 -0
- package/dist/types/big-decimal/index.d.ts +2 -0
- package/dist/types/big-decimal/transcendentals.d.ts +56 -0
- package/dist/types/big-decimal/utils.d.ts +86 -0
- package/dist/types/common/ansi-codes.d.ts +1 -1
- package/dist/types/common/configuration-change.d.ts +1 -1
- package/dist/types/common/fuzzy-string-match.d.ts +1 -1
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/interruptible.d.ts +1 -1
- package/dist/types/common/one-of.d.ts +1 -1
- package/dist/types/common/signals.d.ts +1 -1
- package/dist/types/common/type/ast-nodes.d.ts +1 -1
- package/dist/types/common/type/boxed-type.d.ts +1 -1
- package/dist/types/common/type/lexer.d.ts +1 -1
- package/dist/types/common/type/parse.d.ts +1 -1
- package/dist/types/common/type/parser.d.ts +1 -1
- package/dist/types/common/type/primitive.d.ts +1 -1
- package/dist/types/common/type/reduce.d.ts +1 -1
- package/dist/types/common/type/serialize.d.ts +1 -1
- package/dist/types/common/type/subtype.d.ts +1 -1
- package/dist/types/common/type/type-builder.d.ts +1 -1
- package/dist/types/common/type/types.d.ts +1 -1
- package/dist/types/common/type/utils.d.ts +1 -1
- package/dist/types/common/utils.d.ts +1 -1
- package/dist/types/compile.d.ts +10 -0
- package/dist/types/compute-engine/assume.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +45 -6
- package/dist/types/compute-engine/boxed-expression/apply.d.ts +4 -4
- package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/box.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +5 -5
- package/dist/types/compute-engine/boxed-expression/boxed-operator-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-value-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/cache.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/canonical-utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/canonical.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/compare.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/constants.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expand.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/factor.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/flatten.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/hold.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/inequality-bounds.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/init-lazy-refs.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/invisible-operator.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/match.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/negate.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/numerics.d.ts +4 -4
- package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/pattern-utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomial-degree.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/predicates.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/rules.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/sgn.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/simplify.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve-linear-system.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/stochastic-equal.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/type-guards.d.ts +1 -13
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
- package/dist/types/compute-engine/collection-utils.d.ts +3 -3
- package/dist/types/compute-engine/compilation/base-compiler.d.ts +1 -1
- package/dist/types/compute-engine/compilation/compile-expression.d.ts +1 -1
- package/dist/types/compute-engine/compilation/glsl-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/gpu-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/interval-javascript-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/javascript-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/python-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/types.d.ts +1 -1
- package/dist/types/compute-engine/compilation/wgsl-target.d.ts +1 -1
- package/dist/types/compute-engine/cost-function.d.ts +1 -1
- package/dist/types/compute-engine/engine-assumptions.d.ts +1 -1
- package/dist/types/compute-engine/engine-cache.d.ts +1 -1
- package/dist/types/compute-engine/engine-common-symbols.d.ts +1 -1
- package/dist/types/compute-engine/engine-compilation-targets.d.ts +1 -1
- package/dist/types/compute-engine/engine-configuration-lifecycle.d.ts +1 -1
- package/dist/types/compute-engine/engine-declarations.d.ts +1 -1
- package/dist/types/compute-engine/engine-expression-entrypoints.d.ts +4 -4
- package/dist/types/compute-engine/engine-extension-contracts.d.ts +1 -1
- package/dist/types/compute-engine/engine-library-bootstrap.d.ts +1 -4
- package/dist/types/compute-engine/engine-numeric-configuration.d.ts +11 -15
- package/dist/types/compute-engine/engine-runtime-state.d.ts +1 -1
- package/dist/types/compute-engine/engine-scope.d.ts +1 -1
- package/dist/types/compute-engine/engine-sequences.d.ts +1 -1
- package/dist/types/compute-engine/engine-simplification-rules.d.ts +1 -1
- package/dist/types/compute-engine/engine-startup-coordinator.d.ts +1 -1
- package/dist/types/compute-engine/engine-type-resolver.d.ts +1 -1
- package/dist/types/compute-engine/engine-validation-entrypoints.d.ts +2 -2
- package/dist/types/compute-engine/free-functions.d.ts +14 -14
- package/dist/types/compute-engine/function-utils.d.ts +1 -1
- package/dist/types/compute-engine/global-types.d.ts +1 -1
- package/dist/types/compute-engine/index.d.ts +55 -154
- package/dist/types/compute-engine/interval/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/interval/comparison.d.ts +1 -1
- package/dist/types/compute-engine/interval/elementary.d.ts +1 -1
- package/dist/types/compute-engine/interval/index.d.ts +1 -1
- package/dist/types/compute-engine/interval/trigonometric.d.ts +1 -1
- package/dist/types/compute-engine/interval/types.d.ts +1 -1
- package/dist/types/compute-engine/interval/util.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/default-dictionary.d.ts +37 -0
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-units.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/indexed-types.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +113 -0
- package/dist/types/compute-engine/latex-syntax/parse-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-symbol.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serialize-dms.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/types.d.ts +8 -8
- package/dist/types/compute-engine/latex-syntax/utils.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/calculus.d.ts +1 -1
- package/dist/types/compute-engine/library/collections.d.ts +1 -1
- package/dist/types/compute-engine/library/colors.d.ts +1 -1
- package/dist/types/compute-engine/library/combinatorics.d.ts +1 -1
- package/dist/types/compute-engine/library/complex.d.ts +1 -1
- package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
- package/dist/types/compute-engine/library/core.d.ts +1 -1
- package/dist/types/compute-engine/library/fractals.d.ts +1 -1
- package/dist/types/compute-engine/library/library.d.ts +3 -3
- package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/library/logic-analysis.d.ts +1 -1
- package/dist/types/compute-engine/library/logic.d.ts +1 -1
- package/dist/types/compute-engine/library/number-theory.d.ts +1 -1
- package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/library/quantity-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
- package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
- package/dist/types/compute-engine/library/sets.d.ts +1 -1
- package/dist/types/compute-engine/library/statistics.d.ts +1 -1
- package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/library/type-handlers.d.ts +1 -1
- package/dist/types/compute-engine/library/unit-data.d.ts +1 -1
- package/dist/types/compute-engine/library/units.d.ts +1 -1
- package/dist/types/compute-engine/library/utils.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +24 -9
- package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +6 -7
- package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +7 -8
- package/dist/types/compute-engine/numeric-value/types.d.ts +8 -8
- package/dist/types/compute-engine/numerics/bigint.d.ts +2 -2
- package/dist/types/compute-engine/numerics/expression.d.ts +1 -1
- package/dist/types/compute-engine/numerics/interval.d.ts +1 -1
- package/dist/types/compute-engine/numerics/linear-algebra.d.ts +4 -0
- package/dist/types/compute-engine/numerics/monte-carlo.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +4 -4
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric.d.ts +1 -1
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/numerics/rationals.d.ts +1 -1
- package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
- package/dist/types/compute-engine/numerics/special-functions.d.ts +27 -1
- package/dist/types/compute-engine/numerics/statistics.d.ts +12 -12
- package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
- package/dist/types/compute-engine/numerics/types.d.ts +2 -15
- package/dist/types/compute-engine/numerics/unit-data.d.ts +1 -1
- package/dist/types/compute-engine/oeis.d.ts +1 -1
- package/dist/types/compute-engine/sequence.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/antiderivative.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/derivative.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/distribute.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu-cost.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu-transforms.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/logic-utils.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-abs.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-divide.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-factorial.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-hyperbolic.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-infinity.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-log.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-logic.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-power.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-product.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-sum.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-trig.d.ts +1 -1
- package/dist/types/compute-engine/tensor/tensor-fields.d.ts +1 -1
- package/dist/types/compute-engine/tensor/tensors.d.ts +1 -1
- package/dist/types/compute-engine/types-definitions.d.ts +2 -4
- package/dist/types/compute-engine/types-engine.d.ts +40 -39
- package/dist/types/compute-engine/types-evaluation.d.ts +1 -1
- package/dist/types/compute-engine/types-expression.d.ts +49 -30
- package/dist/types/compute-engine/types-kernel-evaluation.d.ts +1 -1
- package/dist/types/compute-engine/types-kernel-serialization.d.ts +14 -5
- package/dist/types/compute-engine/types-serialization.d.ts +1 -1
- package/dist/types/compute-engine/types.d.ts +1 -1
- package/dist/types/compute-engine.d.ts +6 -3
- package/dist/types/core.d.ts +11 -0
- package/dist/types/interval.d.ts +8 -0
- package/dist/types/latex-syntax.d.ts +14 -0
- package/dist/types/math-json/symbols.d.ts +1 -1
- package/dist/types/math-json/types.d.ts +1 -1
- package/dist/types/math-json/utils.d.ts +1 -1
- package/dist/types/math-json.d.ts +2 -2
- package/dist/types/numerics.d.ts +23 -0
- package/package.json +31 -1
- package/dist/types/compute-engine/engine-latex-dictionary-state.d.ts +0 -13
- package/dist/types/compute-engine/engine-parse-entrypoint.d.ts +0 -7
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
export declare function gcd(a: BigNum, b: BigNum): BigNum;
|
|
3
3
|
export declare function lcm(a: BigNum, b: BigNum): BigNum;
|
|
4
|
-
export declare function factorial2(
|
|
4
|
+
export declare function factorial2(n: BigNum): Generator<BigNum, BigNum>;
|
|
5
5
|
/**
|
|
6
|
-
* If the
|
|
7
|
-
*
|
|
6
|
+
* If the BigDecimal can be faithfully represented as a machine number,
|
|
7
|
+
* return true.
|
|
8
8
|
*/
|
|
9
9
|
export declare function isInMachineRange(d: BigNum): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
export declare function isRational(x: unknown | null): x is Rational;
|
|
3
3
|
export declare function isMachineRational(x: unknown | null): x is [SmallInteger, SmallInteger];
|
|
4
4
|
export declare function isBigRational(x: unknown | null): x is [bigint, bigint];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
import type { BigNum } from './types';
|
|
3
3
|
export declare function gammaln(z: number): number;
|
|
4
4
|
export declare function gamma(z: number): number;
|
|
@@ -24,8 +24,34 @@ export declare function erfc(x: number): number;
|
|
|
24
24
|
* - NIST: https://dlmf.nist.gov/7.24#i
|
|
25
25
|
*/
|
|
26
26
|
export declare function erf(x: number): number;
|
|
27
|
+
/**
|
|
28
|
+
* Bignum log-Gamma via Stirling asymptotic series with runtime-computed
|
|
29
|
+
* Bernoulli numbers. Precision scales with BigDecimal.precision.
|
|
30
|
+
*
|
|
31
|
+
* Uses reflection for z < 0.5, exact formulas for positive integers and
|
|
32
|
+
* half-integers, and for the general case shifts z upward so the asymptotic
|
|
33
|
+
* series converges rapidly.
|
|
34
|
+
*/
|
|
27
35
|
export declare function bigGammaln(ce: ComputeEngine, z: BigNum): BigNum;
|
|
36
|
+
/**
|
|
37
|
+
* Bignum Gamma function. Precision scales with BigDecimal.precision.
|
|
38
|
+
*
|
|
39
|
+
* Reflection for z < 0.5; general case delegates to exp(bigGammaln(z)).
|
|
40
|
+
* Note: integer fast paths are in bigGammaln (returning exact ln(n!)).
|
|
41
|
+
* bigGamma goes through exp(ln(...)) so the result is a full-precision float.
|
|
42
|
+
*/
|
|
28
43
|
export declare function bigGamma(ce: ComputeEngine, z: BigNum): BigNum;
|
|
44
|
+
/**
|
|
45
|
+
* Compute even Bernoulli numbers B_2, B_4, ..., B_{2n} as exact rationals.
|
|
46
|
+
* Returns [numerator, denominator] bigint pairs reduced to lowest terms.
|
|
47
|
+
*
|
|
48
|
+
* Uses the identity: sum_{k=0}^{m-1} C(m,k) * B_k = 0 (for m >= 2)
|
|
49
|
+
* i.e. B_m = -1/(m+1) * sum_{k=0}^{m-1} C(m+1,k) * B_k
|
|
50
|
+
*
|
|
51
|
+
* Since all odd Bernoulli numbers except B_1 = -1/2 are zero, we compute
|
|
52
|
+
* all B_k (k=0,1,2,...,2n) but only return the even ones.
|
|
53
|
+
*/
|
|
54
|
+
export declare function computeBernoulliEven(n: number): [bigint, bigint][];
|
|
29
55
|
/**
|
|
30
56
|
* Bignum Digamma function ψ(z) = d/dz ln(Γ(z))
|
|
31
57
|
* Same algorithm as machine `digamma`: reflection for negative z,
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
export declare function mean(values: Iterable<number>): number;
|
|
3
|
-
export declare function bigMean(
|
|
3
|
+
export declare function bigMean(values: Iterable<BigDecimal>): BigDecimal;
|
|
4
4
|
export declare function median(values: Iterable<number>): number;
|
|
5
|
-
export declare function bigMedian(values: Iterable<
|
|
5
|
+
export declare function bigMedian(values: Iterable<BigDecimal>): BigDecimal;
|
|
6
6
|
export declare function variance(values: Iterable<number>): number;
|
|
7
|
-
export declare function bigVariance(
|
|
7
|
+
export declare function bigVariance(values: Iterable<BigDecimal>): BigDecimal;
|
|
8
8
|
export declare function populationVariance(values: Iterable<number>): number;
|
|
9
|
-
export declare function bigPopulationVariance(
|
|
9
|
+
export declare function bigPopulationVariance(values: Iterable<BigDecimal>): BigDecimal;
|
|
10
10
|
export declare function standardDeviation(values: Iterable<number>): number;
|
|
11
|
-
export declare function bigStandardDeviation(
|
|
11
|
+
export declare function bigStandardDeviation(values: Iterable<BigDecimal>): BigDecimal;
|
|
12
12
|
export declare function populationStandardDeviation(values: Iterable<number>): number;
|
|
13
|
-
export declare function bigPopulationStandardDeviation(
|
|
13
|
+
export declare function bigPopulationStandardDeviation(values: Iterable<BigDecimal>): BigDecimal;
|
|
14
14
|
export declare function kurtosis(values: Iterable<number>): number;
|
|
15
|
-
export declare function bigKurtosis(
|
|
15
|
+
export declare function bigKurtosis(values: Iterable<BigDecimal>): BigDecimal;
|
|
16
16
|
export declare function skewness(values: Iterable<number>): number;
|
|
17
|
-
export declare function bigSkewness(
|
|
17
|
+
export declare function bigSkewness(values: Iterable<BigDecimal>): BigDecimal;
|
|
18
18
|
export declare function mode(values: Iterable<number>): number;
|
|
19
|
-
export declare function bigMode(
|
|
19
|
+
export declare function bigMode(values: Iterable<BigDecimal>): BigDecimal;
|
|
20
20
|
export declare function quartiles(values: Iterable<number>): [number, number, number];
|
|
21
|
-
export declare function bigQuartiles(values: Iterable<
|
|
21
|
+
export declare function bigQuartiles(values: Iterable<BigDecimal>): [BigDecimal, BigDecimal, BigDecimal];
|
|
22
22
|
export declare function interquartileRange(values: Iterable<number>): number;
|
|
23
|
-
export declare function bigInterquartileRange(values: Iterable<
|
|
23
|
+
export declare function bigInterquartileRange(values: Iterable<BigDecimal>): BigDecimal;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
export declare function numberToString(num: number | bigint, fractionalDigits?: number | string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
/** @internal */
|
|
3
3
|
type IsInteger<N extends number> = `${N}` extends `${string}.${string}` ? never : `${N}` extends `-${string}.${string}` ? never : number;
|
|
4
4
|
/** A `SmallInteger` is an integer < 1e6
|
|
@@ -16,18 +16,5 @@ export type SmallInteger = IsInteger<number>;
|
|
|
16
16
|
*/
|
|
17
17
|
export type Rational = [SmallInteger, SmallInteger] | [bigint, bigint];
|
|
18
18
|
/** @category Numerics */
|
|
19
|
-
export type BigNum =
|
|
20
|
-
/** @category Numerics */
|
|
21
|
-
export type BigNumFactory = (value: Decimal.Value) => Decimal;
|
|
22
|
-
/** @category Numerics */
|
|
23
|
-
export interface IBigNum {
|
|
24
|
-
readonly _BIGNUM_NAN: BigNum;
|
|
25
|
-
readonly _BIGNUM_ZERO: BigNum;
|
|
26
|
-
readonly _BIGNUM_ONE: BigNum;
|
|
27
|
-
readonly _BIGNUM_TWO: BigNum;
|
|
28
|
-
readonly _BIGNUM_HALF: BigNum;
|
|
29
|
-
readonly _BIGNUM_PI: BigNum;
|
|
30
|
-
readonly _BIGNUM_NEGATIVE_ONE: BigNum;
|
|
31
|
-
bignum(value: string | number | bigint | BigNum): BigNum;
|
|
32
|
-
}
|
|
19
|
+
export type BigNum = BigDecimal;
|
|
33
20
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
export declare function simplifyHyperbolic(x: Expression): RuleStep | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
export declare function simplifyTrig(x: Expression): RuleStep | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
import { Expression, IComputeEngine as ComputeEngine, DataTypeMap, TensorDataType, TensorField } from '../global-types';
|
|
3
3
|
/** @category Tensors */
|
|
4
4
|
export declare function makeTensorField<DT extends keyof DataTypeMap>(ce: ComputeEngine, dtype: DT): TensorField<DataTypeMap[DT]>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
import type { Type, TypeString } from '../common/type/types';
|
|
3
3
|
import type { BoxedType } from '../common/type/boxed-type';
|
|
4
|
-
import type { LatexString
|
|
4
|
+
import type { LatexString } from './latex-syntax/types';
|
|
5
5
|
import type { Expression, ExpressionInput, CompiledExpression } from './types-expression';
|
|
6
6
|
import type { EvaluateOptions as KernelEvaluateOptions, Rule as KernelRule, BoxedRule as KernelBoxedRule, BoxedRuleSet as KernelBoxedRuleSet, Scope as KernelScope } from './types-kernel-evaluation';
|
|
7
7
|
/**
|
|
@@ -523,8 +523,6 @@ export interface LibraryDefinition {
|
|
|
523
523
|
requires?: string[];
|
|
524
524
|
/** Symbol and operator definitions */
|
|
525
525
|
definitions?: SymbolDefinitions | SymbolDefinitions[];
|
|
526
|
-
/** LaTeX dictionary entries for parsing/serialization */
|
|
527
|
-
latexDictionary?: Readonly<Partial<LatexDictionaryEntry>[]>;
|
|
528
526
|
}
|
|
529
527
|
/**
|
|
530
528
|
* When a unitless value is passed to or returned from a trigonometric function,
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
import type { OneOf } from '../common/one-of';
|
|
3
3
|
import type { MathJsonSymbol, MathJsonNumberObject } from '../math-json';
|
|
4
4
|
import type { Type, TypeString, TypeResolver } from '../common/type/types';
|
|
5
5
|
import type { BoxedType } from '../common/type/boxed-type';
|
|
6
6
|
import type { ConfigurationChangeListener } from '../common/configuration-change';
|
|
7
|
+
import type { ParseLatexOptions } from './latex-syntax/types';
|
|
7
8
|
import type { ExactNumericValueData, NumericValue, NumericValueData } from './numeric-value/types';
|
|
8
|
-
import type { BigNum,
|
|
9
|
-
import type { LatexDictionaryEntry, LatexString, ParseLatexOptions } from './latex-syntax/types';
|
|
10
|
-
import type { IndexedLatexDictionary } from './latex-syntax/dictionary/definitions';
|
|
9
|
+
import type { BigNum, Rational } from './numerics/types';
|
|
11
10
|
import type { Expression, ExpressionInput } from './types-expression';
|
|
12
11
|
import type { Metadata, CanonicalOptions, FormOption, BoxedSubstitution } from './types-serialization';
|
|
13
12
|
import type { AngularUnit, SymbolDefinition, OperatorDefinition, ValueDefinition, BoxedDefinition, SequenceDefinition, SequenceStatus, SequenceInfo, OEISSequenceInfo, OEISOptions } from './types-definitions';
|
|
@@ -20,12 +19,20 @@ type RuleStep = KernelRuleStep<Expression>;
|
|
|
20
19
|
type AssignValue = KernelAssignValue<Expression, ExpressionInput, IComputeEngine>;
|
|
21
20
|
type Scope = KernelScope<BoxedDefinition>;
|
|
22
21
|
type EvalContext = KernelEvalContext<Expression, BoxedDefinition>;
|
|
22
|
+
/** Minimal interface for a LaTeX parser/serializer.
|
|
23
|
+
* Structurally compatible with `LatexSyntax` without importing it. */
|
|
24
|
+
export interface ILatexSyntax {
|
|
25
|
+
parse(latex: string, options?: Partial<ParseLatexOptions>): import('../math-json/types').MathJsonExpression | null;
|
|
26
|
+
serialize(expr: import('../math-json/types').MathJsonExpression, options?: Record<string, unknown>): string;
|
|
27
|
+
}
|
|
23
28
|
/** @internal */
|
|
24
|
-
export interface IComputeEngine
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
export interface IComputeEngine {
|
|
30
|
+
/** The LatexSyntax instance used for LaTeX parsing/serialization.
|
|
31
|
+
* `undefined` when no LatexSyntax was provided to the constructor.
|
|
32
|
+
*/
|
|
33
|
+
readonly latexSyntax: ILatexSyntax | undefined;
|
|
34
|
+
/** @internal Returns the LatexSyntax instance or throws if unavailable. */
|
|
35
|
+
_requireLatexSyntax(): ILatexSyntax;
|
|
29
36
|
readonly True: Expression;
|
|
30
37
|
readonly False: Expression;
|
|
31
38
|
readonly Pi: Expression;
|
|
@@ -41,20 +48,6 @@ export interface IComputeEngine extends IBigNum {
|
|
|
41
48
|
readonly PositiveInfinity: Expression;
|
|
42
49
|
readonly NegativeInfinity: Expression;
|
|
43
50
|
readonly ComplexInfinity: Expression;
|
|
44
|
-
/** @internal */
|
|
45
|
-
readonly _BIGNUM_NAN: BigNum;
|
|
46
|
-
/** @internal */
|
|
47
|
-
readonly _BIGNUM_ZERO: BigNum;
|
|
48
|
-
/** @internal */
|
|
49
|
-
readonly _BIGNUM_ONE: BigNum;
|
|
50
|
-
/** @internal */
|
|
51
|
-
readonly _BIGNUM_TWO: BigNum;
|
|
52
|
-
/** @internal */
|
|
53
|
-
readonly _BIGNUM_HALF: BigNum;
|
|
54
|
-
/** @internal */
|
|
55
|
-
readonly _BIGNUM_PI: BigNum;
|
|
56
|
-
/** @internal */
|
|
57
|
-
readonly _BIGNUM_NEGATIVE_ONE: BigNum;
|
|
58
51
|
readonly context: EvalContext;
|
|
59
52
|
contextStack: ReadonlyArray<EvalContext>;
|
|
60
53
|
/** @internal */
|
|
@@ -95,10 +88,27 @@ export interface IComputeEngine extends IBigNum {
|
|
|
95
88
|
* Users can `push()` additional rules or replace the entire array. */
|
|
96
89
|
simplificationRules: Rule[];
|
|
97
90
|
strict: boolean;
|
|
91
|
+
expr(expr: NumericValue | ExpressionInput, options?: {
|
|
92
|
+
form?: FormOption;
|
|
93
|
+
scope?: Scope;
|
|
94
|
+
}): Expression;
|
|
95
|
+
/** @deprecated Use `expr()` instead. */
|
|
98
96
|
box(expr: NumericValue | ExpressionInput, options?: {
|
|
99
97
|
form?: FormOption;
|
|
100
98
|
scope?: Scope;
|
|
101
99
|
}): Expression;
|
|
100
|
+
/**
|
|
101
|
+
* Parse a LaTeX string and return a boxed expression.
|
|
102
|
+
*
|
|
103
|
+
* This is a convenience method equivalent to `ce.expr(parse(latex))`,
|
|
104
|
+
* but uses the engine's symbol definitions for better parsing accuracy.
|
|
105
|
+
*/
|
|
106
|
+
parse(latex: string, options?: Partial<ParseLatexOptions> & {
|
|
107
|
+
form?: FormOption;
|
|
108
|
+
}): Expression;
|
|
109
|
+
parse(latex: string | null, options?: Partial<ParseLatexOptions> & {
|
|
110
|
+
form?: FormOption;
|
|
111
|
+
}): Expression | null;
|
|
102
112
|
function(name: string, ops: ReadonlyArray<ExpressionInput>, options?: {
|
|
103
113
|
metadata?: Metadata;
|
|
104
114
|
form?: FormOption;
|
|
@@ -107,7 +117,7 @@ export interface IComputeEngine extends IBigNum {
|
|
|
107
117
|
/**
|
|
108
118
|
* This is a primitive to create a boxed function.
|
|
109
119
|
*
|
|
110
|
-
* In general, consider using `ce.
|
|
120
|
+
* In general, consider using `ce.expr()` or `ce.function()` or
|
|
111
121
|
* `canonicalXXX()` instead.
|
|
112
122
|
*
|
|
113
123
|
* The caller must ensure that the arguments are in canonical form:
|
|
@@ -124,13 +134,13 @@ export interface IComputeEngine extends IBigNum {
|
|
|
124
134
|
}): Expression;
|
|
125
135
|
/** @internal Compile a boxed expression. */
|
|
126
136
|
_compile(expr: Expression, options?: Record<string, unknown>): CompilationResult;
|
|
127
|
-
/**
|
|
128
|
-
registerCompilationTarget(name: string, target: LanguageTarget<Expression>): void;
|
|
129
|
-
/** Get a registered compilation target by name. */
|
|
137
|
+
/** @internal Get a registered compilation target by name. */
|
|
130
138
|
getCompilationTarget(name: string): LanguageTarget<Expression> | undefined;
|
|
131
|
-
/** Return the names of all registered compilation targets. */
|
|
139
|
+
/** @internal Return the names of all registered compilation targets. */
|
|
132
140
|
listCompilationTargets(): string[];
|
|
133
|
-
/**
|
|
141
|
+
/** @internal Register a compilation target. */
|
|
142
|
+
registerCompilationTarget(name: string, target: LanguageTarget<Expression>): void;
|
|
143
|
+
/** @internal Remove a registered compilation target. */
|
|
134
144
|
unregisterCompilationTarget(name: string): void;
|
|
135
145
|
/** @internal Fu trigonometric simplification algorithm */
|
|
136
146
|
_fuAlgorithm(expr: Expression, options?: Record<string, unknown>): RuleStep | undefined;
|
|
@@ -153,15 +163,6 @@ export interface IComputeEngine extends IBigNum {
|
|
|
153
163
|
canonical?: boolean;
|
|
154
164
|
}): BoxedRuleSet;
|
|
155
165
|
getRuleSet(id?: 'harmonization' | 'solve-univariate' | 'standard-simplification'): BoxedRuleSet | undefined;
|
|
156
|
-
parse(latex: null, options?: Partial<ParseLatexOptions> & {
|
|
157
|
-
form?: FormOption;
|
|
158
|
-
}): null;
|
|
159
|
-
parse(latex: LatexString, options?: Partial<ParseLatexOptions> & {
|
|
160
|
-
form?: FormOption;
|
|
161
|
-
}): Expression;
|
|
162
|
-
parse(latex: LatexString | null, options?: Partial<ParseLatexOptions> & {
|
|
163
|
-
form?: FormOption;
|
|
164
|
-
}): Expression | null;
|
|
165
166
|
pushScope(scope?: Scope, name?: string): void;
|
|
166
167
|
popScope(): void;
|
|
167
168
|
/**
|
|
@@ -212,7 +213,7 @@ export interface IComputeEngine extends IBigNum {
|
|
|
212
213
|
* @internal */
|
|
213
214
|
_declareSymbolOperator(name: string, def: OperatorDefinition, scope?: Scope): BoxedDefinition;
|
|
214
215
|
/**
|
|
215
|
-
* Use `ce.
|
|
216
|
+
* Use `ce.expr(id)` instead
|
|
216
217
|
* @internal */
|
|
217
218
|
_getSymbolValue(id: MathJsonSymbol): Expression | undefined;
|
|
218
219
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
import type { IComputeEngine as ComputeEngine } from './types-engine';
|
|
3
3
|
import type { Expression, ExpressionInput } from './types-expression';
|
|
4
4
|
import type { Assumption as KernelAssumption, AssumeResult, AssignValue as KernelAssignValue, BoxedRule as KernelBoxedRule, BoxedRuleSet as KernelBoxedRuleSet, EvaluateOptions as KernelEvaluateOptions, EvalContext as KernelEvalContext, ExpressionMapInterface as KernelExpressionMapInterface, Rule as KernelRule, RuleConditionFunction as KernelRuleConditionFunction, RuleFunction as KernelRuleFunction, RuleReplaceFunction as KernelRuleReplaceFunction, RuleStep as KernelRuleStep, RuleSteps as KernelRuleSteps, Scope as KernelScope } from './types-kernel-evaluation';
|