@cortex-js/compute-engine 0.35.6 → 0.50.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 (223) hide show
  1. package/README.md +121 -5
  2. package/dist/compute-engine.esm.js +55594 -51135
  3. package/dist/compute-engine.min.esm.js +1081 -78
  4. package/dist/compute-engine.min.umd.js +1081 -78
  5. package/dist/compute-engine.umd.js +53638 -49162
  6. package/dist/math-json.esm.js +2 -2
  7. package/dist/math-json.min.esm.js +2 -2
  8. package/dist/math-json.min.umd.js +2 -2
  9. package/dist/math-json.umd.js +2 -2
  10. package/dist/types/common/ansi-codes.d.ts +1 -1
  11. package/dist/types/common/configuration-change.d.ts +1 -1
  12. package/dist/types/common/fuzzy-string-match.d.ts +1 -1
  13. package/dist/types/common/grapheme-splitter.d.ts +1 -1
  14. package/dist/types/common/interruptible.d.ts +1 -1
  15. package/dist/types/common/one-of.d.ts +1 -1
  16. package/dist/types/common/signals.d.ts +1 -1
  17. package/dist/types/common/type/ast-nodes.d.ts +1 -1
  18. package/dist/types/common/type/boxed-type.d.ts +1 -1
  19. package/dist/types/common/type/lexer.d.ts +1 -1
  20. package/dist/types/common/type/parse.d.ts +1 -1
  21. package/dist/types/common/type/parser.d.ts +8 -1
  22. package/dist/types/common/type/primitive.d.ts +2 -1
  23. package/dist/types/common/type/reduce.d.ts +1 -1
  24. package/dist/types/common/type/serialize.d.ts +1 -1
  25. package/dist/types/common/type/subtype.d.ts +1 -1
  26. package/dist/types/common/type/type-builder.d.ts +1 -1
  27. package/dist/types/common/type/types.d.ts +1 -1
  28. package/dist/types/common/type/utils.d.ts +3 -2
  29. package/dist/types/common/utils.d.ts +1 -1
  30. package/dist/types/compute-engine/assume.d.ts +4 -22
  31. package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +66 -76
  32. package/dist/types/compute-engine/boxed-expression/apply.d.ts +4 -4
  33. package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +15 -6
  34. package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +72 -6
  35. package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +8 -8
  36. package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +5 -8
  37. package/dist/types/compute-engine/boxed-expression/box.d.ts +63 -8
  38. package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +13 -12
  39. package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +44 -43
  40. package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +31 -30
  41. package/dist/types/compute-engine/boxed-expression/boxed-operator-definition.d.ts +18 -18
  42. package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +5 -37
  43. package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +5 -4
  44. package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +34 -33
  45. package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +34 -33
  46. package/dist/types/compute-engine/boxed-expression/boxed-value-definition.d.ts +8 -8
  47. package/dist/types/compute-engine/boxed-expression/cache.d.ts +1 -1
  48. package/dist/types/compute-engine/boxed-expression/canonical-utils.d.ts +2 -2
  49. package/dist/types/compute-engine/boxed-expression/canonical.d.ts +2 -2
  50. package/dist/types/compute-engine/boxed-expression/compare.d.ts +7 -4
  51. package/dist/types/compute-engine/boxed-expression/constants.d.ts +6 -0
  52. package/dist/types/compute-engine/boxed-expression/expand.d.ts +4 -5
  53. package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +9 -9
  54. package/dist/types/compute-engine/boxed-expression/factor.d.ts +7 -7
  55. package/dist/types/compute-engine/boxed-expression/flatten.d.ts +4 -13
  56. package/dist/types/compute-engine/boxed-expression/hold.d.ts +3 -3
  57. package/dist/types/compute-engine/boxed-expression/inequality-bounds.d.ts +21 -0
  58. package/dist/types/compute-engine/boxed-expression/init-lazy-refs.d.ts +1 -0
  59. package/dist/types/compute-engine/boxed-expression/invisible-operator.d.ts +4 -0
  60. package/dist/types/compute-engine/boxed-expression/match.d.ts +2 -2
  61. package/dist/types/compute-engine/boxed-expression/negate.d.ts +4 -4
  62. package/dist/types/compute-engine/boxed-expression/numerics.d.ts +8 -8
  63. package/dist/types/compute-engine/boxed-expression/order.d.ts +14 -14
  64. package/dist/types/compute-engine/boxed-expression/pattern-utils.d.ts +41 -0
  65. package/dist/types/compute-engine/boxed-expression/polynomial-degree.d.ts +18 -0
  66. package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +12 -35
  67. package/dist/types/compute-engine/boxed-expression/predicates.d.ts +2 -0
  68. package/dist/types/compute-engine/boxed-expression/product.d.ts +1 -66
  69. package/dist/types/compute-engine/boxed-expression/rules.d.ts +51 -51
  70. package/dist/types/compute-engine/boxed-expression/serialize.d.ts +6 -3
  71. package/dist/types/compute-engine/boxed-expression/sgn.d.ts +2 -2
  72. package/dist/types/compute-engine/boxed-expression/simplify.d.ts +2 -2
  73. package/dist/types/compute-engine/boxed-expression/solve-linear-system.d.ts +8 -8
  74. package/dist/types/compute-engine/boxed-expression/solve.d.ts +3 -11
  75. package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +7 -7
  76. package/dist/types/compute-engine/boxed-expression/type-guards.d.ts +31 -0
  77. package/dist/types/compute-engine/boxed-expression/utils.d.ts +13 -13
  78. package/dist/types/compute-engine/boxed-expression/validate.d.ts +10 -10
  79. package/dist/types/compute-engine/collection-utils.d.ts +4 -4
  80. package/dist/types/compute-engine/compilation/base-compiler.d.ts +3 -3
  81. package/dist/types/compute-engine/compilation/compile-expression.d.ts +25 -0
  82. package/dist/types/compute-engine/compilation/glsl-target.d.ts +12 -41
  83. package/dist/types/compute-engine/compilation/gpu-target.d.ts +50 -0
  84. package/dist/types/compute-engine/compilation/interval-glsl-target.d.ts +11 -11
  85. package/dist/types/compute-engine/compilation/interval-javascript-target.d.ts +7 -7
  86. package/dist/types/compute-engine/compilation/interval-wgsl-target.d.ts +54 -0
  87. package/dist/types/compute-engine/compilation/javascript-target.d.ts +6 -6
  88. package/dist/types/compute-engine/compilation/python-target.d.ts +61 -0
  89. package/dist/types/compute-engine/compilation/types.d.ts +38 -22
  90. package/dist/types/compute-engine/compilation/wgsl-target.d.ts +41 -0
  91. package/dist/types/compute-engine/cost-function.d.ts +3 -3
  92. package/dist/types/compute-engine/engine-assumptions.d.ts +6 -0
  93. package/dist/types/compute-engine/engine-cache.d.ts +6 -0
  94. package/dist/types/compute-engine/engine-common-symbols.d.ts +6 -0
  95. package/dist/types/compute-engine/engine-compilation-targets.d.ts +17 -0
  96. package/dist/types/compute-engine/engine-configuration-lifecycle.d.ts +15 -0
  97. package/dist/types/compute-engine/engine-declarations.d.ts +19 -0
  98. package/dist/types/compute-engine/engine-expression-entrypoints.d.ts +44 -0
  99. package/dist/types/compute-engine/engine-extension-contracts.d.ts +9 -0
  100. package/dist/types/compute-engine/engine-latex-dictionary-state.d.ts +13 -0
  101. package/dist/types/compute-engine/engine-library-bootstrap.d.ts +6 -0
  102. package/dist/types/compute-engine/engine-numeric-configuration.d.ts +34 -0
  103. package/dist/types/compute-engine/engine-parse-entrypoint.d.ts +7 -0
  104. package/dist/types/compute-engine/engine-runtime-state.d.ts +19 -0
  105. package/dist/types/compute-engine/engine-scope.d.ts +13 -0
  106. package/dist/types/compute-engine/engine-sequences.d.ts +14 -0
  107. package/dist/types/compute-engine/engine-simplification-rules.d.ts +15 -0
  108. package/dist/types/compute-engine/engine-startup-coordinator.d.ts +28 -0
  109. package/dist/types/compute-engine/engine-type-resolver.d.ts +12 -0
  110. package/dist/types/compute-engine/engine-validation-entrypoints.d.ts +13 -0
  111. package/dist/types/compute-engine/free-functions.d.ts +20 -0
  112. package/dist/types/compute-engine/function-utils.d.ts +10 -10
  113. package/dist/types/compute-engine/global-types.d.ts +5 -3301
  114. package/dist/types/compute-engine/index.d.ts +156 -112
  115. package/dist/types/compute-engine/interval/arithmetic.d.ts +1 -1
  116. package/dist/types/compute-engine/interval/comparison.d.ts +1 -1
  117. package/dist/types/compute-engine/interval/elementary.d.ts +1 -1
  118. package/dist/types/compute-engine/interval/index.d.ts +1 -1
  119. package/dist/types/compute-engine/interval/trigonometric.d.ts +1 -1
  120. package/dist/types/compute-engine/interval/types.d.ts +1 -1
  121. package/dist/types/compute-engine/interval/util.d.ts +1 -1
  122. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
  123. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
  124. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
  125. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +1 -1
  126. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
  127. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +1 -1
  128. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
  129. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
  130. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +1 -1
  131. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
  132. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +1 -1
  133. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
  134. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
  135. package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +4 -80
  136. package/dist/types/compute-engine/latex-syntax/dictionary/indexed-types.d.ts +83 -0
  137. package/dist/types/compute-engine/latex-syntax/parse-number.d.ts +28 -0
  138. package/dist/types/compute-engine/latex-syntax/parse-symbol.d.ts +2 -2
  139. package/dist/types/compute-engine/latex-syntax/parse.d.ts +23 -33
  140. package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +2 -2
  141. package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +8 -8
  142. package/dist/types/compute-engine/latex-syntax/serializer.d.ts +15 -15
  143. package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
  144. package/dist/types/compute-engine/latex-syntax/types.d.ts +73 -53
  145. package/dist/types/compute-engine/latex-syntax/utils.d.ts +1 -1
  146. package/dist/types/compute-engine/library/arithmetic.d.ts +1 -2
  147. package/dist/types/compute-engine/library/calculus.d.ts +1 -1
  148. package/dist/types/compute-engine/library/collections.d.ts +4 -4
  149. package/dist/types/compute-engine/library/combinatorics.d.ts +1 -1
  150. package/dist/types/compute-engine/library/complex.d.ts +1 -1
  151. package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
  152. package/dist/types/compute-engine/library/core.d.ts +1 -1
  153. package/dist/types/compute-engine/library/library.d.ts +19 -6
  154. package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
  155. package/dist/types/compute-engine/library/logic-analysis.d.ts +19 -32
  156. package/dist/types/compute-engine/library/logic.d.ts +1 -5
  157. package/dist/types/compute-engine/library/number-theory.d.ts +1 -1
  158. package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
  159. package/dist/types/compute-engine/library/random-expression.d.ts +2 -2
  160. package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
  161. package/dist/types/compute-engine/library/sets.d.ts +1 -1
  162. package/dist/types/compute-engine/library/statistics.d.ts +1 -1
  163. package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
  164. package/dist/types/compute-engine/library/type-handlers.d.ts +4 -0
  165. package/dist/types/compute-engine/library/utils.d.ts +12 -12
  166. package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +5 -5
  167. package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +5 -5
  168. package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +5 -5
  169. package/dist/types/compute-engine/numeric-value/types.d.ts +2 -3
  170. package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
  171. package/dist/types/compute-engine/numerics/expression.d.ts +3 -3
  172. package/dist/types/compute-engine/numerics/interval.d.ts +2 -2
  173. package/dist/types/compute-engine/numerics/monte-carlo.d.ts +1 -1
  174. package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
  175. package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
  176. package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
  177. package/dist/types/compute-engine/numerics/numeric.d.ts +1 -1
  178. package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
  179. package/dist/types/compute-engine/numerics/rationals.d.ts +4 -4
  180. package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
  181. package/dist/types/compute-engine/numerics/special-functions.d.ts +120 -1
  182. package/dist/types/compute-engine/numerics/statistics.d.ts +1 -2
  183. package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
  184. package/dist/types/compute-engine/numerics/types.d.ts +3 -1
  185. package/dist/types/compute-engine/oeis.d.ts +3 -3
  186. package/dist/types/compute-engine/sequence.d.ts +13 -13
  187. package/dist/types/compute-engine/symbolic/antiderivative.d.ts +2 -2
  188. package/dist/types/compute-engine/symbolic/derivative.d.ts +3 -3
  189. package/dist/types/compute-engine/symbolic/distribute.d.ts +2 -2
  190. package/dist/types/compute-engine/symbolic/fu-cost.d.ts +6 -6
  191. package/dist/types/compute-engine/symbolic/fu-transforms.d.ts +46 -46
  192. package/dist/types/compute-engine/symbolic/fu.d.ts +4 -4
  193. package/dist/types/compute-engine/symbolic/logic-utils.d.ts +54 -0
  194. package/dist/types/compute-engine/symbolic/simplify-abs.d.ts +4 -4
  195. package/dist/types/compute-engine/symbolic/simplify-divide.d.ts +2 -2
  196. package/dist/types/compute-engine/symbolic/simplify-hyperbolic.d.ts +2 -2
  197. package/dist/types/compute-engine/symbolic/simplify-infinity.d.ts +2 -2
  198. package/dist/types/compute-engine/symbolic/simplify-log.d.ts +2 -2
  199. package/dist/types/compute-engine/symbolic/simplify-logic.d.ts +5 -0
  200. package/dist/types/compute-engine/symbolic/simplify-power.d.ts +2 -2
  201. package/dist/types/compute-engine/symbolic/simplify-product.d.ts +2 -2
  202. package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +65 -4
  203. package/dist/types/compute-engine/symbolic/simplify-sum.d.ts +2 -2
  204. package/dist/types/compute-engine/symbolic/simplify-trig.d.ts +2 -2
  205. package/dist/types/compute-engine/tensor/tensor-fields.d.ts +42 -42
  206. package/dist/types/compute-engine/tensor/tensors.d.ts +4 -4
  207. package/dist/types/compute-engine/types-definitions.d.ts +900 -0
  208. package/dist/types/compute-engine/types-engine.d.ts +375 -0
  209. package/dist/types/compute-engine/types-evaluation.d.ts +67 -0
  210. package/dist/types/compute-engine/types-expression.d.ts +1655 -0
  211. package/dist/types/compute-engine/types-kernel-evaluation.d.ts +164 -0
  212. package/dist/types/compute-engine/types-kernel-serialization.d.ts +147 -0
  213. package/dist/types/compute-engine/types-serialization.d.ts +23 -0
  214. package/dist/types/compute-engine/types.d.ts +2 -2
  215. package/dist/types/compute-engine.d.ts +16 -3
  216. package/dist/types/math-json/symbols.d.ts +1 -1
  217. package/dist/types/math-json/types.d.ts +3 -3
  218. package/dist/types/math-json/utils.d.ts +31 -31
  219. package/dist/types/math-json.d.ts +2 -2
  220. package/package.json +8 -1
  221. package/dist/types/compute-engine/boxed-expression/terms.d.ts +0 -10
  222. package/dist/types/compute-engine/library/invisible-operator.d.ts +0 -4
  223. package/dist/types/compute-engine/library/logic-utils.d.ts +0 -54
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  /**
3
3
  * EL-4: Convert known infinite integer sets to their equivalent Limits bounds.
4
4
  * Returns undefined if the set cannot be converted to a Limits form.
@@ -37,8 +37,8 @@ export type IndexingSet = {
37
37
  * @param indexingSet
38
38
  * @returns
39
39
  */
40
- export declare function normalizeIndexingSet(indexingSet: BoxedExpression): IndexingSet;
41
- export declare function normalizeIndexingSets(ops: ReadonlyArray<BoxedExpression>): IndexingSet[];
40
+ export declare function normalizeIndexingSet(indexingSet: Expression): IndexingSet;
41
+ export declare function normalizeIndexingSets(ops: ReadonlyArray<Expression>): IndexingSet[];
42
42
  export declare function indexingSetCartesianProduct(indexingSets: IndexingSet[]): number[][];
43
43
  /**
44
44
  * Calculates the cartesian product of two arrays.
@@ -62,12 +62,12 @@ export declare function cartesianProduct(array1: number[], array2: number[]): nu
62
62
  * - [Tuple, "x", 1, 10] -> ["Limits", "x", 1, 10]
63
63
  *
64
64
  */
65
- export declare function canonicalLimitsSequence(ops: ReadonlyArray<BoxedExpression>, options: {
65
+ export declare function canonicalLimitsSequence(ops: ReadonlyArray<Expression>, options: {
66
66
  engine: ComputeEngine;
67
- }): BoxedExpression[];
68
- export declare function canonicalLimits(ops: ReadonlyArray<BoxedExpression>, { engine: ce }: {
67
+ }): Expression[];
68
+ export declare function canonicalLimits(ops: ReadonlyArray<Expression>, { engine: ce }: {
69
69
  engine: ComputeEngine;
70
- }): BoxedExpression | null;
70
+ }): Expression | null;
71
71
  /** Return a limit/indexing set in canonical form as a `Limits` expression
72
72
  * with:
73
73
  * - `index` (a symbol), `Nothing` if none is present
@@ -79,8 +79,8 @@ export declare function canonicalLimits(ops: ReadonlyArray<BoxedExpression>, { e
79
79
  * Assume we are in the context of a big operator
80
80
  * (i.e. `pushScope()` has been called)
81
81
  */
82
- export declare function canonicalIndexingSet(expr: BoxedExpression): BoxedExpression | undefined;
83
- export declare function canonicalBigop(bigOp: string, body: BoxedExpression, indexingSets: BoxedExpression[], scope: Scope | undefined): BoxedExpression | null;
82
+ export declare function canonicalIndexingSet(expr: Expression): Expression | undefined;
83
+ export declare function canonicalBigop(bigOp: string, body: Expression, indexingSets: Expression[], scope: Scope | undefined): Expression | null;
84
84
  /**
85
85
  * A special symbol used to signal that a BigOp could not be evaluated
86
86
  * because the domain is non-enumerable (e.g., infinite set, unknown symbol).
@@ -97,7 +97,7 @@ export type BigOpResult<T> = {
97
97
  } | {
98
98
  status: 'non-enumerable';
99
99
  reason: string;
100
- domain?: BoxedExpression;
100
+ domain?: Expression;
101
101
  } | {
102
102
  status: 'error';
103
103
  reason: string;
@@ -117,7 +117,7 @@ export type BigOpResult<T> = {
117
117
  * Returns either the reduced value, or `typeof NON_ENUMERABLE_DOMAIN` if the
118
118
  * domain cannot be enumerated (in which case the expression should remain symbolic).
119
119
  */
120
- export declare function reduceBigOp<T>(body: BoxedExpression, indexes: ReadonlyArray<BoxedExpression>, fn: (acc: T, x: BoxedExpression) => T | null, initial: T): Generator<T | typeof NON_ENUMERABLE_DOMAIN | undefined>;
120
+ export declare function reduceBigOp<T>(body: Expression, indexes: ReadonlyArray<Expression>, fn: (acc: T, x: Expression) => T | null, initial: T): Generator<T | typeof NON_ENUMERABLE_DOMAIN | undefined>;
121
121
  /**
122
122
  * Result type for reduceElementIndexingSets to distinguish between
123
123
  * successful evaluation, non-enumerable domains (keep symbolic), and errors.
@@ -128,7 +128,7 @@ export type ReduceElementResult<T> = {
128
128
  } | {
129
129
  status: 'non-enumerable';
130
130
  reason: string;
131
- domain?: BoxedExpression;
131
+ domain?: Expression;
132
132
  } | {
133
133
  status: 'error';
134
134
  reason: string;
@@ -1,8 +1,8 @@
1
- /* 0.35.6 */
2
- import { BigNumFactory, NumericValue, NumericValueData } from './types';
1
+ /* 0.50.1 */
2
+ import type { BigNumFactory, SmallInteger } from '../numerics/types';
3
+ import { NumericValue, NumericValueData } from './types';
3
4
  import { ExactNumericValue } from './exact-numeric-value';
4
- import { Expression } from '../../math-json/types';
5
- import { SmallInteger } from '../numerics/types';
5
+ import { MathJsonExpression } from '../../math-json/types';
6
6
  import { NumericPrimitiveType } from '../../common/type/types';
7
7
  export declare class BigNumericValue extends NumericValue {
8
8
  __brand: 'BigNumericValue';
@@ -12,7 +12,7 @@ export declare class BigNumericValue extends NumericValue {
12
12
  get type(): NumericPrimitiveType;
13
13
  get isExact(): boolean;
14
14
  get asExact(): ExactNumericValue | undefined;
15
- toJSON(): Expression;
15
+ toJSON(): MathJsonExpression;
16
16
  toString(): string;
17
17
  clone(value: number | Decimal | NumericValueData): BigNumericValue;
18
18
  private _makeExact;
@@ -1,7 +1,7 @@
1
- /* 0.35.6 */
2
- import { Rational, SmallInteger } from '../numerics/types';
3
- import { BigNumFactory, ExactNumericValueData, NumericValue, NumericValueFactory } from './types';
4
- import { Expression } from '../../math-json/types';
1
+ /* 0.50.1 */
2
+ import { type BigNumFactory, Rational, SmallInteger } from '../numerics/types';
3
+ import { ExactNumericValueData, NumericValue, NumericValueFactory } from './types';
4
+ import { MathJsonExpression } from '../../math-json/types';
5
5
  import { NumericPrimitiveType } from '../../common/type/types';
6
6
  /**
7
7
  * An ExactNumericValue is the sum of a Gaussian imaginary and the product of
@@ -28,7 +28,7 @@ export declare class ExactNumericValue extends NumericValue {
28
28
  get type(): NumericPrimitiveType;
29
29
  get isExact(): boolean;
30
30
  get asExact(): NumericValue | undefined;
31
- toJSON(): Expression;
31
+ toJSON(): MathJsonExpression;
32
32
  clone(value: number | ExactNumericValueData): ExactNumericValue;
33
33
  /** Object.toString() */
34
34
  toString(): string;
@@ -1,7 +1,7 @@
1
- /* 0.35.6 */
2
- import { BigNumFactory, NumericValue, NumericValueData } from './types';
3
- import type { Expression } from '../../math-json/types';
4
- import type { SmallInteger } from '../numerics/types';
1
+ /* 0.50.1 */
2
+ import type { BigNumFactory, SmallInteger } from '../numerics/types';
3
+ import { NumericValue, NumericValueData } from './types';
4
+ import type { MathJsonExpression } from '../../math-json/types';
5
5
  import { NumericPrimitiveType } from '../../common/type/types';
6
6
  export declare class MachineNumericValue extends NumericValue {
7
7
  __brand: 'MachineNumericValue';
@@ -12,7 +12,7 @@ export declare class MachineNumericValue extends NumericValue {
12
12
  get type(): NumericPrimitiveType;
13
13
  get isExact(): boolean;
14
14
  get asExact(): NumericValue | undefined;
15
- toJSON(): Expression;
15
+ toJSON(): MathJsonExpression;
16
16
  toString(): string;
17
17
  clone(value: number | Decimal | NumericValueData): MachineNumericValue;
18
18
  get re(): number;
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  *
3
3
  * ## THEORY OF OPERATIONS
4
4
  *
@@ -26,7 +26,6 @@
26
26
  import { Decimal } from 'decimal.js';
27
27
  import type { Rational, SmallInteger } from '../numerics/types';
28
28
  import { NumericPrimitiveType } from '../../common/type/types';
29
- export type BigNumFactory = (value: Decimal.Value) => Decimal;
30
29
  /** The value is equal to `(decimal * rational * sqrt(radical)) + im * i`
31
30
  * @category Numerics */
32
31
  export type ExactNumericValueData = {
@@ -111,6 +110,6 @@ export declare abstract class NumericValue {
111
110
  /** Object.toPrimitive() */
112
111
  [Symbol.toPrimitive](hint: 'number' | 'string' | 'default'): number | string | null;
113
112
  /** Object.toJSON */
114
- toJSON(): any;
113
+ toJSON(): unknown;
115
114
  print(): void;
116
115
  }
@@ -1,2 +1,2 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  export declare function bigint(a: Decimal | number | bigint | string): bigint | null;
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
2
- export declare function bigintValue(expr: Expression | null | undefined): bigint | null;
1
+ /* 0.50.1 */
2
+ export declare function bigintValue(expr: MathJsonExpression | null | undefined): bigint | null;
3
3
  /** Output a shorthand if possible */
4
- export declare function numberToExpression(num: number | bigint, fractionalDigits?: string | number): Expression;
4
+ export declare function numberToExpression(num: number | bigint, fractionalDigits?: string | number): MathJsonExpression;
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  /** An interval is a continuous set of real numbers */
3
3
  export type Interval = {
4
4
  start: number;
@@ -6,7 +6,7 @@ export type Interval = {
6
6
  end: number;
7
7
  openEnd: boolean;
8
8
  };
9
- export declare function interval(expr: BoxedExpression): Interval | undefined;
9
+ export declare function interval(expr: Expression): Interval | undefined;
10
10
  export declare function intervalContains(int: Interval, val: number): boolean;
11
11
  /** Return true if int1 is a subset of int2 */
12
12
  export declare function intervalSubset(int1: Interval, int2: Interval): boolean;
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  estimate: number;
3
3
  error: number;
4
4
  };
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  export declare function lcm(a: bigint, b: bigint): bigint;
3
3
  /** Return `[factor, root]` such that
4
4
  * pow(n, 1/exponent) = factor * pow(root, 1/exponent)
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  export declare function gcd(a: BigNum, b: BigNum): BigNum;
3
3
  export declare function lcm(a: BigNum, b: BigNum): BigNum;
4
4
  export declare function factorial2(ce: IBigNum, n: BigNum): BigNum;
@@ -1,3 +1,3 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  export declare function gamma(c: Complex): Complex;
3
3
  export declare function gammaln(c: Complex): Complex;
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  export declare const MACHINE_PRECISION_BITS = 53;
3
3
  export declare const MACHINE_PRECISION: number;
4
4
  export declare const DEFAULT_TOLERANCE = 1e-10;
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  export declare function primeFactors(n: number): {
3
3
  [factor: number]: number;
4
4
  };
@@ -1,7 +1,7 @@
1
- /* 0.35.6 */
2
- export declare function isRational(x: any | null): x is Rational;
3
- export declare function isMachineRational(x: any | null): x is [SmallInteger, SmallInteger];
4
- export declare function isBigRational(x: any | null): x is [bigint, bigint];
1
+ /* 0.50.1 */
2
+ export declare function isRational(x: unknown | null): x is Rational;
3
+ export declare function isMachineRational(x: unknown | null): x is [SmallInteger, SmallInteger];
4
+ export declare function isBigRational(x: unknown | null): x is [bigint, bigint];
5
5
  export declare function isZero(x: Rational): boolean;
6
6
  export declare function isPositive(x: Rational): boolean;
7
7
  export declare function isOne(x: Rational): boolean;
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
 
3
3
  Translated from https://github.com/JuliaMath/Richardson.jl/blob/master/src/Richardson.jl
4
4
 
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
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;
@@ -26,3 +26,122 @@ export declare function erfc(x: number): number;
26
26
  export declare function erf(x: number): number;
27
27
  export declare function bigGammaln(ce: ComputeEngine, z: BigNum): BigNum;
28
28
  export declare function bigGamma(ce: ComputeEngine, z: BigNum): BigNum;
29
+ /**
30
+ * Bignum Digamma function ψ(z) = d/dz ln(Γ(z))
31
+ * Same algorithm as machine `digamma`: reflection for negative z,
32
+ * recurrence to shift z > 7, then asymptotic expansion with Bernoulli numbers.
33
+ */
34
+ export declare function bigDigamma(ce: ComputeEngine, z: BigNum): BigNum;
35
+ /**
36
+ * Bignum Trigamma function ψ₁(z) = d/dz ψ(z) = d²/dz² ln(Γ(z))
37
+ * Same recurrence/asymptotic structure as digamma but for the second derivative.
38
+ */
39
+ export declare function bigTrigamma(ce: ComputeEngine, z: BigNum): BigNum;
40
+ /**
41
+ * Bignum Polygamma function ψₙ(z) = dⁿ/dzⁿ ψ(z)
42
+ * Delegates to bigDigamma/bigTrigamma for n=0,1.
43
+ * For n ≥ 2, uses recurrence + asymptotic expansion.
44
+ */
45
+ export declare function bigPolygamma(ce: ComputeEngine, n: BigNum, z: BigNum): BigNum;
46
+ /**
47
+ * Bignum Beta function B(a, b) = Γ(a)Γ(b)/Γ(a+b)
48
+ * Uses bigGamma directly.
49
+ */
50
+ export declare function bigBeta(ce: ComputeEngine, a: BigNum, b: BigNum): BigNum;
51
+ /**
52
+ * Bignum Riemann zeta function ζ(s)
53
+ * Uses Cohen-Villegas-Zagier acceleration (same algorithm as machine version).
54
+ */
55
+ export declare function bigZeta(ce: ComputeEngine, s: BigNum): BigNum;
56
+ /**
57
+ * Bignum Lambert W function W₀(x): principal branch satisfying W(x)·e^{W(x)} = x.
58
+ * Uses Halley's method with adaptive precision tolerance.
59
+ */
60
+ export declare function bigLambertW(ce: ComputeEngine, x: BigNum): BigNum;
61
+ /**
62
+ * Digamma function ψ(x) = d/dx ln(Γ(x)) = Γ'(x)/Γ(x)
63
+ * Uses recurrence to shift x > 7 then asymptotic expansion.
64
+ */
65
+ export declare function digamma(x: number): number;
66
+ /**
67
+ * Trigamma function ψ₁(x) = d/dx ψ(x) = d²/dx² ln(Γ(x))
68
+ * Uses recurrence + asymptotic expansion.
69
+ */
70
+ export declare function trigamma(x: number): number;
71
+ /**
72
+ * Polygamma function ψₙ(x) = dⁿ/dxⁿ ψ(x)
73
+ * PolyGamma(0, x) = Digamma(x), PolyGamma(1, x) = Trigamma(x)
74
+ * For n ≥ 2, uses recurrence + asymptotic expansion.
75
+ */
76
+ export declare function polygamma(n: number, x: number): number;
77
+ /**
78
+ * Beta function B(a, b) = Γ(a)Γ(b)/Γ(a+b)
79
+ * Uses gamma directly for small args (more accurate) and gammaln for large.
80
+ */
81
+ export declare function beta(a: number, b: number): number;
82
+ /**
83
+ * Riemann zeta function ζ(s) = Σ_{n=1}^∞ 1/n^s
84
+ * Uses Borwein's algorithm for convergence acceleration.
85
+ */
86
+ export declare function zeta(s: number): number;
87
+ /**
88
+ * Lambert W function W₀(x): the principal branch satisfying W(x)·e^{W(x)} = x.
89
+ * Uses Halley's method with appropriate initial guesses.
90
+ */
91
+ export declare function lambertW(x: number): number;
92
+ /**
93
+ * Bessel function of the first kind J_n(x) for integer order n.
94
+ *
95
+ * Uses power series for small |x|, asymptotic expansion for large |x|,
96
+ * and Miller's backward recurrence for intermediate values.
97
+ *
98
+ * Reference: Abramowitz & Stegun, Ch. 9; NIST DLMF 10.2, 10.17
99
+ */
100
+ export declare function besselJ(n: number, x: number): number;
101
+ /**
102
+ * Bessel function of the second kind Y_n(x) for integer order n.
103
+ *
104
+ * Y_0 and Y_1 computed directly via series/integrals, higher orders via
105
+ * forward recurrence: Y_{n+1}(x) = (2n/x)Y_n(x) - Y_{n-1}(x).
106
+ *
107
+ * Reference: NIST DLMF 10.8, 10.17
108
+ */
109
+ export declare function besselY(n: number, x: number): number;
110
+ /**
111
+ * Modified Bessel function of the first kind I_n(x) for integer order n.
112
+ *
113
+ * I_n(x) = i^{-n} J_n(ix) — uses power series for small |x|,
114
+ * scaled Miller's recurrence for intermediate, asymptotic for large |x|.
115
+ *
116
+ * Reference: NIST DLMF 10.25, 10.40
117
+ */
118
+ export declare function besselI(n: number, x: number): number;
119
+ /**
120
+ * Modified Bessel function of the second kind K_n(x) for integer order n.
121
+ *
122
+ * K_0 and K_1 computed via series, higher orders via forward recurrence:
123
+ * K_{n+1}(x) = (2n/x)K_n(x) + K_{n-1}(x).
124
+ *
125
+ * Reference: NIST DLMF 10.31, 10.40
126
+ */
127
+ export declare function besselK(n: number, x: number): number;
128
+ /**
129
+ * Airy function of the first kind Ai(x).
130
+ *
131
+ * For x < 0 and small |x|, uses power series.
132
+ * For large positive x, uses asymptotic: Ai(x) ~ e^{-ξ}/(2√π x^{1/4})
133
+ * For large negative x, uses asymptotic oscillatory form.
134
+ * For moderate x, uses power series with sufficient terms.
135
+ *
136
+ * Reference: NIST DLMF 9.2, 9.7
137
+ */
138
+ export declare function airyAi(x: number): number;
139
+ /**
140
+ * Airy function of the second kind Bi(x).
141
+ *
142
+ * Similar structure to Ai(x) but with different coefficients
143
+ * and asymptotic behavior (Bi grows for positive x).
144
+ *
145
+ * Reference: NIST DLMF 9.2, 9.7
146
+ */
147
+ export declare function airyBi(x: number): number;
@@ -1,5 +1,4 @@
1
- /* 0.35.6 */
2
- import type { BigNum } from './types';
1
+ /* 0.50.1 */
3
2
  export declare function mean(values: Iterable<number>): number;
4
3
  export declare function bigMean(bignum: BigNumFactory, values: Iterable<BigNum>): BigNum;
5
4
  export declare function median(values: Iterable<number>): number;
@@ -1,2 +1,2 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  export declare function numberToString(num: number | bigint, fractionalDigits?: number | string): string;
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
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
@@ -18,6 +18,8 @@ export type Rational = [SmallInteger, SmallInteger] | [bigint, bigint];
18
18
  /** @category Numerics */
19
19
  export type BigNum = Decimal;
20
20
  /** @category Numerics */
21
+ export type BigNumFactory = (value: Decimal.Value) => Decimal;
22
+ /** @category Numerics */
21
23
  export interface IBigNum {
22
24
  readonly _BIGNUM_NAN: BigNum;
23
25
  readonly _BIGNUM_ZERO: BigNum;
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  * OEIS (Online Encyclopedia of Integer Sequences) Integration
3
3
  *
4
4
  * This module provides functions to look up sequences in the OEIS database
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * @see https://oeis.org
8
8
  */
9
- import type { ComputeEngine, BoxedExpression } from './global-types';
9
+ import type { IComputeEngine as ComputeEngine, Expression } from './global-types';
10
10
  /**
11
11
  * Result from an OEIS lookup operation.
12
12
  */
@@ -69,7 +69,7 @@ export declare function lookupOEISById(id: string, options?: OEISOptions): Promi
69
69
  * @param options - Optional configuration
70
70
  * @returns Promise resolving to array of matching sequences
71
71
  */
72
- export declare function lookupSequence(ce: ComputeEngine, terms: (number | BoxedExpression)[], options?: OEISOptions): Promise<OEISSequenceInfo[]>;
72
+ export declare function lookupSequence(ce: ComputeEngine, terms: (number | Expression)[], options?: OEISOptions): Promise<OEISSequenceInfo[]>;
73
73
  /**
74
74
  * Check if a defined sequence matches an OEIS sequence.
75
75
  *
@@ -1,10 +1,10 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  * Utilities for declarative sequence definitions.
3
3
  *
4
4
  * This module provides functions to create subscriptEvaluate handlers
5
5
  * from sequence definitions (base cases + recurrence relation).
6
6
  */
7
- import type { BoxedExpression, ComputeEngine, SequenceDefinition, SequenceStatus, SequenceInfo } from './global-types';
7
+ import type { Expression, IComputeEngine as ComputeEngine, SequenceDefinition, SequenceStatus, SequenceInfo } from './global-types';
8
8
  /**
9
9
  * Create a subscriptEvaluate handler from a sequence definition.
10
10
  *
@@ -17,10 +17,10 @@ import type { BoxedExpression, ComputeEngine, SequenceDefinition, SequenceStatus
17
17
  * - Single-index: `F_{10}` with subscript as a number
18
18
  * - Multi-index: `P_{5,2}` with subscript as `Sequence(5, 2)`
19
19
  */
20
- export declare function createSequenceHandler(ce: ComputeEngine, name: string, def: SequenceDefinition): (subscript: BoxedExpression, options: {
20
+ export declare function createSequenceHandler(ce: ComputeEngine, name: string, def: SequenceDefinition): (subscript: Expression, options: {
21
21
  engine: ComputeEngine;
22
22
  numericApproximation?: boolean;
23
- }) => BoxedExpression | undefined;
23
+ }) => Expression | undefined;
24
24
  /**
25
25
  * Validate a sequence definition.
26
26
  */
@@ -32,41 +32,41 @@ export declare function validateSequenceDefinition(ce: ComputeEngine, name: stri
32
32
  * Add a base case for a single-index sequence definition.
33
33
  * e.g., from `L_0 := 1`
34
34
  */
35
- export declare function addSequenceBaseCase(ce: ComputeEngine, name: string, index: number, value: BoxedExpression): void;
35
+ export declare function addSequenceBaseCase(ce: ComputeEngine, name: string, index: number, value: Expression): void;
36
36
  /**
37
37
  * Add a base case for a multi-index sequence definition.
38
38
  * e.g., from `P_{0,0} := 1` or `P_{n,0} := 1`
39
39
  *
40
40
  * @param key - The base case key, e.g., '0,0' for exact or 'n,0' for pattern
41
41
  */
42
- export declare function addMultiIndexBaseCase(ce: ComputeEngine, name: string, key: string, value: BoxedExpression): void;
42
+ export declare function addMultiIndexBaseCase(ce: ComputeEngine, name: string, key: string, value: Expression): void;
43
43
  /**
44
44
  * Add a recurrence relation for a single-index sequence definition.
45
45
  * e.g., from `L_n := L_{n-1} + 1`
46
46
  *
47
- * We store the recurrence as a LaTeX string rather than a BoxedExpression
47
+ * We store the recurrence as a LaTeX string rather than a Expression
48
48
  * because the expression may have been parsed before the symbol was declared
49
49
  * with subscriptEvaluate. Storing as LaTeX allows us to re-parse fresh when
50
50
  * creating the handler, ensuring proper binding.
51
51
  */
52
- export declare function addSequenceRecurrence(ce: ComputeEngine, name: string, variable: string, expr: BoxedExpression): void;
52
+ export declare function addSequenceRecurrence(ce: ComputeEngine, name: string, variable: string, expr: Expression): void;
53
53
  /**
54
54
  * Add a recurrence relation for a multi-index sequence definition.
55
55
  * e.g., from `P_{n,k} := P_{n-1,k-1} + P_{n-1,k}`
56
56
  *
57
57
  * @param variables - The index variable names, e.g., ['n', 'k']
58
58
  */
59
- export declare function addMultiIndexRecurrence(ce: ComputeEngine, name: string, variables: string[], expr: BoxedExpression): void;
59
+ export declare function addMultiIndexRecurrence(ce: ComputeEngine, name: string, variables: string[], expr: Expression): void;
60
60
  /**
61
61
  * Check if expression contains self-reference to sequence name.
62
62
  * e.g., `a_{n-1}` when defining sequence 'a'
63
63
  */
64
- export declare function containsSelfReference(expr: BoxedExpression, seqName: string): boolean;
64
+ export declare function containsSelfReference(expr: Expression, seqName: string): boolean;
65
65
  /**
66
66
  * Extract the index variable from a subscript expression.
67
67
  * e.g., from `n-1` extract 'n', from `2*k` extract 'k'
68
68
  */
69
- export declare function extractIndexVariable(subscript: BoxedExpression): string | undefined;
69
+ export declare function extractIndexVariable(subscript: Expression): string | undefined;
70
70
  /**
71
71
  * Get the status of a sequence definition.
72
72
  *
@@ -99,7 +99,7 @@ export declare function clearSequenceCache(ce: ComputeEngine, name?: string): vo
99
99
  * For single-index sequences, keys are numbers.
100
100
  * For multi-index sequences, keys are comma-separated strings (e.g., '5,2').
101
101
  */
102
- export declare function getSequenceCache(ce: ComputeEngine, name: string): Map<number | string, BoxedExpression> | undefined;
102
+ export declare function getSequenceCache(ce: ComputeEngine, name: string): Map<number | string, Expression> | undefined;
103
103
  /**
104
104
  * Generate a list of sequence terms from start to end (inclusive).
105
105
  *
@@ -117,4 +117,4 @@ export declare function getSequenceCache(ce: ComputeEngine, name: string): Map<n
117
117
  * // → [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]
118
118
  * ```
119
119
  */
120
- export declare function generateSequenceTerms(ce: ComputeEngine, name: string, start: number, end: number, step?: number): BoxedExpression[] | undefined;
120
+ export declare function generateSequenceTerms(ce: ComputeEngine, name: string, start: number, end: number, step?: number): Expression[] | undefined;
@@ -1,3 +1,3 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  /** Calculate the antiderivative of fn, as an expression (not a function) */
3
- export declare function antiderivative(fn: BoxedExpression, index: string): BoxedExpression;
3
+ export declare function antiderivative(fn: Expression, index: string): Expression;
@@ -1,4 +1,4 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  /**
3
3
  *
4
4
  * @param fn The function to differentiate, a function literal.
@@ -6,7 +6,7 @@
6
6
  * @returns a function expression representing the derivative of `fn` with
7
7
  * respect to the variables in `degrees`.
8
8
  */
9
- export declare function derivative(fn: BoxedExpression, order: number): BoxedExpression | undefined;
9
+ export declare function derivative(fn: Expression, order: number): Expression | undefined;
10
10
  /**
11
11
  * Calculate the partial derivative of an expression with respect to a
12
12
  * variable, `v`.
@@ -30,4 +30,4 @@ export declare function derivative(fn: BoxedExpression, order: number): BoxedExp
30
30
  * @param depth - Internal recursion depth counter (do not pass manually)
31
31
  * @returns The derivative expression, or `undefined` if unable to differentiate
32
32
  */
33
- export declare function differentiate(expr: BoxedExpression, v: string, depth?: number): BoxedExpression | undefined;
33
+ export declare function differentiate(expr: Expression, v: string, depth?: number): Expression | undefined;
@@ -1,5 +1,5 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  /**
3
3
  *
4
4
  */
5
- export declare function distribute(expr: BoxedExpression, g?: string, f?: string): BoxedExpression;
5
+ export declare function distribute(expr: Expression, g?: string, f?: string): Expression;
@@ -1,20 +1,20 @@
1
- /* 0.35.6 */
1
+ /* 0.50.1 */
2
2
  * Cost functions for the Fu trigonometric simplification algorithm.
3
3
  *
4
4
  * The primary objective is to minimize the number of trigonometric functions,
5
5
  * with secondary consideration for overall expression complexity.
6
6
  */
7
- import type { BoxedExpression } from '../global-types';
7
+ import type { Expression } from '../global-types';
8
8
  /**
9
9
  * Count the number of trigonometric function occurrences in an expression.
10
10
  * This is the primary metric for the Fu algorithm.
11
11
  */
12
- export declare function countTrigFunctions(expr: BoxedExpression): number;
12
+ export declare function countTrigFunctions(expr: Expression): number;
13
13
  /**
14
14
  * Count the number of leaves (atoms) in an expression.
15
15
  * Includes symbols, numbers, and function names.
16
16
  */
17
- export declare function countLeaves(expr: BoxedExpression): number;
17
+ export declare function countLeaves(expr: Expression): number;
18
18
  /**
19
19
  * The default trig cost function for the Fu algorithm.
20
20
  *
@@ -25,8 +25,8 @@ export declare function countLeaves(expr: BoxedExpression): number;
25
25
  * This ensures that expressions with fewer trig functions are always
26
26
  * preferred, even if they have slightly more total operations.
27
27
  */
28
- export declare function trigCost(expr: BoxedExpression): number;
29
- export type TrigCostFunction = (expr: BoxedExpression) => number;
28
+ export declare function trigCost(expr: Expression): number;
29
+ export type TrigCostFunction = (expr: Expression) => number;
30
30
  /**
31
31
  * Default cost function for the Fu algorithm
32
32
  */