@cortex-js/compute-engine 0.29.0 → 0.29.1
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/compute-engine.cjs +11 -13
- package/dist/compute-engine.esm.js +13 -15
- package/dist/compute-engine.min.cjs +25 -25
- package/dist/compute-engine.min.esm.js +25 -25
- package/dist/math-json.cjs +1 -1
- package/dist/math-json.esm.js +2 -2
- package/dist/math-json.min.cjs +1 -1
- package/dist/math-json.min.esm.js +2 -2
- package/dist/types/common/ansi-codes.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/json5.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/boxed-type.d.ts +1 -1
- package/dist/types/common/type/parse.d.ts +1 -1
- package/dist/types/common/type/primitive.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/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/compute-engine/assume.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/apply.d.ts +1 -1
- 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 +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-function-definition.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 +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-definition.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/cache.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/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/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 +1 -1
- package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/product.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.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/terms.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +1 -1
- 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 +1 -1
- package/dist/types/compute-engine/compile.d.ts +1 -1
- package/dist/types/compute-engine/cost-function.d.ts +1 -1
- 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 +1 -1
- 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.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-identifier.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse.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 +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/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/invisible-operator.d.ts +1 -1
- package/dist/types/compute-engine/library/library.d.ts +1 -1
- package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/library/logic.d.ts +1 -1
- package/dist/types/compute-engine/library/polynomials.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/utils.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/types.d.ts +1 -1
- package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
- 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/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 +1 -1
- 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 +1 -1
- package/dist/types/compute-engine/numerics/statistics.d.ts +1 -1
- package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
- package/dist/types/compute-engine/numerics/types.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/simplify-rules.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.d.ts +2 -2
- package/dist/types/compute-engine.d.ts +1 -1
- package/dist/types/math-json/identifiers.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/package.json +1 -1
package/dist/compute-engine.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Compute Engine 0.29.
|
|
1
|
+
/** Compute Engine 0.29.1 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ComputeEngine = {}));})(this, (function (exports) { 'use strict';
|
|
3
3
|
var ComputeEngine = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -16227,13 +16227,13 @@ Invalid type
|
|
|
16227
16227
|
if (this.isNegativeInfinity) return "NegativeInfinity";
|
|
16228
16228
|
if (this.isComplexInfinity) return "ComplexInfinity";
|
|
16229
16229
|
if (this.im === 0) {
|
|
16230
|
-
if (isInMachineRange(this.decimal)) return
|
|
16230
|
+
if (isInMachineRange(this.decimal)) return this.decimal.toNumber();
|
|
16231
16231
|
return { num: decimalToString(this.decimal) };
|
|
16232
16232
|
}
|
|
16233
16233
|
if (isInMachineRange(this.decimal))
|
|
16234
16234
|
return [
|
|
16235
16235
|
"Complex",
|
|
16236
|
-
numberToExpression(
|
|
16236
|
+
numberToExpression(this.decimal.toNumber()),
|
|
16237
16237
|
numberToExpression(this.im)
|
|
16238
16238
|
];
|
|
16239
16239
|
return [
|
|
@@ -16267,7 +16267,7 @@ Invalid type
|
|
|
16267
16267
|
return new ExactNumericValue(value, (x) => this.clone(x), this.bignum);
|
|
16268
16268
|
}
|
|
16269
16269
|
get re() {
|
|
16270
|
-
return
|
|
16270
|
+
return this.decimal.toNumber();
|
|
16271
16271
|
}
|
|
16272
16272
|
get bignumRe() {
|
|
16273
16273
|
return this.decimal;
|
|
@@ -16362,7 +16362,7 @@ Invalid type
|
|
|
16362
16362
|
if (this.im === 0) return this.clone(this.decimal.mul(other));
|
|
16363
16363
|
return this.clone({
|
|
16364
16364
|
re: this.decimal.mul(other),
|
|
16365
|
-
im:
|
|
16365
|
+
im: this.im * other.toNumber()
|
|
16366
16366
|
});
|
|
16367
16367
|
}
|
|
16368
16368
|
if (this.isNegativeOne) {
|
|
@@ -16539,7 +16539,7 @@ Invalid type
|
|
|
16539
16539
|
const a = this.decimal;
|
|
16540
16540
|
const b = this.im;
|
|
16541
16541
|
const modulus = a.mul(a).add(b * b).sqrt();
|
|
16542
|
-
const argument =
|
|
16542
|
+
const argument = Decimal.atan2(b, a).toNumber();
|
|
16543
16543
|
if (base === void 0)
|
|
16544
16544
|
return this.clone({ re: modulus.ln(), im: argument });
|
|
16545
16545
|
return this.clone({ re: modulus.log(base), im: argument });
|
|
@@ -16579,7 +16579,7 @@ Invalid type
|
|
|
16579
16579
|
return this.im === 0 && this.decimal.eq(other);
|
|
16580
16580
|
if (other.isNaN) return false;
|
|
16581
16581
|
if (!Number.isFinite(this.im)) return !Number.isFinite(other.im);
|
|
16582
|
-
return this.decimal.eq(other.bignumRe ?? other.re) &&
|
|
16582
|
+
return this.decimal.eq(other.bignumRe ?? other.re) && this.im - other.im === 0;
|
|
16583
16583
|
}
|
|
16584
16584
|
lt(other) {
|
|
16585
16585
|
if (this.im !== 0) ;
|
|
@@ -16615,8 +16615,7 @@ Invalid type
|
|
|
16615
16615
|
return numStr;
|
|
16616
16616
|
}
|
|
16617
16617
|
function chop2(n) {
|
|
16618
|
-
|
|
16619
|
-
return n;
|
|
16618
|
+
return Math.abs(n) <= 1e-14 ? 0 : n;
|
|
16620
16619
|
}
|
|
16621
16620
|
|
|
16622
16621
|
// src/compute-engine/numeric-value/machine-numeric-value.ts
|
|
@@ -16995,10 +16994,10 @@ Invalid type
|
|
|
16995
16994
|
eq(other) {
|
|
16996
16995
|
if (this.isNaN) return false;
|
|
16997
16996
|
if (typeof other === "number")
|
|
16998
|
-
return this.im === 0 &&
|
|
16997
|
+
return this.im === 0 && this.decimal - other === 0;
|
|
16999
16998
|
if (other.isNaN) return false;
|
|
17000
16999
|
if (!Number.isFinite(this.im)) return !Number.isFinite(other.im);
|
|
17001
|
-
return
|
|
17000
|
+
return this.decimal - other.re === 0 && this.im - other.im === 0;
|
|
17002
17001
|
}
|
|
17003
17002
|
lt(other) {
|
|
17004
17003
|
if (this.im !== 0) ;
|
|
@@ -17022,8 +17021,7 @@ Invalid type
|
|
|
17022
17021
|
}
|
|
17023
17022
|
};
|
|
17024
17023
|
function chop3(n) {
|
|
17025
|
-
|
|
17026
|
-
return n;
|
|
17024
|
+
return Math.abs(n) <= 1e-14 ? 0 : n;
|
|
17027
17025
|
}
|
|
17028
17026
|
|
|
17029
17027
|
// src/compute-engine/boxed-expression/terms.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Compute Engine 0.29.
|
|
1
|
+
/** Compute Engine 0.29.1 */
|
|
2
2
|
|
|
3
3
|
// node_modules/complex-esm/dist/src/complex.js
|
|
4
4
|
var cosh = Math.cosh || function(x) {
|
|
@@ -16180,13 +16180,13 @@ var BigNumericValue = class _BigNumericValue extends NumericValue {
|
|
|
16180
16180
|
if (this.isNegativeInfinity) return "NegativeInfinity";
|
|
16181
16181
|
if (this.isComplexInfinity) return "ComplexInfinity";
|
|
16182
16182
|
if (this.im === 0) {
|
|
16183
|
-
if (isInMachineRange(this.decimal)) return
|
|
16183
|
+
if (isInMachineRange(this.decimal)) return this.decimal.toNumber();
|
|
16184
16184
|
return { num: decimalToString(this.decimal) };
|
|
16185
16185
|
}
|
|
16186
16186
|
if (isInMachineRange(this.decimal))
|
|
16187
16187
|
return [
|
|
16188
16188
|
"Complex",
|
|
16189
|
-
numberToExpression(
|
|
16189
|
+
numberToExpression(this.decimal.toNumber()),
|
|
16190
16190
|
numberToExpression(this.im)
|
|
16191
16191
|
];
|
|
16192
16192
|
return [
|
|
@@ -16220,7 +16220,7 @@ var BigNumericValue = class _BigNumericValue extends NumericValue {
|
|
|
16220
16220
|
return new ExactNumericValue(value, (x) => this.clone(x), this.bignum);
|
|
16221
16221
|
}
|
|
16222
16222
|
get re() {
|
|
16223
|
-
return
|
|
16223
|
+
return this.decimal.toNumber();
|
|
16224
16224
|
}
|
|
16225
16225
|
get bignumRe() {
|
|
16226
16226
|
return this.decimal;
|
|
@@ -16315,7 +16315,7 @@ var BigNumericValue = class _BigNumericValue extends NumericValue {
|
|
|
16315
16315
|
if (this.im === 0) return this.clone(this.decimal.mul(other));
|
|
16316
16316
|
return this.clone({
|
|
16317
16317
|
re: this.decimal.mul(other),
|
|
16318
|
-
im:
|
|
16318
|
+
im: this.im * other.toNumber()
|
|
16319
16319
|
});
|
|
16320
16320
|
}
|
|
16321
16321
|
if (this.isNegativeOne) {
|
|
@@ -16492,7 +16492,7 @@ var BigNumericValue = class _BigNumericValue extends NumericValue {
|
|
|
16492
16492
|
const a = this.decimal;
|
|
16493
16493
|
const b = this.im;
|
|
16494
16494
|
const modulus = a.mul(a).add(b * b).sqrt();
|
|
16495
|
-
const argument =
|
|
16495
|
+
const argument = Decimal.atan2(b, a).toNumber();
|
|
16496
16496
|
if (base === void 0)
|
|
16497
16497
|
return this.clone({ re: modulus.ln(), im: argument });
|
|
16498
16498
|
return this.clone({ re: modulus.log(base), im: argument });
|
|
@@ -16532,7 +16532,7 @@ var BigNumericValue = class _BigNumericValue extends NumericValue {
|
|
|
16532
16532
|
return this.im === 0 && this.decimal.eq(other);
|
|
16533
16533
|
if (other.isNaN) return false;
|
|
16534
16534
|
if (!Number.isFinite(this.im)) return !Number.isFinite(other.im);
|
|
16535
|
-
return this.decimal.eq(other.bignumRe ?? other.re) &&
|
|
16535
|
+
return this.decimal.eq(other.bignumRe ?? other.re) && this.im - other.im === 0;
|
|
16536
16536
|
}
|
|
16537
16537
|
lt(other) {
|
|
16538
16538
|
if (this.im !== 0) ;
|
|
@@ -16568,8 +16568,7 @@ function decimalToString(num) {
|
|
|
16568
16568
|
return numStr;
|
|
16569
16569
|
}
|
|
16570
16570
|
function chop2(n) {
|
|
16571
|
-
|
|
16572
|
-
return n;
|
|
16571
|
+
return Math.abs(n) <= 1e-14 ? 0 : n;
|
|
16573
16572
|
}
|
|
16574
16573
|
|
|
16575
16574
|
// src/compute-engine/numeric-value/machine-numeric-value.ts
|
|
@@ -16948,10 +16947,10 @@ var MachineNumericValue = class _MachineNumericValue extends NumericValue {
|
|
|
16948
16947
|
eq(other) {
|
|
16949
16948
|
if (this.isNaN) return false;
|
|
16950
16949
|
if (typeof other === "number")
|
|
16951
|
-
return this.im === 0 &&
|
|
16950
|
+
return this.im === 0 && this.decimal - other === 0;
|
|
16952
16951
|
if (other.isNaN) return false;
|
|
16953
16952
|
if (!Number.isFinite(this.im)) return !Number.isFinite(other.im);
|
|
16954
|
-
return
|
|
16953
|
+
return this.decimal - other.re === 0 && this.im - other.im === 0;
|
|
16955
16954
|
}
|
|
16956
16955
|
lt(other) {
|
|
16957
16956
|
if (this.im !== 0) ;
|
|
@@ -16975,8 +16974,7 @@ var MachineNumericValue = class _MachineNumericValue extends NumericValue {
|
|
|
16975
16974
|
}
|
|
16976
16975
|
};
|
|
16977
16976
|
function chop3(n) {
|
|
16978
|
-
|
|
16979
|
-
return n;
|
|
16977
|
+
return Math.abs(n) <= 1e-14 ? 0 : n;
|
|
16980
16978
|
}
|
|
16981
16979
|
|
|
16982
16980
|
// src/compute-engine/boxed-expression/terms.ts
|
|
@@ -35224,10 +35222,10 @@ function isFunctionValue(value) {
|
|
|
35224
35222
|
}
|
|
35225
35223
|
|
|
35226
35224
|
// src/compute-engine.ts
|
|
35227
|
-
var version = "0.29.
|
|
35225
|
+
var version = "0.29.1";
|
|
35228
35226
|
globalThis[Symbol.for("io.cortexjs.compute-engine")] = {
|
|
35229
35227
|
ComputeEngine: ComputeEngine.prototype.constructor,
|
|
35230
|
-
version: "0.29.
|
|
35228
|
+
version: "0.29.1"
|
|
35231
35229
|
};
|
|
35232
35230
|
export {
|
|
35233
35231
|
AbstractTensor,
|