@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.
Files changed (137) hide show
  1. package/dist/compute-engine.cjs +11 -13
  2. package/dist/compute-engine.esm.js +13 -15
  3. package/dist/compute-engine.min.cjs +25 -25
  4. package/dist/compute-engine.min.esm.js +25 -25
  5. package/dist/math-json.cjs +1 -1
  6. package/dist/math-json.esm.js +2 -2
  7. package/dist/math-json.min.cjs +1 -1
  8. package/dist/math-json.min.esm.js +2 -2
  9. package/dist/types/common/ansi-codes.d.ts +1 -1
  10. package/dist/types/common/fuzzy-string-match.d.ts +1 -1
  11. package/dist/types/common/grapheme-splitter.d.ts +1 -1
  12. package/dist/types/common/interruptible.d.ts +1 -1
  13. package/dist/types/common/json5.d.ts +1 -1
  14. package/dist/types/common/one-of.d.ts +1 -1
  15. package/dist/types/common/signals.d.ts +1 -1
  16. package/dist/types/common/type/boxed-type.d.ts +1 -1
  17. package/dist/types/common/type/parse.d.ts +1 -1
  18. package/dist/types/common/type/primitive.d.ts +1 -1
  19. package/dist/types/common/type/serialize.d.ts +1 -1
  20. package/dist/types/common/type/subtype.d.ts +1 -1
  21. package/dist/types/common/type/types.d.ts +1 -1
  22. package/dist/types/common/type/utils.d.ts +1 -1
  23. package/dist/types/common/utils.d.ts +1 -1
  24. package/dist/types/compute-engine/assume.d.ts +1 -1
  25. package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +1 -1
  26. package/dist/types/compute-engine/boxed-expression/apply.d.ts +1 -1
  27. package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +1 -1
  28. package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +1 -1
  29. package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +1 -1
  30. package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +1 -1
  31. package/dist/types/compute-engine/boxed-expression/box.d.ts +1 -1
  32. package/dist/types/compute-engine/boxed-expression/boxed-function-definition.d.ts +1 -1
  33. package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +1 -1
  34. package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +1 -1
  35. package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +1 -1
  36. package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +1 -1
  37. package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +1 -1
  38. package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +1 -1
  39. package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +1 -1
  40. package/dist/types/compute-engine/boxed-expression/cache.d.ts +1 -1
  41. package/dist/types/compute-engine/boxed-expression/canonical.d.ts +1 -1
  42. package/dist/types/compute-engine/boxed-expression/compare.d.ts +1 -1
  43. package/dist/types/compute-engine/boxed-expression/expand.d.ts +1 -1
  44. package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
  45. package/dist/types/compute-engine/boxed-expression/factor.d.ts +1 -1
  46. package/dist/types/compute-engine/boxed-expression/flatten.d.ts +1 -1
  47. package/dist/types/compute-engine/boxed-expression/hold.d.ts +1 -1
  48. package/dist/types/compute-engine/boxed-expression/match.d.ts +1 -1
  49. package/dist/types/compute-engine/boxed-expression/negate.d.ts +1 -1
  50. package/dist/types/compute-engine/boxed-expression/numerics.d.ts +1 -1
  51. package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
  52. package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +1 -1
  53. package/dist/types/compute-engine/boxed-expression/product.d.ts +1 -1
  54. package/dist/types/compute-engine/boxed-expression/rules.d.ts +1 -1
  55. package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
  56. package/dist/types/compute-engine/boxed-expression/sgn.d.ts +1 -1
  57. package/dist/types/compute-engine/boxed-expression/simplify.d.ts +1 -1
  58. package/dist/types/compute-engine/boxed-expression/solve.d.ts +1 -1
  59. package/dist/types/compute-engine/boxed-expression/terms.d.ts +1 -1
  60. package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +1 -1
  61. package/dist/types/compute-engine/boxed-expression/utils.d.ts +1 -1
  62. package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
  63. package/dist/types/compute-engine/collection-utils.d.ts +1 -1
  64. package/dist/types/compute-engine/compile.d.ts +1 -1
  65. package/dist/types/compute-engine/cost-function.d.ts +1 -1
  66. package/dist/types/compute-engine/function-utils.d.ts +1 -1
  67. package/dist/types/compute-engine/global-types.d.ts +1 -1
  68. package/dist/types/compute-engine/index.d.ts +1 -1
  69. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
  70. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
  71. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
  72. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +1 -1
  73. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
  74. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +1 -1
  75. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
  76. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
  77. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +1 -1
  78. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
  79. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +1 -1
  80. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
  81. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
  82. package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +1 -1
  83. package/dist/types/compute-engine/latex-syntax/parse-identifier.d.ts +1 -1
  84. package/dist/types/compute-engine/latex-syntax/parse.d.ts +1 -1
  85. package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
  86. package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
  87. package/dist/types/compute-engine/latex-syntax/serializer.d.ts +1 -1
  88. package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
  89. package/dist/types/compute-engine/latex-syntax/types.d.ts +1 -1
  90. package/dist/types/compute-engine/library/arithmetic.d.ts +1 -1
  91. package/dist/types/compute-engine/library/calculus.d.ts +1 -1
  92. package/dist/types/compute-engine/library/collections.d.ts +1 -1
  93. package/dist/types/compute-engine/library/complex.d.ts +1 -1
  94. package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
  95. package/dist/types/compute-engine/library/core.d.ts +1 -1
  96. package/dist/types/compute-engine/library/invisible-operator.d.ts +1 -1
  97. package/dist/types/compute-engine/library/library.d.ts +1 -1
  98. package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
  99. package/dist/types/compute-engine/library/logic.d.ts +1 -1
  100. package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
  101. package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
  102. package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
  103. package/dist/types/compute-engine/library/sets.d.ts +1 -1
  104. package/dist/types/compute-engine/library/statistics.d.ts +1 -1
  105. package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
  106. package/dist/types/compute-engine/library/utils.d.ts +1 -1
  107. package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +1 -1
  108. package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +1 -1
  109. package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +1 -1
  110. package/dist/types/compute-engine/numeric-value/types.d.ts +1 -1
  111. package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
  112. package/dist/types/compute-engine/numerics/expression.d.ts +1 -1
  113. package/dist/types/compute-engine/numerics/interval.d.ts +1 -1
  114. package/dist/types/compute-engine/numerics/monte-carlo.d.ts +1 -1
  115. package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
  116. package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
  117. package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
  118. package/dist/types/compute-engine/numerics/numeric.d.ts +1 -1
  119. package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
  120. package/dist/types/compute-engine/numerics/rationals.d.ts +1 -1
  121. package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
  122. package/dist/types/compute-engine/numerics/special-functions.d.ts +1 -1
  123. package/dist/types/compute-engine/numerics/statistics.d.ts +1 -1
  124. package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
  125. package/dist/types/compute-engine/numerics/types.d.ts +1 -1
  126. package/dist/types/compute-engine/symbolic/derivative.d.ts +1 -1
  127. package/dist/types/compute-engine/symbolic/distribute.d.ts +1 -1
  128. package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +1 -1
  129. package/dist/types/compute-engine/tensor/tensor-fields.d.ts +1 -1
  130. package/dist/types/compute-engine/tensor/tensors.d.ts +1 -1
  131. package/dist/types/compute-engine/types.d.ts +2 -2
  132. package/dist/types/compute-engine.d.ts +1 -1
  133. package/dist/types/math-json/identifiers.d.ts +1 -1
  134. package/dist/types/math-json/types.d.ts +1 -1
  135. package/dist/types/math-json/utils.d.ts +1 -1
  136. package/dist/types/math-json.d.ts +2 -2
  137. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /** Compute Engine 0.29.0 */
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 chop2(this.decimal.toNumber());
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(chop2(this.decimal.toNumber())),
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 chop2(this.decimal.toNumber());
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: chop2(this.im * other.toNumber())
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 = chop2(Decimal.atan2(b, a).toNumber());
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) && chop2(this.im - other.im) === 0;
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
- if (Math.abs(n) <= DEFAULT_TOLERANCE) return 0;
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 && chop3(this.decimal - other) === 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 chop3(this.decimal - other.re) === 0 && chop3(this.im - other.im) === 0;
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
- if (Math.abs(n) <= DEFAULT_TOLERANCE) return 0;
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.0 */
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 chop2(this.decimal.toNumber());
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(chop2(this.decimal.toNumber())),
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 chop2(this.decimal.toNumber());
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: chop2(this.im * other.toNumber())
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 = chop2(Decimal.atan2(b, a).toNumber());
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) && chop2(this.im - other.im) === 0;
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
- if (Math.abs(n) <= DEFAULT_TOLERANCE) return 0;
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 && chop3(this.decimal - other) === 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 chop3(this.decimal - other.re) === 0 && chop3(this.im - other.im) === 0;
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
- if (Math.abs(n) <= DEFAULT_TOLERANCE) return 0;
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.0";
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.0"
35228
+ version: "0.29.1"
35231
35229
  };
35232
35230
  export {
35233
35231
  AbstractTensor,