@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
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/* 0.55.0 */
|
|
2
|
+
* BigDecimal: an arbitrary-precision decimal type.
|
|
3
|
+
*
|
|
4
|
+
* Value = significand * 10^exponent
|
|
5
|
+
*
|
|
6
|
+
* The representation is always normalized: trailing zeros in the significand
|
|
7
|
+
* are stripped and the exponent adjusted accordingly.
|
|
8
|
+
*
|
|
9
|
+
* Special values:
|
|
10
|
+
* - NaN: { significand: 0n, exponent: NaN }
|
|
11
|
+
* - +Infinity: { significand: 1n, exponent: Infinity }
|
|
12
|
+
* - -Infinity: { significand: -1n, exponent: Infinity }
|
|
13
|
+
*/
|
|
14
|
+
import { PI_DIGITS } from './utils';
|
|
15
|
+
export { PI_DIGITS };
|
|
16
|
+
export declare class BigDecimal {
|
|
17
|
+
/** Working precision (significant digits) for inexact operations like division. */
|
|
18
|
+
static precision: number;
|
|
19
|
+
static readonly ZERO: BigDecimal;
|
|
20
|
+
static readonly ONE: BigDecimal;
|
|
21
|
+
static readonly TWO: BigDecimal;
|
|
22
|
+
static readonly NEGATIVE_ONE: BigDecimal;
|
|
23
|
+
static readonly HALF: BigDecimal;
|
|
24
|
+
static readonly NAN: BigDecimal;
|
|
25
|
+
static readonly POSITIVE_INFINITY: BigDecimal;
|
|
26
|
+
static readonly NEGATIVE_INFINITY: BigDecimal;
|
|
27
|
+
/** Full-precision PI (1100+ digits) */
|
|
28
|
+
private static _piFullPrecision;
|
|
29
|
+
/** PI rounded to working precision */
|
|
30
|
+
private static _piCache;
|
|
31
|
+
private static _piCachePrecision;
|
|
32
|
+
/** PI to current working precision. */
|
|
33
|
+
static get PI(): BigDecimal;
|
|
34
|
+
readonly significand: bigint;
|
|
35
|
+
readonly exponent: number;
|
|
36
|
+
constructor(value: string | number | bigint | BigDecimal);
|
|
37
|
+
/** True when this value represents NaN. */
|
|
38
|
+
isNaN(): boolean;
|
|
39
|
+
/** True when significand is 0 and the value is not NaN. */
|
|
40
|
+
isZero(): boolean;
|
|
41
|
+
/** True when the exponent is finite (not NaN, not +/-Infinity). */
|
|
42
|
+
isFinite(): boolean;
|
|
43
|
+
/** True when the value represents a mathematical integer (exponent >= 0) and is finite. */
|
|
44
|
+
isInteger(): boolean;
|
|
45
|
+
/** True when significand > 0 (including positive infinity). */
|
|
46
|
+
isPositive(): boolean;
|
|
47
|
+
/** True when significand < 0 (including negative infinity). */
|
|
48
|
+
isNegative(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Compare this value with another.
|
|
51
|
+
* Returns -1 if this < other, 0 if equal, 1 if this > other, NaN if either is NaN.
|
|
52
|
+
*/
|
|
53
|
+
cmp(other: BigDecimal | number): -1 | 0 | 1;
|
|
54
|
+
/**
|
|
55
|
+
* Returns true if this value equals other.
|
|
56
|
+
* NaN === NaN → false (standard NaN semantics).
|
|
57
|
+
*/
|
|
58
|
+
eq(other: BigDecimal | number): boolean;
|
|
59
|
+
/** Returns true if this value is strictly less than other. */
|
|
60
|
+
lt(other: BigDecimal | number): boolean;
|
|
61
|
+
/** Returns true if this value is less than or equal to other. */
|
|
62
|
+
lte(other: BigDecimal | number): boolean;
|
|
63
|
+
/** Returns true if this value is strictly greater than other. */
|
|
64
|
+
gt(other: BigDecimal | number): boolean;
|
|
65
|
+
/** Returns true if this value is greater than or equal to other. */
|
|
66
|
+
gte(other: BigDecimal | number): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Add this value to another.
|
|
69
|
+
* Aligns exponents, adds significands. The result is exact.
|
|
70
|
+
*/
|
|
71
|
+
add(other: BigDecimal | number): BigDecimal;
|
|
72
|
+
/**
|
|
73
|
+
* Subtract other from this.
|
|
74
|
+
* Aligns exponents, subtracts significands. The result is exact.
|
|
75
|
+
*/
|
|
76
|
+
sub(other: BigDecimal | number): BigDecimal;
|
|
77
|
+
/**
|
|
78
|
+
* Multiply this value by another.
|
|
79
|
+
* Multiplies significands, adds exponents. The result is exact.
|
|
80
|
+
*/
|
|
81
|
+
mul(other: BigDecimal | number): BigDecimal;
|
|
82
|
+
/**
|
|
83
|
+
* Negate this value. Zero.neg() → Zero.
|
|
84
|
+
*/
|
|
85
|
+
neg(): BigDecimal;
|
|
86
|
+
/**
|
|
87
|
+
* Absolute value. If already non-negative, returns this.
|
|
88
|
+
*/
|
|
89
|
+
abs(): BigDecimal;
|
|
90
|
+
/**
|
|
91
|
+
* Round toward -Infinity.
|
|
92
|
+
* `3.7` → `3`, `-3.7` → `-4`.
|
|
93
|
+
* For integers returns this. NaN/Infinity → return this.
|
|
94
|
+
*/
|
|
95
|
+
floor(): BigDecimal;
|
|
96
|
+
/**
|
|
97
|
+
* Round toward +Infinity.
|
|
98
|
+
* `3.2` → `4`, `-3.2` → `-3`.
|
|
99
|
+
* For integers returns this. NaN/Infinity → return this.
|
|
100
|
+
*/
|
|
101
|
+
ceil(): BigDecimal;
|
|
102
|
+
/**
|
|
103
|
+
* Round half away from zero (standard math rounding).
|
|
104
|
+
* `3.5` → `4`, `-3.5` → `-4`, `3.4` → `3`, `3.6` → `4`.
|
|
105
|
+
* For integers returns this. NaN/Infinity → return this.
|
|
106
|
+
*/
|
|
107
|
+
round(): BigDecimal;
|
|
108
|
+
/**
|
|
109
|
+
* Truncate toward zero, removing the fractional part.
|
|
110
|
+
* For integers (exponent >= 0) returns this.
|
|
111
|
+
* NaN → NaN, +/-Infinity → +/-Infinity.
|
|
112
|
+
*/
|
|
113
|
+
trunc(): BigDecimal;
|
|
114
|
+
/**
|
|
115
|
+
* Divide this value by another.
|
|
116
|
+
* Uses `BigDecimal.precision` to determine significant digits for inexact results.
|
|
117
|
+
*
|
|
118
|
+
* Special cases:
|
|
119
|
+
* - NaN / x → NaN, x / NaN → NaN
|
|
120
|
+
* - nonzero / 0 → +/-Infinity (matching Decimal.js behavior)
|
|
121
|
+
* - 0 / 0 → NaN
|
|
122
|
+
* - Inf / finite → Inf (correct sign)
|
|
123
|
+
* - finite / Inf → 0
|
|
124
|
+
* - Inf / Inf → NaN
|
|
125
|
+
*/
|
|
126
|
+
div(other: BigDecimal | number): BigDecimal;
|
|
127
|
+
/**
|
|
128
|
+
* Multiplicative inverse: 1 / this.
|
|
129
|
+
* Uses `BigDecimal.precision` for the division.
|
|
130
|
+
*/
|
|
131
|
+
inv(): BigDecimal;
|
|
132
|
+
/**
|
|
133
|
+
* Modulo (remainder after truncating division).
|
|
134
|
+
* Defined as: this - trunc(this / other) * other
|
|
135
|
+
*
|
|
136
|
+
* The sign of the result matches the sign of the dividend (this),
|
|
137
|
+
* consistent with JavaScript's % operator and Decimal.js.
|
|
138
|
+
*/
|
|
139
|
+
mod(other: BigDecimal | number): BigDecimal;
|
|
140
|
+
/**
|
|
141
|
+
* Raise to a power.
|
|
142
|
+
*
|
|
143
|
+
* - Integer exponent: exact result via repeated squaring
|
|
144
|
+
* - Zero exponent: 1 (for any non-NaN base)
|
|
145
|
+
* - Negative integer exponent: pow(abs(n)).inv() (uses precision)
|
|
146
|
+
* - Non-integer exponent on positive base: exp(n * ln(this))
|
|
147
|
+
* - Non-integer exponent on negative base: NaN (real-valued result doesn't exist)
|
|
148
|
+
*
|
|
149
|
+
* Special cases:
|
|
150
|
+
* - NaN base or exponent → NaN
|
|
151
|
+
* - Infinite exponent → NaN
|
|
152
|
+
* - 0^0 → 1 (mathematical convention)
|
|
153
|
+
* - 0^positive → 0
|
|
154
|
+
* - 0^negative → Infinity
|
|
155
|
+
*/
|
|
156
|
+
pow(n: BigDecimal | number): BigDecimal;
|
|
157
|
+
/** Convert to a JavaScript number. May lose precision for large values. */
|
|
158
|
+
toNumber(): number;
|
|
159
|
+
/**
|
|
160
|
+
* Reconstruct a decimal string from significand and exponent.
|
|
161
|
+
*
|
|
162
|
+
* For normal-range exponents, produces a clean decimal string.
|
|
163
|
+
* For very large (> 20) or very small (< -6) adjusted exponents,
|
|
164
|
+
* uses scientific notation like `'1.5e+25'`.
|
|
165
|
+
*/
|
|
166
|
+
toString(): string;
|
|
167
|
+
/**
|
|
168
|
+
* Format with a fixed number of decimal places.
|
|
169
|
+
*
|
|
170
|
+
* Rounds to the specified number of digits after the decimal point
|
|
171
|
+
* using round-half-to-even (banker's rounding) for the tie-breaking case.
|
|
172
|
+
* If `digits` is undefined, behaves like toFixed(0).
|
|
173
|
+
*/
|
|
174
|
+
toFixed(digits?: number): string;
|
|
175
|
+
/**
|
|
176
|
+
* Round to n significant digits, returning a new BigDecimal.
|
|
177
|
+
* Uses round-half-to-even for tie-breaking.
|
|
178
|
+
* If the value already has n or fewer significant digits, returns this.
|
|
179
|
+
*/
|
|
180
|
+
toPrecision(n: number): BigDecimal;
|
|
181
|
+
/**
|
|
182
|
+
* Truncate fractional part and return a bigint.
|
|
183
|
+
* Throws if the value is NaN or Infinity.
|
|
184
|
+
*/
|
|
185
|
+
toBigInt(): bigint;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Create a BigDecimal directly from significand + exponent, normalizing.
|
|
189
|
+
* Avoids the constructor's string/number parsing overhead.
|
|
190
|
+
*/
|
|
191
|
+
export declare function fromRaw(sig: bigint, exp: number): BigDecimal;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* 0.55.0 */
|
|
2
|
+
* Transcendental / irrational operations for BigDecimal.
|
|
3
|
+
*
|
|
4
|
+
* This module attaches `sqrt()` and `cbrt()` to BigDecimal.prototype
|
|
5
|
+
* via declaration merging. It is imported for side effects in index.ts.
|
|
6
|
+
*/
|
|
7
|
+
declare module './big-decimal' {
|
|
8
|
+
interface BigDecimal {
|
|
9
|
+
/** Square root. Returns NaN for negative values. */
|
|
10
|
+
sqrt(): BigDecimal;
|
|
11
|
+
/** Cube root. Supports negative values. */
|
|
12
|
+
cbrt(): BigDecimal;
|
|
13
|
+
/** Exponential: e^this. */
|
|
14
|
+
exp(): BigDecimal;
|
|
15
|
+
/** Natural logarithm. Returns NaN for negative values, -Infinity for zero. */
|
|
16
|
+
ln(): BigDecimal;
|
|
17
|
+
/** Logarithm with specified base. */
|
|
18
|
+
log(base: BigDecimal | number): BigDecimal;
|
|
19
|
+
/** Sine. Returns NaN for NaN/Infinity inputs. */
|
|
20
|
+
sin(): BigDecimal;
|
|
21
|
+
/** Cosine. Returns NaN for NaN/Infinity inputs. */
|
|
22
|
+
cos(): BigDecimal;
|
|
23
|
+
/** Tangent. Returns NaN for NaN/Infinity inputs. */
|
|
24
|
+
tan(): BigDecimal;
|
|
25
|
+
/** Inverse sine (arcsine). Returns NaN for |x| > 1. */
|
|
26
|
+
asin(): BigDecimal;
|
|
27
|
+
/** Inverse cosine (arccosine). Returns NaN for |x| > 1. */
|
|
28
|
+
acos(): BigDecimal;
|
|
29
|
+
/** Inverse tangent (arctangent). */
|
|
30
|
+
atan(): BigDecimal;
|
|
31
|
+
/** Hyperbolic sine. */
|
|
32
|
+
sinh(): BigDecimal;
|
|
33
|
+
/** Hyperbolic cosine. */
|
|
34
|
+
cosh(): BigDecimal;
|
|
35
|
+
/** Hyperbolic tangent. */
|
|
36
|
+
tanh(): BigDecimal;
|
|
37
|
+
}
|
|
38
|
+
namespace BigDecimal {
|
|
39
|
+
function sqrt(x: BigDecimal): BigDecimal;
|
|
40
|
+
function cbrt(x: BigDecimal): BigDecimal;
|
|
41
|
+
function exp(x: BigDecimal): BigDecimal;
|
|
42
|
+
function ln(x: BigDecimal): BigDecimal;
|
|
43
|
+
function log10(x: BigDecimal): BigDecimal;
|
|
44
|
+
function sin(x: BigDecimal): BigDecimal;
|
|
45
|
+
function cos(x: BigDecimal): BigDecimal;
|
|
46
|
+
function tan(x: BigDecimal): BigDecimal;
|
|
47
|
+
function asin(x: BigDecimal): BigDecimal;
|
|
48
|
+
function acos(x: BigDecimal): BigDecimal;
|
|
49
|
+
function atan(x: BigDecimal): BigDecimal;
|
|
50
|
+
function atan2(y: BigDecimal | number, x: BigDecimal): BigDecimal;
|
|
51
|
+
function sinh(x: BigDecimal): BigDecimal;
|
|
52
|
+
function cosh(x: BigDecimal): BigDecimal;
|
|
53
|
+
function tanh(x: BigDecimal): BigDecimal;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* 0.55.0 */
|
|
2
|
+
* Fixed-point BigInt utilities for internal use by transcendental functions.
|
|
3
|
+
*
|
|
4
|
+
* A "fixed-point BigInt" represents a real number as `value = n / scale`,
|
|
5
|
+
* where `scale = 10^p` for some working precision p. All arithmetic
|
|
6
|
+
* stays in BigInt to preserve arbitrary precision.
|
|
7
|
+
*/
|
|
8
|
+
/** Return 10^n as a bigint, caching values for n <= 100. */
|
|
9
|
+
export declare function pow10(n: number): bigint;
|
|
10
|
+
/** Fixed-point multiply: (a * b) / scale */
|
|
11
|
+
export declare function fpmul(a: bigint, b: bigint, scale: bigint): bigint;
|
|
12
|
+
/** Fixed-point divide: (a * scale) / b */
|
|
13
|
+
export declare function fpdiv(a: bigint, b: bigint, scale: bigint): bigint;
|
|
14
|
+
/**
|
|
15
|
+
* Fixed-point square root via Newton/Heron iteration.
|
|
16
|
+
*
|
|
17
|
+
* Input: `a` is a fixed-point value representing `a / scale`.
|
|
18
|
+
* Output: `sqrt(a / scale) * scale` as a bigint.
|
|
19
|
+
*
|
|
20
|
+
* Algorithm:
|
|
21
|
+
* x_{n+1} = (x + a * scale / x) / 2
|
|
22
|
+
* Converge until |x_{n+1} - x_n| <= 1 (one ULP in the fixed-point representation).
|
|
23
|
+
*/
|
|
24
|
+
export declare function fpsqrt(a: bigint, scale: bigint): bigint;
|
|
25
|
+
/** Absolute value of a bigint. */
|
|
26
|
+
export declare function bigintAbs(n: bigint): bigint;
|
|
27
|
+
/** Sign of a bigint: -1n, 0n, or 1n. */
|
|
28
|
+
export declare function bigintSign(n: bigint): bigint;
|
|
29
|
+
/** Count the number of decimal digits in a bigint (absolute value). */
|
|
30
|
+
export declare function bigintDigits(n: bigint): number;
|
|
31
|
+
/**
|
|
32
|
+
* Fixed-point exponential: compute exp(x/scale) * scale.
|
|
33
|
+
*
|
|
34
|
+
* Uses Taylor series with argument reduction (halving) and
|
|
35
|
+
* repeated squaring to reconstruct the full result.
|
|
36
|
+
*
|
|
37
|
+
* @param x Fixed-point input (represents x/scale)
|
|
38
|
+
* @param scale The fixed-point scale (10^precision)
|
|
39
|
+
* @returns exp(x/scale) * scale as a bigint
|
|
40
|
+
*/
|
|
41
|
+
export declare function fpexp(x: bigint, scale: bigint): bigint;
|
|
42
|
+
/**
|
|
43
|
+
* Fixed-point natural logarithm: compute ln(x/scale) * scale.
|
|
44
|
+
*
|
|
45
|
+
* Uses Newton's method on f(y) = exp(y) - x, where y = ln(x):
|
|
46
|
+
* y_{n+1} = y + x/exp(y) - 1
|
|
47
|
+
*
|
|
48
|
+
* Converges quadratically from a double-precision seed.
|
|
49
|
+
*
|
|
50
|
+
* @param x Fixed-point input (represents x/scale), must be positive
|
|
51
|
+
* @param scale The fixed-point scale (10^precision)
|
|
52
|
+
* @returns ln(x/scale) * scale as a bigint
|
|
53
|
+
*/
|
|
54
|
+
export declare function fpln(x: bigint, scale: bigint): bigint;
|
|
55
|
+
/** PI digits without decimal point (2370 digits). */
|
|
56
|
+
export declare const PI_DIGITS: string;
|
|
57
|
+
/**
|
|
58
|
+
* Compute sin(x/scale) and cos(x/scale) simultaneously, returning
|
|
59
|
+
* [sin * scale, cos * scale] as fixed-point bigints.
|
|
60
|
+
*
|
|
61
|
+
* Algorithm:
|
|
62
|
+
* 1. Reduce x mod 2π
|
|
63
|
+
* 2. Quadrant reduction to [0, π/2]
|
|
64
|
+
* 3. Double-angle halving until |arg| < scale/2
|
|
65
|
+
* 4. Taylor series for small arg
|
|
66
|
+
* 5. Reconstruct via double-angle formulas
|
|
67
|
+
*
|
|
68
|
+
* @param x Fixed-point input (represents x/scale)
|
|
69
|
+
* @param scale The fixed-point scale (10^precision)
|
|
70
|
+
* @returns [sin(x/scale)*scale, cos(x/scale)*scale]
|
|
71
|
+
*/
|
|
72
|
+
export declare function fpsincos(x: bigint, scale: bigint): [bigint, bigint];
|
|
73
|
+
/**
|
|
74
|
+
* Compute atan(x/scale) * scale as a fixed-point bigint.
|
|
75
|
+
*
|
|
76
|
+
* Algorithm:
|
|
77
|
+
* 1. Handle sign: atan(-x) = -atan(x)
|
|
78
|
+
* 2. If |x| > scale (i.e., |x/scale| > 1): atan(x) = π/2 - atan(scale²/x)
|
|
79
|
+
* 3. Halving: if |x| > 0.4*scale, use atan(x) = 2·atan(x / (1 + sqrt(scale² + x²)))
|
|
80
|
+
* 4. Taylor series: atan(r) = r - r³/3 + r⁵/5 - ...
|
|
81
|
+
*
|
|
82
|
+
* @param x Fixed-point input (represents x/scale)
|
|
83
|
+
* @param scale The fixed-point scale (10^precision)
|
|
84
|
+
* @returns atan(x/scale) * scale
|
|
85
|
+
*/
|
|
86
|
+
export declare function fpatan(x: bigint, scale: bigint): bigint;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
export declare function fuzzyStringMatch(invalidWord: string, validWords: string[]): string | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
export type RuntimeSignalCode = 'timeout' | 'out-of-memory' | 'recursion-depth-exceeded' | 'iteration-limit-exceeded';
|
|
3
3
|
/** @category Error Handling */
|
|
4
4
|
export type SignalCode = RuntimeSignalCode | ('invalid-name' | 'expected-predicate' | 'expected-symbol' | 'operator-requires-one-operand' | 'postfix-operator-requires-one-operand' | 'prefix-operator-requires-one-operand' | 'unbalanced-symbols' | 'expected-argument' | 'unexpected-command' | 'cyclic-definition' | 'invalid-supersets' | 'expected-supersets' | 'unknown-domain' | 'duplicate-wikidata' | 'invalid-dictionary-entry' | 'syntax-error');
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
export declare function typeToString(type: Type, precedence?: number): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* 0.55.0 */
|
|
2
|
+
export { compile } from './compute-engine/compilation/compile-expression';
|
|
3
|
+
export { JavaScriptTarget } from './compute-engine/compilation/javascript-target';
|
|
4
|
+
export { GPUShaderTarget } from './compute-engine/compilation/gpu-target';
|
|
5
|
+
export { GLSLTarget } from './compute-engine/compilation/glsl-target';
|
|
6
|
+
export { WGSLTarget } from './compute-engine/compilation/wgsl-target';
|
|
7
|
+
export { PythonTarget } from './compute-engine/compilation/python-target';
|
|
8
|
+
export { IntervalJavaScriptTarget } from './compute-engine/compilation/interval-javascript-target';
|
|
9
|
+
export { BaseCompiler } from './compute-engine/compilation/base-compiler';
|
|
10
|
+
export type { CompileTarget, CompiledOperators, CompiledFunctions, CompilationOptions, CompilationResult, ExecutableTarget, ComplexResult, CompiledRunner, ExpressionRunner, LambdaRunner, LanguageTarget, TargetSource, CompiledFunction, } from './compute-engine/compilation/types';
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
import type { MathJsonExpression, MathJsonSymbol } from '../../math-json/types';
|
|
3
3
|
import type { Type, TypeString } from '../../common/type/types';
|
|
4
4
|
import { BoxedType } from '../../common/type/boxed-type';
|
|
5
5
|
import type { BoxedSubstitution, Metadata, Substitution, CanonicalOptions, BoxedRuleSet, Rule, BoxedBaseDefinition, BoxedValueDefinition, BoxedOperatorDefinition, EvaluateOptions, ExpressionInput, Sign, Expression, JsonSerializationOptions, PatternMatchOptions, SimplifyOptions, IComputeEngine as ComputeEngine, Scope, Tensor, TensorDataType } from '../global-types';
|
|
6
6
|
import type { NumericValue } from '../numeric-value/types';
|
|
7
7
|
import type { SmallInteger } from '../numerics/types';
|
|
8
|
-
import type { LatexString, SerializeLatexOptions } from '../latex-syntax/types';
|
|
9
8
|
type SerializeJsonFn = (ce: ComputeEngine, expr: Expression, options: Readonly<JsonSerializationOptions>) => MathJsonExpression;
|
|
10
9
|
/** @internal */
|
|
11
10
|
export declare function _setSerializeJson(fn: SerializeJsonFn): void;
|
|
@@ -49,14 +48,54 @@ export declare abstract class _BoxedExpression implements Expression {
|
|
|
49
48
|
[Symbol.toPrimitive](hint: 'number' | 'string' | 'default'): number | string | null;
|
|
50
49
|
/** Object.toString() */
|
|
51
50
|
toString(): string;
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Return a LaTeX representation of this expression.
|
|
53
|
+
*
|
|
54
|
+
* This is a convenience getter that delegates to the standalone
|
|
55
|
+
* `serialize()` function from the `latex-syntax` module.
|
|
56
|
+
*
|
|
57
|
+
* Uses `toMathJson()` (not `.json`) so that the serialized form
|
|
58
|
+
* reflects the canonical/simplified structure, matching the behavior
|
|
59
|
+
* of the engine-based serializer.
|
|
60
|
+
*
|
|
61
|
+
* Numeric values are rounded to `ce.precision` significant digits
|
|
62
|
+
* (via `fractionalDigits: 'auto'`). This ensures that noise digits
|
|
63
|
+
* from precision-bounded operations are not displayed.
|
|
64
|
+
*/
|
|
65
|
+
get latex(): string;
|
|
66
|
+
/**
|
|
67
|
+
* Return a LaTeX representation of this expression with custom
|
|
68
|
+
* serialization options.
|
|
69
|
+
*
|
|
70
|
+
* This delegates to `LatexSyntax.serialize()` with the provided options.
|
|
71
|
+
* Uses `toMathJson()` to get the canonical/simplified form.
|
|
72
|
+
*
|
|
73
|
+
* Numeric values are rounded to `ce.precision` significant digits
|
|
74
|
+
* (via `fractionalDigits: 'auto'`).
|
|
75
|
+
*/
|
|
76
|
+
toLatex(options?: Record<string, any>): string;
|
|
54
77
|
/** Called by `JSON.stringify()` when serializing to json.
|
|
55
78
|
*
|
|
56
79
|
* Note: this is a standard method of JavaScript objects.
|
|
57
80
|
*
|
|
81
|
+
* Returns the full raw value with no precision rounding, identical to
|
|
82
|
+
* `.json`. This preserves data fidelity for lossless round-tripping.
|
|
83
|
+
* For precision-rounded MathJSON, use
|
|
84
|
+
* `toMathJson({ fractionalDigits: 'auto' })`.
|
|
58
85
|
*/
|
|
59
86
|
toJSON(): MathJsonExpression;
|
|
87
|
+
/**
|
|
88
|
+
* Serialize to MathJSON with configurable options.
|
|
89
|
+
*
|
|
90
|
+
* The `fractionalDigits` option controls how many digits are emitted
|
|
91
|
+
* for arbitrary-precision numbers:
|
|
92
|
+
* - `'max'` (default): all available digits, no rounding
|
|
93
|
+
* - `'auto'`: round to `ce.precision` significant digits
|
|
94
|
+
* - `n` (number >= 0): exactly `n` digits after the decimal point
|
|
95
|
+
*
|
|
96
|
+
* Internally, `'auto'` is converted to `-ce.precision` to signal
|
|
97
|
+
* total significant digits (negative value) to the serializer.
|
|
98
|
+
*/
|
|
60
99
|
toMathJson(options?: Readonly<Partial<JsonSerializationOptions>>): MathJsonExpression;
|
|
61
100
|
print(): void;
|
|
62
101
|
get isStructural(): boolean;
|
|
@@ -72,8 +111,8 @@ export declare abstract class _BoxedExpression implements Expression {
|
|
|
72
111
|
get isOdd(): boolean | undefined;
|
|
73
112
|
get re(): number;
|
|
74
113
|
get im(): number;
|
|
75
|
-
get bignumRe():
|
|
76
|
-
get bignumIm():
|
|
114
|
+
get bignumRe(): BigDecimal | undefined;
|
|
115
|
+
get bignumIm(): BigDecimal | undefined;
|
|
77
116
|
get sgn(): Sign | undefined;
|
|
78
117
|
get isPositive(): boolean | undefined;
|
|
79
118
|
get isNonNegative(): boolean | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import {
|
|
1
|
+
/* 0.55.0 */
|
|
2
|
+
import { BigDecimal } from '../../big-decimal';
|
|
3
3
|
import type { Expression } from '../global-types';
|
|
4
|
-
export declare function apply(expr: Expression, fn: (x: number) => number | Complex, bigFn?: (x:
|
|
5
|
-
export declare function apply2(expr1: Expression, expr2: Expression, fn: (x1: number, x2: number) => number | Complex, bigFn?: (x1:
|
|
4
|
+
export declare function apply(expr: Expression, fn: (x: number) => number | Complex, bigFn?: (x: BigDecimal) => BigDecimal | Complex | number, complexFn?: (x: Complex) => number | Complex): Expression | undefined;
|
|
5
|
+
export declare function apply2(expr1: Expression, expr2: Expression, fn: (x1: number, x2: number) => number | Complex, bigFn?: (x1: BigDecimal, x2: BigDecimal) => BigDecimal | Complex | number, complexFn?: (x1: Complex, x2: number | Complex) => Complex | number): Expression | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
import type { FormOption } from '../types-serialization';
|
|
3
3
|
import type { MathJsonSymbol } from '../../math-json/types';
|
|
4
4
|
import { NumericValue } from '../numeric-value/types';
|
|
@@ -91,7 +91,7 @@ export declare function boxFunction(ce: ComputeEngine, name: MathJsonSymbol, ops
|
|
|
91
91
|
* Note that `Negate` is only distributed over addition. In practice, having
|
|
92
92
|
* `Negate` factored on multiply/divide is more useful to detect patterns.
|
|
93
93
|
*
|
|
94
|
-
* Note that this function should only be called from `ce.
|
|
94
|
+
* Note that this function should only be called from `ce.expr()`
|
|
95
95
|
*
|
|
96
96
|
*/
|
|
97
97
|
export declare function box(ce: ComputeEngine, expr: null | undefined | NumericValue | ExpressionInput, options?: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.55.0 */
|
|
2
2
|
import type { SimplifyOptions, ReplaceOptions, PatternMatchOptions, Expression, BoxedBaseDefinition, BoxedOperatorDefinition, BoxedRuleSet, BoxedSubstitution, CanonicalOptions, EvaluateOptions, IComputeEngine as ComputeEngine, Metadata, Rule, Sign, Substitution, Scope, BoxedValueDefinition, ExpressionInput, FunctionInterface } from '../global-types';
|
|
3
3
|
import { Type } from '../../common/type/types';
|
|
4
4
|
import { BoxedType } from '../../common/type/boxed-type';
|