@danielsimonjr/mathts-functions 0.64.1 → 0.64.3

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 (228) hide show
  1. package/README.md +21 -21
  2. package/dist/algebra/decomposition/lup.d.ts.map +1 -1
  3. package/dist/algebra/rationalize.d.ts.map +1 -1
  4. package/dist/algebra/simplify/util.d.ts.map +1 -1
  5. package/dist/algebra/simplify/wildcards.d.ts +10 -0
  6. package/dist/algebra/simplify/wildcards.d.ts.map +1 -1
  7. package/dist/algebra/simplifyConstant.d.ts.map +1 -1
  8. package/dist/algebra/simplifyCore.d.ts.map +1 -1
  9. package/dist/algebra/solver/lsolve.d.ts.map +1 -1
  10. package/dist/algebra/solver/lsolveAll.d.ts +1 -0
  11. package/dist/algebra/solver/lsolveAll.d.ts.map +1 -1
  12. package/dist/algebra/solver/lusolve.d.ts.map +1 -1
  13. package/dist/algebra/solver/usolve.d.ts.map +1 -1
  14. package/dist/algebra/solver/usolveAll.d.ts +1 -0
  15. package/dist/algebra/solver/usolveAll.d.ts.map +1 -1
  16. package/dist/algebra/solver/utils/solveValidation.d.ts +4 -0
  17. package/dist/algebra/solver/utils/solveValidation.d.ts.map +1 -1
  18. package/dist/algebra/sparse/csAmd.d.ts +4 -0
  19. package/dist/algebra/sparse/csAmd.d.ts.map +1 -1
  20. package/dist/algebra/sparse/csChol.d.ts +12 -0
  21. package/dist/algebra/sparse/csChol.d.ts.map +1 -1
  22. package/dist/algebra/sparse/csCounts.d.ts +4 -0
  23. package/dist/algebra/sparse/csCounts.d.ts.map +1 -1
  24. package/dist/algebra/sparse/csDfs.d.ts +0 -1
  25. package/dist/algebra/sparse/csDfs.d.ts.map +1 -1
  26. package/dist/algebra/sparse/csLu.d.ts +9 -0
  27. package/dist/algebra/sparse/csLu.d.ts.map +1 -1
  28. package/dist/algebra/sparse/csSpsolve.d.ts +4 -0
  29. package/dist/algebra/sparse/csSpsolve.d.ts.map +1 -1
  30. package/dist/algebra/sparse/csSqr.d.ts +5 -0
  31. package/dist/algebra/sparse/csSqr.d.ts.map +1 -1
  32. package/dist/algebra/sparse/csSymperm.d.ts +4 -0
  33. package/dist/algebra/sparse/csSymperm.d.ts.map +1 -1
  34. package/dist/arithmetic/ceil.d.ts.map +1 -1
  35. package/dist/arithmetic/divide.d.ts.map +1 -1
  36. package/dist/arithmetic/fix.d.ts.map +1 -1
  37. package/dist/arithmetic/floor.d.ts.map +1 -1
  38. package/dist/arithmetic/log.d.ts.map +1 -1
  39. package/dist/arithmetic/log10.d.ts.map +1 -1
  40. package/dist/arithmetic/nthRoot.d.ts.map +1 -1
  41. package/dist/arithmetic/round.d.ts.map +1 -1
  42. package/dist/arithmetic/utils/nodeOperations.d.ts +1 -0
  43. package/dist/arithmetic/utils/nodeOperations.d.ts.map +1 -1
  44. package/dist/bitwise/leftShift.d.ts.map +1 -1
  45. package/dist/bitwise/rightArithShift.d.ts.map +1 -1
  46. package/dist/bitwise/rightLogShift.d.ts.map +1 -1
  47. package/dist/bitwise/useMatrixForArrayScalar.d.ts.map +1 -1
  48. package/dist/calculus-extra.d.ts.map +1 -1
  49. package/dist/cas/rat.d.ts +17 -0
  50. package/dist/cas/rat.d.ts.map +1 -1
  51. package/dist/clustering-extra.d.ts +4 -0
  52. package/dist/clustering-extra.d.ts.map +1 -1
  53. package/dist/complex/conj.d.ts.map +1 -1
  54. package/dist/complex/re.d.ts.map +1 -1
  55. package/dist/core/function/config.d.ts +8 -0
  56. package/dist/core/function/config.d.ts.map +1 -1
  57. package/dist/core/function/import.d.ts +5 -0
  58. package/dist/core/function/import.d.ts.map +1 -1
  59. package/dist/descriptive-stats.d.ts +16 -0
  60. package/dist/descriptive-stats.d.ts.map +1 -1
  61. package/dist/distribution-functions.d.ts.map +1 -1
  62. package/dist/expression/operators.d.ts +1 -1
  63. package/dist/factories/matrix-bridge.d.ts +7 -0
  64. package/dist/factories/matrix-bridge.d.ts.map +1 -1
  65. package/dist/geometry-extra.d.ts.map +1 -1
  66. package/dist/grad-forward.d.ts +1 -0
  67. package/dist/grad-forward.d.ts.map +1 -1
  68. package/dist/hypothesis-extra.d.ts +23 -0
  69. package/dist/hypothesis-extra.d.ts.map +1 -1
  70. package/dist/index.js +411 -126
  71. package/dist/logical/and.d.ts.map +1 -1
  72. package/dist/logical/nullish.d.ts.map +1 -1
  73. package/dist/matrix/det.d.ts +1 -1
  74. package/dist/matrix/det.d.ts.map +1 -1
  75. package/dist/matrix/diag.d.ts.map +1 -1
  76. package/dist/matrix/eigs/complexEigs.d.ts +5 -1
  77. package/dist/matrix/eigs/complexEigs.d.ts.map +1 -1
  78. package/dist/matrix/eigs/realSymmetric.d.ts +4 -0
  79. package/dist/matrix/eigs/realSymmetric.d.ts.map +1 -1
  80. package/dist/matrix/eigs.d.ts +1 -1
  81. package/dist/matrix/eigs.d.ts.map +1 -1
  82. package/dist/matrix/inv.d.ts +1 -1
  83. package/dist/matrix/inv.d.ts.map +1 -1
  84. package/dist/matrix/matrixFromColumns.d.ts.map +1 -1
  85. package/dist/matrix/matrixFromRows.d.ts.map +1 -1
  86. package/dist/matrix/native-accel.d.ts.map +1 -1
  87. package/dist/matrix/ones.d.ts.map +1 -1
  88. package/dist/matrix/pinv.d.ts +1 -1
  89. package/dist/matrix/pinv.d.ts.map +1 -1
  90. package/dist/matrix/range.d.ts.map +1 -1
  91. package/dist/matrix/resize.d.ts.map +1 -1
  92. package/dist/matrix/sqrtm.d.ts +1 -1
  93. package/dist/matrix/sqrtm.d.ts.map +1 -1
  94. package/dist/matrix/subset.d.ts.map +1 -1
  95. package/dist/matrix/utils/zerosAndOnes.d.ts +13 -0
  96. package/dist/matrix/utils/zerosAndOnes.d.ts.map +1 -1
  97. package/dist/matrix/zeros.d.ts.map +1 -1
  98. package/dist/ml/glm.d.ts +2 -0
  99. package/dist/ml/glm.d.ts.map +1 -1
  100. package/dist/ml/kde.d.ts +1 -0
  101. package/dist/ml/kde.d.ts.map +1 -1
  102. package/dist/ml/logistic-regression.d.ts +2 -0
  103. package/dist/ml/logistic-regression.d.ts.map +1 -1
  104. package/dist/ml/ols.d.ts +2 -0
  105. package/dist/ml/ols.d.ts.map +1 -1
  106. package/dist/ml/regularized-regression.d.ts +6 -0
  107. package/dist/ml/regularized-regression.d.ts.map +1 -1
  108. package/dist/numeric/numeric-jacobian.d.ts +1 -0
  109. package/dist/numeric/numeric-jacobian.d.ts.map +1 -1
  110. package/dist/numeric-extra.d.ts.map +1 -1
  111. package/dist/optimization-extra.d.ts +8 -0
  112. package/dist/optimization-extra.d.ts.map +1 -1
  113. package/dist/plain/number/arithmetic.d.ts +15 -1
  114. package/dist/plain/number/arithmetic.d.ts.map +1 -1
  115. package/dist/plain/number/bitwise.d.ts +35 -0
  116. package/dist/plain/number/bitwise.d.ts.map +1 -1
  117. package/dist/plain/number/combinations.d.ts +8 -0
  118. package/dist/plain/number/combinations.d.ts.map +1 -1
  119. package/dist/plain/number/logical.d.ts +4 -0
  120. package/dist/plain/number/logical.d.ts.map +1 -1
  121. package/dist/plain/number/probability.d.ts +14 -0
  122. package/dist/plain/number/probability.d.ts.map +1 -1
  123. package/dist/plain/number/relational.d.ts +12 -0
  124. package/dist/plain/number/relational.d.ts.map +1 -1
  125. package/dist/plain/number/trigonometry.d.ts +33 -0
  126. package/dist/plain/number/trigonometry.d.ts.map +1 -1
  127. package/dist/plain/number/utils.d.ts +5 -0
  128. package/dist/plain/number/utils.d.ts.map +1 -1
  129. package/dist/probability/util/seededRNG.d.ts +6 -0
  130. package/dist/probability/util/seededRNG.d.ts.map +1 -1
  131. package/dist/regression-extra.d.ts +1 -0
  132. package/dist/regression-extra.d.ts.map +1 -1
  133. package/dist/signal/iir-design.d.ts.map +1 -1
  134. package/dist/signal/remez-exchange.d.ts +4 -0
  135. package/dist/signal/remez-exchange.d.ts.map +1 -1
  136. package/dist/signal-filter-extra.d.ts +1 -0
  137. package/dist/signal-filter-extra.d.ts.map +1 -1
  138. package/dist/special/hypergeometric.d.ts +1 -1
  139. package/dist/special/niche.d.ts +2 -2
  140. package/dist/special/wave-functions.d.ts +4 -4
  141. package/dist/special/zeta.d.ts.map +1 -1
  142. package/dist/stats/power-analysis.d.ts +1 -0
  143. package/dist/stats/power-analysis.d.ts.map +1 -1
  144. package/dist/trigonometry/atan2.d.ts.map +1 -1
  145. package/dist/type/bignumber/BigNumber.d.ts +1 -1
  146. package/dist/type/bignumber/BigNumber.d.ts.map +1 -1
  147. package/dist/type/local/Decimal.d.ts +1 -0
  148. package/dist/type/local/Decimal.d.ts.map +1 -1
  149. package/dist/type/matrix/ImmutableDenseMatrix.d.ts +28 -38
  150. package/dist/type/matrix/ImmutableDenseMatrix.d.ts.map +1 -1
  151. package/dist/type/matrix/MatrixIndex.d.ts.map +1 -1
  152. package/dist/type/matrix/Spa.d.ts +1 -1
  153. package/dist/type/matrix/function/index.d.ts.map +1 -1
  154. package/dist/type/matrix/utils/matAlgo09xS0Sf.d.ts.map +1 -1
  155. package/dist/type/matrix/utils/matAlgo11xS0s.d.ts.map +1 -1
  156. package/dist/type/matrix/utils/matrixAlgorithmSuite.d.ts.map +1 -1
  157. package/dist/type/unit/physicalConstants.d.ts +1 -1
  158. package/dist/type/unit/physicalConstants.d.ts.map +1 -1
  159. package/dist/typed/arithmetic.d.ts +91 -91
  160. package/dist/typed/arithmetic.d.ts.map +1 -1
  161. package/dist/typed/bitwise.d.ts +14 -14
  162. package/dist/typed/bitwise.d.ts.map +1 -1
  163. package/dist/typed/cas.d.ts.map +1 -1
  164. package/dist/typed/combinatorics.d.ts +21 -21
  165. package/dist/typed/combinatorics.d.ts.map +1 -1
  166. package/dist/typed/complex.d.ts +8 -8
  167. package/dist/typed/complex.d.ts.map +1 -1
  168. package/dist/typed/distributions.d.ts +28 -28
  169. package/dist/typed/distributions.d.ts.map +1 -1
  170. package/dist/typed/geometry.d.ts +4 -4
  171. package/dist/typed/graph.d.ts.map +1 -1
  172. package/dist/typed/hypothesis.d.ts +26 -0
  173. package/dist/typed/hypothesis.d.ts.map +1 -1
  174. package/dist/typed/integration.d.ts +1 -1
  175. package/dist/typed/logical.d.ts +10 -10
  176. package/dist/typed/logical.d.ts.map +1 -1
  177. package/dist/typed/matrix-ops.d.ts +9 -9
  178. package/dist/typed/matrix-ops.d.ts.map +1 -1
  179. package/dist/typed/numeric.d.ts +4 -4
  180. package/dist/typed/numeric.d.ts.map +1 -1
  181. package/dist/typed/polynomial-ideal.d.ts +10 -0
  182. package/dist/typed/polynomial-ideal.d.ts.map +1 -1
  183. package/dist/typed/probability.d.ts +16 -16
  184. package/dist/typed/probability.d.ts.map +1 -1
  185. package/dist/typed/relational.d.ts +14 -14
  186. package/dist/typed/relational.d.ts.map +1 -1
  187. package/dist/typed/set.d.ts +20 -20
  188. package/dist/typed/set.d.ts.map +1 -1
  189. package/dist/typed/signal.d.ts +23 -23
  190. package/dist/typed/signal.d.ts.map +1 -1
  191. package/dist/typed/special.d.ts +76 -76
  192. package/dist/typed/special.d.ts.map +1 -1
  193. package/dist/typed/statistics.d.ts +34 -34
  194. package/dist/typed/statistics.d.ts.map +1 -1
  195. package/dist/typed/string.d.ts +10 -10
  196. package/dist/typed/string.d.ts.map +1 -1
  197. package/dist/typed/trigonometry.d.ts +38 -38
  198. package/dist/typed/trigonometry.d.ts.map +1 -1
  199. package/dist/typed/unit.d.ts +4 -4
  200. package/dist/typed/unit.d.ts.map +1 -1
  201. package/dist/types.d.ts +7 -1
  202. package/dist/types.d.ts.map +1 -1
  203. package/dist/utils/bignumber/bitwise.d.ts +21 -0
  204. package/dist/utils/bignumber/bitwise.d.ts.map +1 -1
  205. package/dist/utils/bignumber/nearlyEqual.d.ts +16 -0
  206. package/dist/utils/bignumber/nearlyEqual.d.ts.map +1 -1
  207. package/dist/utils/emitter.d.ts +1 -0
  208. package/dist/utils/emitter.d.ts.map +1 -1
  209. package/dist/utils/factory.d.ts +2 -1
  210. package/dist/utils/factory.d.ts.map +1 -1
  211. package/dist/utils/is.d.ts +140 -0
  212. package/dist/utils/is.d.ts.map +1 -1
  213. package/dist/utils/noop.d.ts +3 -0
  214. package/dist/utils/noop.d.ts.map +1 -1
  215. package/dist/utils/product.d.ts +4 -1
  216. package/dist/utils/product.d.ts.map +1 -1
  217. package/dist/wasm/WasmLoader.d.ts +6 -0
  218. package/dist/wasm/WasmLoader.d.ts.map +1 -1
  219. package/dist/wasm/elementwise/wasm-bridge.d.ts +1 -0
  220. package/dist/wasm/elementwise/wasm-bridge.d.ts.map +1 -1
  221. package/dist/wasm/special/scalars.d.ts +22 -0
  222. package/dist/wasm/special/scalars.d.ts.map +1 -1
  223. package/dist/wasm/special/wasm-bridge.d.ts +80 -0
  224. package/dist/wasm/special/wasm-bridge.d.ts.map +1 -1
  225. package/package.json +76 -76
  226. package/types/assemblyscript.d.ts +101 -101
  227. package/types/index.d.ts +7801 -7801
  228. package/types/modules.d.ts +19 -19
@@ -88,19 +88,99 @@ export declare function lgammaJS(xs: Float64Array): Float64Array;
88
88
  * 2. Fall back to pure-JS `lgammaJS`.
89
89
  */
90
90
  export declare const lgammaDispatch: (xs: Float64Array) => Float64Array;
91
+ /**
92
+ * Compute the Carlson integral RC(x, y) for each pair of elements, in JavaScript.
93
+ *
94
+ * The function reads element `i` of each input array and writes element `i` of a new
95
+ * array. It does not change the inputs.
96
+ * An element with `x < 0` or `y <= 0` gives NaN.
97
+ */
91
98
  export declare function carlsonRCJS(xs: Float64Array, ys: Float64Array): Float64Array;
99
+ /**
100
+ * Compute the Carlson integral RF(x, y, z) for each element triple, in JavaScript.
101
+ *
102
+ * The function reads element `i` of each input array and writes element `i` of a new
103
+ * array. It does not change the inputs.
104
+ * An element with a negative argument gives NaN.
105
+ */
92
106
  export declare function carlsonRFJS(xs: Float64Array, ys: Float64Array, zs: Float64Array): Float64Array;
107
+ /**
108
+ * Compute the Carlson integral RD(x, y, z) for each element triple, in JavaScript.
109
+ *
110
+ * The function reads element `i` of each input array and writes element `i` of a new
111
+ * array. It does not change the inputs.
112
+ * An element with `x < 0`, `y < 0`, `z <= 0`, or `x` and `y` both 0 gives NaN.
113
+ */
93
114
  export declare function carlsonRDJS(xs: Float64Array, ys: Float64Array, zs: Float64Array): Float64Array;
115
+ /**
116
+ * Compute the Carlson integral RJ(x, y, z, p) for each element set, in JavaScript.
117
+ *
118
+ * The function reads element `i` of each input array and writes element `i` of a new
119
+ * array. It does not change the inputs.
120
+ * An element with a negative `x`, `y` or `z`, or with `p` equal to 0, gives NaN.
121
+ */
94
122
  export declare function carlsonRJJS(xs: Float64Array, ys: Float64Array, zs: Float64Array, ps: Float64Array): Float64Array;
123
+ /**
124
+ * Compute the incomplete elliptic integral of the first kind F(phi | m) for each element
125
+ * pair, in JavaScript.
126
+ *
127
+ * The function reads element `i` of each input array and writes element `i` of a new
128
+ * array. It does not change the inputs.
129
+ * An element with `1 - m sin^2(phi) < 0` gives NaN.
130
+ */
95
131
  export declare function ellipticFIncompleteJS(phis: Float64Array, ms: Float64Array): Float64Array;
132
+ /**
133
+ * Compute the incomplete elliptic integral of the second kind E(phi | m) for each element
134
+ * pair, in JavaScript.
135
+ *
136
+ * The function reads element `i` of each input array and writes element `i` of a new
137
+ * array. It does not change the inputs.
138
+ * An element with `1 - m sin^2(phi) < 0` gives NaN.
139
+ */
96
140
  export declare function ellipticEIncompleteJS(phis: Float64Array, ms: Float64Array): Float64Array;
141
+ /**
142
+ * Compute the incomplete elliptic integral of the third kind Pi(n; phi | m) for each
143
+ * element set, in JavaScript.
144
+ *
145
+ * The function reads element `i` of each input array and writes element `i` of a new
146
+ * array. It does not change the inputs.
147
+ * An element with `1 - m sin^2(phi) < 0` or `1 - n sin^2(phi) <= 0` gives NaN.
148
+ */
97
149
  export declare function ellipticPiIncompleteJS(ns: Float64Array, phis: Float64Array, ms: Float64Array): Float64Array;
150
+ /** Return the Carlson integral RC(x, y). The result is NaN if `x < 0` or `y <= 0`. */
98
151
  export declare function carlsonRCScalar(x: number, y: number): number;
152
+ /** Return the Carlson integral RF(x, y, z). The result is NaN if an argument is negative. */
99
153
  export declare function carlsonRFScalar(x: number, y: number, z: number): number;
154
+ /**
155
+ * Return the Carlson integral RD(x, y, z).
156
+ *
157
+ * The result is NaN if `x < 0`, `y < 0`, `z <= 0`, or `x` and `y` are both 0.
158
+ */
100
159
  export declare function carlsonRDScalar(x: number, y: number, z: number): number;
160
+ /**
161
+ * Return the Carlson integral RJ(x, y, z, p).
162
+ *
163
+ * The result is NaN if `x`, `y` or `z` is negative, or if `p` is 0.
164
+ */
101
165
  export declare function carlsonRJScalar(x: number, y: number, z: number, p: number): number;
166
+ /**
167
+ * Return the incomplete elliptic integral of the first kind F(phi | m).
168
+ *
169
+ * The result is 0 if `phi` is 0, and NaN if `1 - m sin^2(phi) < 0`.
170
+ */
102
171
  export declare function ellipticFIncompleteScalar(phi: number, m: number): number;
172
+ /**
173
+ * Return the incomplete elliptic integral of the second kind E(phi | m).
174
+ *
175
+ * The result is 0 if `phi` is 0, and NaN if `1 - m sin^2(phi) < 0`.
176
+ */
103
177
  export declare function ellipticEIncompleteScalar(phi: number, m: number): number;
178
+ /**
179
+ * Return the incomplete elliptic integral of the third kind Pi(n; phi | m).
180
+ *
181
+ * The result is 0 if `phi` is 0. It is NaN if `1 - m sin^2(phi) < 0` or
182
+ * `1 - n sin^2(phi) <= 0`.
183
+ */
104
184
  export declare function ellipticPiIncompleteScalar(n: number, phi: number, m: number): number;
105
185
  /** Dispatch RC(x, y) element-wise — AS managed → JS. */
106
186
  export declare function carlsonRCDispatch(xs: Float64Array, ys: Float64Array): Float64Array;
@@ -1 +1 @@
1
- {"version":3,"file":"wasm-bridge.d.ts","sourceRoot":"","sources":["../../../src/wasm/special/wasm-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAyBH;;GAEG;AACH,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAe3C,oCAAoC;AACpC,wBAAgB,UAAU,CAAC,EAAE,EAAE,YAAY,GAAG,YAAY,CAMzD;AAED,o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,iBAAiB,CAC/B,EAAE,EAAE,YAAY,EAChB,EAAE,EAAE,YAAY,EAChB,EAAE,EAAE,YAAY,GACf,YAAY,CAEd;AAED,4CAA4C;AAC5C,wBAAgB,iBAAiB,CAC/B,EAAE,EAAE,YAAY,EAChB,EAAE,EAAE,YAAY,EAChB,EAAE,EAAE,YAAY,EAChB,EAAE,EAAE,YAAY,GACf,YAAY,CAEd;AAED,qCAAqC;AACrC,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,YAAY,GAAG,YAAY,CAI9F;AAED,kDAAkD;AAClD,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,YAAY,GAAG,YAAY,CAI9F;AAED,wCAAwC;AACxC,wBAAgB,4BAA4B,CAC1C,EAAE,EAAE,YAAY,EAChB,IAAI,EAAE,YAAY,EAClB,EAAE,EAAE,YAAY,GACf,YAAY,CAId;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAEpC;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAExC;AAED;;GAEG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAEtC;AAWD,4EAA4E;AAC5E,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,GAAG,YAAY,CAM1D;AAED,oFAAoF;AACpF,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,GAAG,YAAY,CAM1D;AAED,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,oCAI5B,CAAC;AAEH,qDAAqD;AACrD,eAAO,MAAM,iBAAiB,oCAI5B,CAAC"}
package/package.json CHANGED
@@ -1,76 +1,76 @@
1
- {
2
- "name": "@danielsimonjr/mathts-functions",
3
- "version": "0.64.1",
4
- "description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
5
- "author": "Daniel Simon Jr.",
6
- "license": "MIT",
7
- "type": "module",
8
- "main": "./dist/index.js",
9
- "module": "./dist/index.js",
10
- "types": "./dist/index.d.ts",
11
- "exports": {
12
- ".": {
13
- "import": "./dist/index.js",
14
- "types": "./dist/index.d.ts"
15
- }
16
- },
17
- "files": [
18
- "dist",
19
- "types",
20
- "README.md"
21
- ],
22
- "scripts": {
23
- "build": "tsup src/index.ts --format esm --clean && tsc -p tsconfig.dts.json && node scripts/copy-wasm.mjs",
24
- "dev": "tsup src/index.ts --format esm --dts --watch",
25
- "test": "vitest run",
26
- "test:diff": "node tests/diff-special.test.mjs && node tests/diff-elementwise.test.mjs && node tests/diff-fusion.test.mjs",
27
- "golden:gen": "python -X utf8 tests/golden/gen_special_goldens.py",
28
- "test:watch": "vitest",
29
- "test:coverage": "vitest run --coverage",
30
- "typecheck": "tsc --noEmit",
31
- "lint": "oxlint src",
32
- "lint:fix": "oxlint src --fix",
33
- "clean": "rm -rf dist",
34
- "build:prod": "tsup src/index.ts --format esm --clean --minify --treeshake"
35
- },
36
- "dependencies": {
37
- "@danielsimonjr/mathts-core": "^0.15.0",
38
- "@danielsimonjr/mathts-expression": "^0.8.0",
39
- "@danielsimonjr/mathts-gpu": "^0.2.0",
40
- "@danielsimonjr/mathts-matrix": "^0.7.2",
41
- "@danielsimonjr/mathts-parallel": "^0.6.5",
42
- "bignumber.js": "^11.1.5",
43
- "complex.js": "^2.2.5",
44
- "decimal.js": "^10.4.3",
45
- "escape-latex": "^1.2.0",
46
- "fraction.js": "^5.2.1",
47
- "javascript-natural-sort": "^0.7.1",
48
- "seedrandom": "^3.0.5",
49
- "tiny-emitter": "^2.1.0",
50
- "typed-function": "github:danielsimonjr/typed-function"
51
- },
52
- "devDependencies": {
53
- "@types/node": "^26.4.0",
54
- "@webgpu/types": "^0.1.72",
55
- "tsup": "^8.0.0",
56
- "typescript": "^7.0.2",
57
- "vitest": "^5.0.0"
58
- },
59
- "publishConfig": {
60
- "access": "public"
61
- },
62
- "repository": {
63
- "type": "git",
64
- "url": "git+https://github.com/danielsimonjr/MathTS.git",
65
- "directory": "functions"
66
- },
67
- "keywords": [
68
- "math",
69
- "typescript",
70
- "functions",
71
- "arithmetic",
72
- "algebra",
73
- "trigonometry",
74
- "statistics"
75
- ]
76
- }
1
+ {
2
+ "name": "@danielsimonjr/mathts-functions",
3
+ "version": "0.64.3",
4
+ "description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
5
+ "author": "Daniel Simon Jr.",
6
+ "license": "MIT",
7
+ "type": "module",
8
+ "main": "./dist/index.js",
9
+ "module": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "import": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "types",
20
+ "README.md"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsup src/index.ts --format esm --clean && tsc -p tsconfig.dts.json && node scripts/copy-wasm.mjs",
24
+ "dev": "tsup src/index.ts --format esm --dts --watch",
25
+ "test": "vitest run",
26
+ "test:diff": "node tests/diff-special.test.mjs && node tests/diff-elementwise.test.mjs && node tests/diff-fusion.test.mjs",
27
+ "golden:gen": "python -X utf8 tests/golden/gen_special_goldens.py",
28
+ "test:watch": "vitest",
29
+ "test:coverage": "vitest run --coverage",
30
+ "typecheck": "tsc --noEmit",
31
+ "lint": "oxlint src",
32
+ "lint:fix": "oxlint src --fix",
33
+ "clean": "rm -rf dist",
34
+ "build:prod": "tsup src/index.ts --format esm --clean --minify --treeshake"
35
+ },
36
+ "dependencies": {
37
+ "@danielsimonjr/mathts-core": "^0.15.4",
38
+ "@danielsimonjr/mathts-expression": "^0.8.1",
39
+ "@danielsimonjr/mathts-gpu": "^0.2.1",
40
+ "@danielsimonjr/mathts-matrix": "^0.7.4",
41
+ "@danielsimonjr/mathts-parallel": "^0.6.6",
42
+ "bignumber.js": "^11.1.5",
43
+ "complex.js": "^2.2.5",
44
+ "decimal.js": "^10.4.3",
45
+ "escape-latex": "^1.2.0",
46
+ "fraction.js": "^5.2.1",
47
+ "javascript-natural-sort": "^0.7.1",
48
+ "seedrandom": "^3.0.5",
49
+ "tiny-emitter": "^2.1.0",
50
+ "typed-function": "npm:@danielsimonjr/typed-function@5.0.0-alpha.4"
51
+ },
52
+ "devDependencies": {
53
+ "@types/node": "^26.4.0",
54
+ "@webgpu/types": "^0.1.72",
55
+ "tsup": "^8.0.0",
56
+ "typescript": "^7.0.2",
57
+ "vitest": "^5.0.0"
58
+ },
59
+ "publishConfig": {
60
+ "access": "public"
61
+ },
62
+ "repository": {
63
+ "type": "git",
64
+ "url": "git+https://github.com/danielsimonjr/MathTS.git",
65
+ "directory": "functions"
66
+ },
67
+ "keywords": [
68
+ "math",
69
+ "typescript",
70
+ "functions",
71
+ "arithmetic",
72
+ "algebra",
73
+ "trigonometry",
74
+ "statistics"
75
+ ]
76
+ }
@@ -1,101 +1,101 @@
1
- /**
2
- * Ambient type declarations for AssemblyScript builtins.
3
- * These types are provided by the AssemblyScript compiler at build time
4
- * but need declarations for TypeScript type-checking when WASM files
5
- * are transitively included via imports from src/function/.
6
- */
7
-
8
- // AssemblyScript numeric types
9
- declare type usize = number;
10
- declare type i64 = number;
11
- declare type u8 = number;
12
- declare type u32 = number;
13
- declare type f32 = number;
14
-
15
- // f64: type alias + namespace with constants
16
- declare type f64 = number;
17
- declare namespace f64 {
18
- const NaN: f64;
19
- const POSITIVE_INFINITY: f64;
20
- const NEGATIVE_INFINITY: f64;
21
- const MAX_VALUE: f64;
22
- const MIN_VALUE: f64;
23
- }
24
-
25
- // i32: type alias + namespace with builtins
26
- declare type i32 = number;
27
- declare namespace i32 {
28
- function clz(value: i32): i32;
29
- function ctz(value: i32): i32;
30
- function rotl(value: i32, shift: i32): i32;
31
- function rotr(value: i32, shift: i32): i32;
32
- const MAX_VALUE: i32;
33
- const MIN_VALUE: i32;
34
- }
35
-
36
- /** SIMD 128-bit vector type */
37
- declare type v128 = object;
38
-
39
- /** v128 SIMD intrinsics namespace */
40
- declare namespace v128 {
41
- function load(ptr: usize, immOffset?: u32, immAlign?: u32): v128;
42
- function store(ptr: usize, value: v128, immOffset?: u32, immAlign?: u32): void;
43
- function splat<T>(value: T): v128;
44
- function extract_lane<T>(vec: v128, idx: u8): T;
45
- function replace_lane<T>(vec: v128, idx: u8, value: T): v128;
46
- function add<T>(a: v128, b: v128): v128;
47
- function sub<T>(a: v128, b: v128): v128;
48
- function mul<T>(a: v128, b: v128): v128;
49
- function div<T>(a: v128, b: v128): v128;
50
- function neg<T>(a: v128): v128;
51
- function abs<T>(a: v128): v128;
52
- function sqrt<T>(a: v128): v128;
53
- function min<T>(a: v128, b: v128): v128;
54
- function max<T>(a: v128, b: v128): v128;
55
- function and(a: v128, b: v128): v128;
56
- function or(a: v128, b: v128): v128;
57
- function xor(a: v128, b: v128): v128;
58
- function not(a: v128): v128;
59
- function shuffle<T>(a: v128, b: v128, ...lanes: u8[]): v128;
60
- function swizzle(a: v128, s: v128): v128;
61
- }
62
-
63
- /** f64x2 SIMD namespace (2 x f64 packed into v128) */
64
- declare namespace f64x2 {
65
- function splat(value: f64): v128;
66
- function extract_lane(vec: v128, idx: 0 | 1): f64;
67
- function replace_lane(vec: v128, idx: 0 | 1, value: f64): v128;
68
- function add(a: v128, b: v128): v128;
69
- function sub(a: v128, b: v128): v128;
70
- function mul(a: v128, b: v128): v128;
71
- function div(a: v128, b: v128): v128;
72
- function neg(a: v128): v128;
73
- function abs(a: v128): v128;
74
- function sqrt(a: v128): v128;
75
- function min(a: v128, b: v128): v128;
76
- function max(a: v128, b: v128): v128;
77
- }
78
-
79
- // AssemblyScript type cast functions (e.g., f64(intValue) converts i32 to f64)
80
- declare function f64(value: number): number;
81
- declare function i32(value: number): number;
82
- declare function i64(value: number): number;
83
- declare function u32(value: number): number;
84
-
85
- // AssemblyScript builtins
86
- declare function unchecked<T>(expr: T): T;
87
- declare function changetype<T>(value: unknown): T;
88
- declare function isFinite<T>(value: T): boolean;
89
- declare function isNaN<T>(value: T): boolean;
90
- declare function sizeof<T>(): usize;
91
- declare function assert<T>(value: T, message?: string): T;
92
- declare function idof<T>(): u32;
93
-
94
- // AssemblyScript memory intrinsics
95
- declare function load<T>(ptr: usize, immOffset?: u32): T;
96
- declare function store<T>(ptr: usize, value: T, immOffset?: u32): void;
97
-
98
- declare namespace memory {
99
- function grow(pages: i32): i32;
100
- function size(): i32;
101
- }
1
+ /**
2
+ * Ambient type declarations for AssemblyScript builtins.
3
+ * These types are provided by the AssemblyScript compiler at build time
4
+ * but need declarations for TypeScript type-checking when WASM files
5
+ * are transitively included via imports from src/function/.
6
+ */
7
+
8
+ // AssemblyScript numeric types
9
+ declare type usize = number;
10
+ declare type i64 = number;
11
+ declare type u8 = number;
12
+ declare type u32 = number;
13
+ declare type f32 = number;
14
+
15
+ // f64: type alias + namespace with constants
16
+ declare type f64 = number;
17
+ declare namespace f64 {
18
+ const NaN: f64;
19
+ const POSITIVE_INFINITY: f64;
20
+ const NEGATIVE_INFINITY: f64;
21
+ const MAX_VALUE: f64;
22
+ const MIN_VALUE: f64;
23
+ }
24
+
25
+ // i32: type alias + namespace with builtins
26
+ declare type i32 = number;
27
+ declare namespace i32 {
28
+ function clz(value: i32): i32;
29
+ function ctz(value: i32): i32;
30
+ function rotl(value: i32, shift: i32): i32;
31
+ function rotr(value: i32, shift: i32): i32;
32
+ const MAX_VALUE: i32;
33
+ const MIN_VALUE: i32;
34
+ }
35
+
36
+ /** SIMD 128-bit vector type */
37
+ declare type v128 = object;
38
+
39
+ /** v128 SIMD intrinsics namespace */
40
+ declare namespace v128 {
41
+ function load(ptr: usize, immOffset?: u32, immAlign?: u32): v128;
42
+ function store(ptr: usize, value: v128, immOffset?: u32, immAlign?: u32): void;
43
+ function splat<T>(value: T): v128;
44
+ function extract_lane<T>(vec: v128, idx: u8): T;
45
+ function replace_lane<T>(vec: v128, idx: u8, value: T): v128;
46
+ function add<T>(a: v128, b: v128): v128;
47
+ function sub<T>(a: v128, b: v128): v128;
48
+ function mul<T>(a: v128, b: v128): v128;
49
+ function div<T>(a: v128, b: v128): v128;
50
+ function neg<T>(a: v128): v128;
51
+ function abs<T>(a: v128): v128;
52
+ function sqrt<T>(a: v128): v128;
53
+ function min<T>(a: v128, b: v128): v128;
54
+ function max<T>(a: v128, b: v128): v128;
55
+ function and(a: v128, b: v128): v128;
56
+ function or(a: v128, b: v128): v128;
57
+ function xor(a: v128, b: v128): v128;
58
+ function not(a: v128): v128;
59
+ function shuffle<T>(a: v128, b: v128, ...lanes: u8[]): v128;
60
+ function swizzle(a: v128, s: v128): v128;
61
+ }
62
+
63
+ /** f64x2 SIMD namespace (2 x f64 packed into v128) */
64
+ declare namespace f64x2 {
65
+ function splat(value: f64): v128;
66
+ function extract_lane(vec: v128, idx: 0 | 1): f64;
67
+ function replace_lane(vec: v128, idx: 0 | 1, value: f64): v128;
68
+ function add(a: v128, b: v128): v128;
69
+ function sub(a: v128, b: v128): v128;
70
+ function mul(a: v128, b: v128): v128;
71
+ function div(a: v128, b: v128): v128;
72
+ function neg(a: v128): v128;
73
+ function abs(a: v128): v128;
74
+ function sqrt(a: v128): v128;
75
+ function min(a: v128, b: v128): v128;
76
+ function max(a: v128, b: v128): v128;
77
+ }
78
+
79
+ // AssemblyScript type cast functions (e.g., f64(intValue) converts i32 to f64)
80
+ declare function f64(value: number): number;
81
+ declare function i32(value: number): number;
82
+ declare function i64(value: number): number;
83
+ declare function u32(value: number): number;
84
+
85
+ // AssemblyScript builtins
86
+ declare function unchecked<T>(expr: T): T;
87
+ declare function changetype<T>(value: unknown): T;
88
+ declare function isFinite<T>(value: T): boolean;
89
+ declare function isNaN<T>(value: T): boolean;
90
+ declare function sizeof<T>(): usize;
91
+ declare function assert<T>(value: T, message?: string): T;
92
+ declare function idof<T>(): u32;
93
+
94
+ // AssemblyScript memory intrinsics
95
+ declare function load<T>(ptr: usize, immOffset?: u32): T;
96
+ declare function store<T>(ptr: usize, value: T, immOffset?: u32): void;
97
+
98
+ declare namespace memory {
99
+ function grow(pages: i32): i32;
100
+ function size(): i32;
101
+ }