@danielsimonjr/mathts-functions 0.12.1 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -468,10 +468,11 @@ __export(typed_exports, {
468
468
  });
469
469
 
470
470
  // src/typed/arithmetic.ts
471
- import { mathTyped, Complex, Fraction, BigNumber, Dual } from "@danielsimonjr/mathts-core";
471
+ import { mathTyped as mathTyped2, Complex, Fraction, BigNumber, Dual } from "@danielsimonjr/mathts-core";
472
472
  import { DenseMatrix as DenseMatrix2, backendManager as backendManager2, singularValues } from "@danielsimonjr/mathts-matrix";
473
473
 
474
474
  // src/factories/matrix-bridge.ts
475
+ import { mathTyped } from "@danielsimonjr/mathts-core";
475
476
  import { DenseMatrix, backendManager } from "@danielsimonjr/mathts-matrix";
476
477
  void backendManager.initialize().catch(() => {
477
478
  });
@@ -490,6 +491,29 @@ function matrixIndexSelectors(index) {
490
491
  }
491
492
  return out;
492
493
  }
494
+ function _adaptCallbackArity(callback) {
495
+ const t = mathTyped;
496
+ if (t.isTypedFunction(callback)) {
497
+ let arity;
498
+ return (...args) => {
499
+ if (arity === void 0) {
500
+ for (let k = args.length; k >= 1; k--) {
501
+ if (t.resolve(callback, args.slice(0, k))) {
502
+ arity = k;
503
+ break;
504
+ }
505
+ }
506
+ if (arity === void 0) arity = args.length;
507
+ }
508
+ return callback(...args.slice(0, arity));
509
+ };
510
+ }
511
+ const declared = callback.length;
512
+ if (declared >= 1 && declared < 3) {
513
+ return (...args) => callback(...args.slice(0, declared));
514
+ }
515
+ return callback;
516
+ }
493
517
  var MathJSDenseMatrix = class _MathJSDenseMatrix {
494
518
  _data;
495
519
  _size;
@@ -564,27 +588,38 @@ var MathJSDenseMatrix = class _MathJSDenseMatrix {
564
588
  }
565
589
  /**
566
590
  * Map over all elements, producing a new matrix.
591
+ *
592
+ * Callbacks are invoked ARITY-APPROPRIATELY (mathjs contract): a typed or
593
+ * fixed-arity callback declared as `(value)` or `(value, index)` must not be
594
+ * force-fed 3 arguments — a typed 2-arg expression lambda (`f(x, i) = …`)
595
+ * previously threw "Too many arguments" out of the expression language.
567
596
  */
568
597
  map(callback) {
598
+ const cb = _adaptCallbackArity(callback);
569
599
  if (this._size.length === 1) {
570
- const flat = this._data.map((val, i) => callback(val, [i], this));
571
- const m = new _MathJSDenseMatrix(flat);
572
- m._size = [...this._size];
600
+ const flat = this._data.map(
601
+ (val, i) => cb(val, [i], this)
602
+ );
603
+ const m = new _MathJSDenseMatrix({
604
+ data: flat,
605
+ size: [...this._size]
606
+ });
573
607
  return m;
574
608
  }
575
- const result = this._data.map((row2, i) => row2.map((val, j) => callback(val, [i, j], this)));
609
+ const result = this._data.map((row2, i) => row2.map((val, j) => cb(val, [i, j], this)));
576
610
  return new _MathJSDenseMatrix(result);
577
611
  }
578
612
  /**
579
- * Iterate over all elements.
613
+ * Iterate over all elements (callback invoked arity-appropriately; see map).
580
614
  */
581
615
  forEach(callback) {
616
+ const cb = _adaptCallbackArity(callback);
582
617
  if (this._size.length === 1) {
583
- this._data.forEach((val, i) => callback(val, [i], this));
618
+ this._data.forEach((val, i) => cb(val, [i], this));
584
619
  return;
585
620
  }
586
621
  this._data.forEach((row2, i) => {
587
- row2.forEach((val, j) => callback(val, [i, j], this));
622
+ row2.forEach((val, j) => cb(val, [i, j], this));
588
623
  });
589
624
  }
590
625
  /**
@@ -1333,7 +1368,7 @@ var unitAdd = (a, b) => unitAddSub(a, b, addOp);
1333
1368
  var unitSub = (a, b) => unitAddSub(a, b, (x, y) => subtract(x, y));
1334
1369
  var unitMul = (a, b) => asUnit(a).multiply(b);
1335
1370
  var unitDiv = (a, b) => asUnit(a).divide(b);
1336
- var add = mathTyped("add", {
1371
+ var add = mathTyped2("add", {
1337
1372
  "number, number": (a, b) => a + b,
1338
1373
  "bigint, bigint": (a, b) => a + b,
1339
1374
  "Complex, Complex": (a, b) => a.add(b),
@@ -1385,7 +1420,7 @@ var add = mathTyped("add", {
1385
1420
  return result;
1386
1421
  }
1387
1422
  });
1388
- var subtract = mathTyped("subtract", {
1423
+ var subtract = mathTyped2("subtract", {
1389
1424
  "number, number": (a, b) => a - b,
1390
1425
  "bigint, bigint": (a, b) => a - b,
1391
1426
  "Complex, Complex": (a, b) => a.subtract(b),
@@ -1409,7 +1444,7 @@ var subtract = mathTyped("subtract", {
1409
1444
  return result.result;
1410
1445
  }
1411
1446
  });
1412
- var multiply = mathTyped("multiply", {
1447
+ var multiply = mathTyped2("multiply", {
1413
1448
  "number, number": (a, b) => a * b,
1414
1449
  "bigint, bigint": (a, b) => a * b,
1415
1450
  "Complex, Complex": (a, b) => a.multiply(b),
@@ -1488,7 +1523,7 @@ var multiply = mathTyped("multiply", {
1488
1523
  return result;
1489
1524
  }
1490
1525
  });
1491
- var divide = mathTyped("divide", {
1526
+ var divide = mathTyped2("divide", {
1492
1527
  "number, number": (a, b) => a / b,
1493
1528
  "bigint, bigint": (a, b) => a / b,
1494
1529
  "Complex, Complex": (a, b) => a.divide(b),
@@ -1513,7 +1548,7 @@ var divide = mathTyped("divide", {
1513
1548
  return result.result;
1514
1549
  }
1515
1550
  });
1516
- var unaryMinus = mathTyped("unaryMinus", {
1551
+ var unaryMinus = mathTyped2("unaryMinus", {
1517
1552
  number: (a) => -a,
1518
1553
  bigint: (a) => -a,
1519
1554
  Complex: (a) => a.negate(),
@@ -1525,7 +1560,7 @@ var unaryMinus = mathTyped("unaryMinus", {
1525
1560
  return result.result;
1526
1561
  }
1527
1562
  });
1528
- var unaryPlus = mathTyped("unaryPlus", {
1563
+ var unaryPlus = mathTyped2("unaryPlus", {
1529
1564
  number: (a) => +a,
1530
1565
  bigint: (a) => a,
1531
1566
  Complex: (a) => a,
@@ -1534,7 +1569,7 @@ var unaryPlus = mathTyped("unaryPlus", {
1534
1569
  Float64Array: (a) => a
1535
1570
  // Identity, no copy needed
1536
1571
  });
1537
- var abs = mathTyped("abs", {
1572
+ var abs = mathTyped2("abs", {
1538
1573
  number: (a) => Math.abs(a),
1539
1574
  bigint: (a) => a < 0n ? -a : a,
1540
1575
  Complex: (a) => a.abs(),
@@ -1550,7 +1585,7 @@ var abs = mathTyped("abs", {
1550
1585
  return result.result;
1551
1586
  }
1552
1587
  });
1553
- var sign = mathTyped("sign", {
1588
+ var sign = mathTyped2("sign", {
1554
1589
  number: (a) => Math.sign(a),
1555
1590
  bigint: (a) => a > 0n ? 1n : a < 0n ? -1n : 0n,
1556
1591
  Fraction: (a) => new Fraction(BigInt(a.sign()), 1n),
@@ -1571,7 +1606,7 @@ var sign = mathTyped("sign", {
1571
1606
  return out;
1572
1607
  }
1573
1608
  });
1574
- var pow = mathTyped("pow", {
1609
+ var pow = mathTyped2("pow", {
1575
1610
  "number, number": (a, b) => Math.pow(a, b),
1576
1611
  "bigint, bigint": (a, b) => a ** b,
1577
1612
  "Complex, number": (a, b) => a.pow(b),
@@ -1613,7 +1648,7 @@ var pow = mathTyped("pow", {
1613
1648
  return result.toArray();
1614
1649
  }
1615
1650
  });
1616
- var sqrt = mathTyped("sqrt", {
1651
+ var sqrt = mathTyped2("sqrt", {
1617
1652
  number: (a) => {
1618
1653
  if (a < 0) {
1619
1654
  return new Complex(0, Math.sqrt(-a));
@@ -1629,7 +1664,7 @@ var sqrt = mathTyped("sqrt", {
1629
1664
  return result.result;
1630
1665
  }
1631
1666
  });
1632
- var square = mathTyped("square", {
1667
+ var square = mathTyped2("square", {
1633
1668
  number: (a) => a * a,
1634
1669
  bigint: (a) => a * a,
1635
1670
  Complex: (a) => a.multiply(a),
@@ -1642,7 +1677,7 @@ var square = mathTyped("square", {
1642
1677
  return result.result;
1643
1678
  }
1644
1679
  });
1645
- var cube = mathTyped("cube", {
1680
+ var cube = mathTyped2("cube", {
1646
1681
  number: (a) => a * a * a,
1647
1682
  bigint: (a) => a * a * a,
1648
1683
  Complex: (a) => a.multiply(a).multiply(a),
@@ -1660,7 +1695,7 @@ var cube = mathTyped("cube", {
1660
1695
  return out;
1661
1696
  }
1662
1697
  });
1663
- var cbrt = mathTyped("cbrt", {
1698
+ var cbrt = mathTyped2("cbrt", {
1664
1699
  number: (a) => Math.cbrt(a),
1665
1700
  Complex: (a) => a.pow(1 / 3),
1666
1701
  BigNumber: (a) => a.cbrt(),
@@ -1676,12 +1711,12 @@ var cbrt = mathTyped("cbrt", {
1676
1711
  return out;
1677
1712
  }
1678
1713
  });
1679
- var nthRoot = mathTyped("nthRoot", {
1714
+ var nthRoot = mathTyped2("nthRoot", {
1680
1715
  "number, number": (a, n) => Math.pow(a, 1 / n),
1681
1716
  "Complex, number": (a, n) => a.pow(1 / n),
1682
1717
  "BigNumber, number": (a, n) => a.pow(1 / n)
1683
1718
  });
1684
- var exp = mathTyped("exp", {
1719
+ var exp = mathTyped2("exp", {
1685
1720
  number: (a) => Math.exp(a),
1686
1721
  Complex: (a) => a.exp(),
1687
1722
  BigNumber: (a) => a.exp(),
@@ -1694,7 +1729,7 @@ var exp = mathTyped("exp", {
1694
1729
  return result.result;
1695
1730
  }
1696
1731
  });
1697
- var log = mathTyped("log", {
1732
+ var log = mathTyped2("log", {
1698
1733
  number: (a) => Math.log(a),
1699
1734
  Complex: (a) => a.log(),
1700
1735
  BigNumber: (a) => a.ln(),
@@ -1708,7 +1743,7 @@ var log = mathTyped("log", {
1708
1743
  return result.result;
1709
1744
  }
1710
1745
  });
1711
- var log10 = mathTyped("log10", {
1746
+ var log10 = mathTyped2("log10", {
1712
1747
  number: (a) => Math.log10(a),
1713
1748
  Complex: (a) => a.log().divide(Complex.fromNumber(Math.LN10)),
1714
1749
  BigNumber: (a) => a.log10(),
@@ -1725,7 +1760,7 @@ var log10 = mathTyped("log10", {
1725
1760
  return out;
1726
1761
  }
1727
1762
  });
1728
- var log2 = mathTyped("log2", {
1763
+ var log2 = mathTyped2("log2", {
1729
1764
  number: (a) => Math.log2(a),
1730
1765
  Complex: (a) => a.log().divide(Complex.fromNumber(Math.LN2)),
1731
1766
  BigNumber: (a) => a.log2(),
@@ -1742,7 +1777,7 @@ var log2 = mathTyped("log2", {
1742
1777
  return out;
1743
1778
  }
1744
1779
  });
1745
- var log1p = mathTyped("log1p", {
1780
+ var log1p = mathTyped2("log1p", {
1746
1781
  number: (a) => Math.log1p(a),
1747
1782
  // Parallel array log1p
1748
1783
  Float64Array: async (a) => {
@@ -1757,7 +1792,7 @@ var log1p = mathTyped("log1p", {
1757
1792
  return out;
1758
1793
  }
1759
1794
  });
1760
- var expm1 = mathTyped("expm1", {
1795
+ var expm1 = mathTyped2("expm1", {
1761
1796
  number: (a) => Math.expm1(a),
1762
1797
  // Parallel array expm1
1763
1798
  Float64Array: async (a) => {
@@ -1772,7 +1807,7 @@ var expm1 = mathTyped("expm1", {
1772
1807
  return out;
1773
1808
  }
1774
1809
  });
1775
- var round = mathTyped("round", {
1810
+ var round = mathTyped2("round", {
1776
1811
  number: (a) => Math.round(a),
1777
1812
  Fraction: (a) => a.round(),
1778
1813
  BigNumber: (a) => a.round(),
@@ -1792,7 +1827,7 @@ var round = mathTyped("round", {
1792
1827
  return out;
1793
1828
  }
1794
1829
  });
1795
- var floor = mathTyped("floor", {
1830
+ var floor = mathTyped2("floor", {
1796
1831
  number: (a) => Math.floor(a),
1797
1832
  Fraction: (a) => a.floor(),
1798
1833
  BigNumber: (a) => a.floor(),
@@ -1808,7 +1843,7 @@ var floor = mathTyped("floor", {
1808
1843
  return out;
1809
1844
  }
1810
1845
  });
1811
- var ceil = mathTyped("ceil", {
1846
+ var ceil = mathTyped2("ceil", {
1812
1847
  number: (a) => Math.ceil(a),
1813
1848
  Fraction: (a) => a.ceil(),
1814
1849
  BigNumber: (a) => a.ceil(),
@@ -1824,7 +1859,7 @@ var ceil = mathTyped("ceil", {
1824
1859
  return out;
1825
1860
  }
1826
1861
  });
1827
- var fix = mathTyped("fix", {
1862
+ var fix = mathTyped2("fix", {
1828
1863
  number: (a) => Math.trunc(a),
1829
1864
  Fraction: (a) => a.trunc(),
1830
1865
  BigNumber: (a) => a.trunc(),
@@ -1840,13 +1875,13 @@ var fix = mathTyped("fix", {
1840
1875
  return out;
1841
1876
  }
1842
1877
  });
1843
- var mod = mathTyped("mod", {
1878
+ var mod = mathTyped2("mod", {
1844
1879
  "number, number": (a, b) => (a % b + b) % b,
1845
1880
  "bigint, bigint": (a, b) => (a % b + b) % b,
1846
1881
  "Fraction, Fraction": (a, b) => a.mod(b),
1847
1882
  "BigNumber, BigNumber": (a, b) => a.mod(b)
1848
1883
  });
1849
- var gcd = mathTyped("gcd", {
1884
+ var gcd = mathTyped2("gcd", {
1850
1885
  "number, number": (a, b) => {
1851
1886
  a = Math.abs(Math.floor(a));
1852
1887
  b = Math.abs(Math.floor(b));
@@ -1878,7 +1913,7 @@ var gcd = mathTyped("gcd", {
1878
1913
  return x;
1879
1914
  }
1880
1915
  });
1881
- var lcm = mathTyped("lcm", {
1916
+ var lcm = mathTyped2("lcm", {
1882
1917
  "number, number": (a, b) => {
1883
1918
  const g = gcd(a, b);
1884
1919
  return Math.abs(a * b) / g;
@@ -1895,7 +1930,7 @@ var lcm = mathTyped("lcm", {
1895
1930
  return a.abs().multiply(b.abs()).divide(g);
1896
1931
  }
1897
1932
  });
1898
- var xgcd = mathTyped("xgcd", {
1933
+ var xgcd = mathTyped2("xgcd", {
1899
1934
  "number, number": (a, b) => {
1900
1935
  a = Math.floor(a);
1901
1936
  b = Math.floor(b);
@@ -1967,7 +2002,7 @@ function matrixNorm(data, p = "fro") {
1967
2002
  throw new Error(`Unsupported matrix norm p=${String(p)} (use 'fro', 1, 2, or Infinity)`);
1968
2003
  }
1969
2004
  var matrixLike = (m) => m.toArray();
1970
- var norm = mathTyped("norm", {
2005
+ var norm = mathTyped2("norm", {
1971
2006
  number: (a) => Math.abs(a),
1972
2007
  Complex: (a) => a.abs(),
1973
2008
  BigNumber: (a) => a.abs(),
@@ -1994,7 +2029,7 @@ var norm = mathTyped("norm", {
1994
2029
  return Math.sqrt(s);
1995
2030
  }
1996
2031
  });
1997
- var sinh = mathTyped("sinh", {
2032
+ var sinh = mathTyped2("sinh", {
1998
2033
  number: (a) => Math.sinh(a),
1999
2034
  Complex: (a) => a.sinh(),
2000
2035
  BigNumber: (a) => a.sinh(),
@@ -2011,7 +2046,7 @@ var sinh = mathTyped("sinh", {
2011
2046
  return out;
2012
2047
  }
2013
2048
  });
2014
- var cosh = mathTyped("cosh", {
2049
+ var cosh = mathTyped2("cosh", {
2015
2050
  number: (a) => Math.cosh(a),
2016
2051
  Complex: (a) => a.cosh(),
2017
2052
  BigNumber: (a) => a.cosh(),
@@ -2026,7 +2061,7 @@ var cosh = mathTyped("cosh", {
2026
2061
  return out;
2027
2062
  }
2028
2063
  });
2029
- var tanh = mathTyped("tanh", {
2064
+ var tanh = mathTyped2("tanh", {
2030
2065
  number: (a) => Math.tanh(a),
2031
2066
  Complex: (a) => a.tanh(),
2032
2067
  BigNumber: (a) => a.tanh(),
@@ -2043,7 +2078,7 @@ var tanh = mathTyped("tanh", {
2043
2078
  return out;
2044
2079
  }
2045
2080
  });
2046
- var equal = mathTyped("equal", {
2081
+ var equal = mathTyped2("equal", {
2047
2082
  "number, number": (a, b) => a === b,
2048
2083
  "bigint, bigint": (a, b) => a === b,
2049
2084
  "Complex, Complex": (a, b) => a.equals(b),
@@ -2051,42 +2086,42 @@ var equal = mathTyped("equal", {
2051
2086
  "BigNumber, BigNumber": (a, b) => a.equals(b),
2052
2087
  "Unit, Unit": (a, b) => unitSameDimension(a, b) && asUnit(a).value === asUnit(b).value
2053
2088
  });
2054
- var smaller = mathTyped("smaller", {
2089
+ var smaller = mathTyped2("smaller", {
2055
2090
  "number, number": (a, b) => a < b,
2056
2091
  "bigint, bigint": (a, b) => a < b,
2057
2092
  "Fraction, Fraction": (a, b) => a.compare(b) < 0,
2058
2093
  "BigNumber, BigNumber": (a, b) => a.compare(b) < 0,
2059
2094
  "Unit, Unit": (a, b) => unitCmp(a, b) < 0
2060
2095
  });
2061
- var larger = mathTyped("larger", {
2096
+ var larger = mathTyped2("larger", {
2062
2097
  "number, number": (a, b) => a > b,
2063
2098
  "bigint, bigint": (a, b) => a > b,
2064
2099
  "Fraction, Fraction": (a, b) => a.compare(b) > 0,
2065
2100
  "BigNumber, BigNumber": (a, b) => a.compare(b) > 0,
2066
2101
  "Unit, Unit": (a, b) => unitCmp(a, b) > 0
2067
2102
  });
2068
- var smallerEq = mathTyped("smallerEq", {
2103
+ var smallerEq = mathTyped2("smallerEq", {
2069
2104
  "number, number": (a, b) => a <= b,
2070
2105
  "bigint, bigint": (a, b) => a <= b,
2071
2106
  "Fraction, Fraction": (a, b) => a.compare(b) <= 0,
2072
2107
  "BigNumber, BigNumber": (a, b) => a.compare(b) <= 0,
2073
2108
  "Unit, Unit": (a, b) => unitCmp(a, b) <= 0
2074
2109
  });
2075
- var largerEq = mathTyped("largerEq", {
2110
+ var largerEq = mathTyped2("largerEq", {
2076
2111
  "number, number": (a, b) => a >= b,
2077
2112
  "bigint, bigint": (a, b) => a >= b,
2078
2113
  "Fraction, Fraction": (a, b) => a.compare(b) >= 0,
2079
2114
  "BigNumber, BigNumber": (a, b) => a.compare(b) >= 0,
2080
2115
  "Unit, Unit": (a, b) => unitCmp(a, b) >= 0
2081
2116
  });
2082
- var compare = mathTyped("compare", {
2117
+ var compare = mathTyped2("compare", {
2083
2118
  "number, number": (a, b) => a > b ? 1 : a < b ? -1 : 0,
2084
2119
  "bigint, bigint": (a, b) => a > b ? 1 : a < b ? -1 : 0,
2085
2120
  "Fraction, Fraction": (a, b) => a.compare(b),
2086
2121
  "BigNumber, BigNumber": (a, b) => a.compare(b),
2087
2122
  "Unit, Unit": (a, b) => unitCmp(a, b)
2088
2123
  });
2089
- var min = mathTyped("min", {
2124
+ var min = mathTyped2("min", {
2090
2125
  "bigint, bigint": (a, b) => a < b ? a : b,
2091
2126
  "Fraction, Fraction": (a, b) => a.compare(b) < 0 ? a : b,
2092
2127
  "BigNumber, BigNumber": (a, b) => a.compare(b) < 0 ? a : b,
@@ -2105,7 +2140,7 @@ var min = mathTyped("min", {
2105
2140
  return m;
2106
2141
  }
2107
2142
  });
2108
- var max = mathTyped("max", {
2143
+ var max = mathTyped2("max", {
2109
2144
  "bigint, bigint": (a, b) => a > b ? a : b,
2110
2145
  "Fraction, Fraction": (a, b) => a.compare(b) > 0 ? a : b,
2111
2146
  "BigNumber, BigNumber": (a, b) => a.compare(b) > 0 ? a : b,
@@ -2123,7 +2158,7 @@ var max = mathTyped("max", {
2123
2158
  return m;
2124
2159
  }
2125
2160
  });
2126
- var sum = mathTyped("sum", {
2161
+ var sum = mathTyped2("sum", {
2127
2162
  Array: (arr7) => {
2128
2163
  let total = 0;
2129
2164
  for (let i = 0; i < arr7.length; i++) {
@@ -2137,7 +2172,7 @@ var sum = mathTyped("sum", {
2137
2172
  return result.result;
2138
2173
  }
2139
2174
  });
2140
- var mean = mathTyped("mean", {
2175
+ var mean = mathTyped2("mean", {
2141
2176
  Array: (arr7) => {
2142
2177
  if (arr7.length === 0) return NaN;
2143
2178
  let total = 0;
@@ -2175,7 +2210,7 @@ function m2OfArray(arr7) {
2175
2210
  }
2176
2211
  return m2;
2177
2212
  }
2178
- var variance = mathTyped("variance", {
2213
+ var variance = mathTyped2("variance", {
2179
2214
  Array: (arr7) => varianceFromM2(m2OfArray(arr7), arr7.length, "unbiased"),
2180
2215
  "Array, string": (arr7, norm4) => varianceFromM2(m2OfArray(arr7), arr7.length, norm4),
2181
2216
  // Parallel Float64Array variance. computePool returns POPULATION variance
@@ -2189,7 +2224,7 @@ var variance = mathTyped("variance", {
2189
2224
  return varianceFromM2(result.result.variance * a.length, a.length, norm4);
2190
2225
  }
2191
2226
  });
2192
- var std = mathTyped("std", {
2227
+ var std = mathTyped2("std", {
2193
2228
  Array: (arr7) => Math.sqrt(varianceFromM2(m2OfArray(arr7), arr7.length, "unbiased")),
2194
2229
  "Array, string": (arr7, norm4) => Math.sqrt(varianceFromM2(m2OfArray(arr7), arr7.length, norm4)),
2195
2230
  // Parallel Float64Array std — derive from the (renormalized) variance so the
@@ -2205,7 +2240,7 @@ var std = mathTyped("std", {
2205
2240
  );
2206
2241
  }
2207
2242
  });
2208
- var dot = mathTyped("dot", {
2243
+ var dot = mathTyped2("dot", {
2209
2244
  "Array, Array": (a, b) => {
2210
2245
  if (a.length !== b.length) {
2211
2246
  throw new Error(`Vector lengths must match: ${a.length} vs ${b.length}`);
@@ -2320,9 +2355,9 @@ var typedArithmetic = {
2320
2355
  };
2321
2356
 
2322
2357
  // src/typed/trigonometry.ts
2323
- import { mathTyped as mathTyped2, Complex as Complex2, BigNumber as BigNumber2 } from "@danielsimonjr/mathts-core";
2358
+ import { mathTyped as mathTyped3, Complex as Complex2, BigNumber as BigNumber2 } from "@danielsimonjr/mathts-core";
2324
2359
  import { computePool as computePool2 } from "@danielsimonjr/mathts-parallel";
2325
- var sin = mathTyped2("sin", {
2360
+ var sin = mathTyped3("sin", {
2326
2361
  number: (a) => Math.sin(a),
2327
2362
  Complex: (a) => a.sin(),
2328
2363
  BigNumber: (a) => a.sin(),
@@ -2335,7 +2370,7 @@ var sin = mathTyped2("sin", {
2335
2370
  return result.result;
2336
2371
  }
2337
2372
  });
2338
- var cos = mathTyped2("cos", {
2373
+ var cos = mathTyped3("cos", {
2339
2374
  number: (a) => Math.cos(a),
2340
2375
  Complex: (a) => a.cos(),
2341
2376
  BigNumber: (a) => a.cos(),
@@ -2348,7 +2383,7 @@ var cos = mathTyped2("cos", {
2348
2383
  return result.result;
2349
2384
  }
2350
2385
  });
2351
- var tan = mathTyped2("tan", {
2386
+ var tan = mathTyped3("tan", {
2352
2387
  number: (a) => Math.tan(a),
2353
2388
  Complex: (a) => a.tan(),
2354
2389
  BigNumber: (a) => a.tan(),
@@ -2361,7 +2396,7 @@ var tan = mathTyped2("tan", {
2361
2396
  return result.result;
2362
2397
  }
2363
2398
  });
2364
- var csc = mathTyped2("csc", {
2399
+ var csc = mathTyped3("csc", {
2365
2400
  number: (a) => 1 / Math.sin(a),
2366
2401
  Complex: (a) => a.sin().inverse(),
2367
2402
  BigNumber: (a) => BigNumber2.fromNumber(1).divide(a.sin()),
@@ -2378,7 +2413,7 @@ var csc = mathTyped2("csc", {
2378
2413
  return out;
2379
2414
  }
2380
2415
  });
2381
- var sec = mathTyped2("sec", {
2416
+ var sec = mathTyped3("sec", {
2382
2417
  number: (a) => 1 / Math.cos(a),
2383
2418
  Complex: (a) => a.cos().inverse(),
2384
2419
  BigNumber: (a) => BigNumber2.fromNumber(1).divide(a.cos()),
@@ -2395,7 +2430,7 @@ var sec = mathTyped2("sec", {
2395
2430
  return out;
2396
2431
  }
2397
2432
  });
2398
- var cot = mathTyped2("cot", {
2433
+ var cot = mathTyped3("cot", {
2399
2434
  number: (a) => 1 / Math.tan(a),
2400
2435
  Complex: (a) => a.tan().inverse(),
2401
2436
  BigNumber: (a) => BigNumber2.fromNumber(1).divide(a.tan()),
@@ -2412,7 +2447,7 @@ var cot = mathTyped2("cot", {
2412
2447
  return out;
2413
2448
  }
2414
2449
  });
2415
- var asin = mathTyped2("asin", {
2450
+ var asin = mathTyped3("asin", {
2416
2451
  number: (a) => {
2417
2452
  if (a < -1 || a > 1) {
2418
2453
  return new Complex2(a, 0).asin();
@@ -2432,7 +2467,7 @@ var asin = mathTyped2("asin", {
2432
2467
  return out;
2433
2468
  }
2434
2469
  });
2435
- var acos = mathTyped2("acos", {
2470
+ var acos = mathTyped3("acos", {
2436
2471
  number: (a) => {
2437
2472
  if (a < -1 || a > 1) {
2438
2473
  return new Complex2(a, 0).acos();
@@ -2452,7 +2487,7 @@ var acos = mathTyped2("acos", {
2452
2487
  return out;
2453
2488
  }
2454
2489
  });
2455
- var atan = mathTyped2("atan", {
2490
+ var atan = mathTyped3("atan", {
2456
2491
  number: (a) => Math.atan(a),
2457
2492
  Complex: (a) => a.atan(),
2458
2493
  BigNumber: (a) => a.atan(),
@@ -2469,29 +2504,29 @@ var atan = mathTyped2("atan", {
2469
2504
  return out;
2470
2505
  }
2471
2506
  });
2472
- var atan2 = mathTyped2("atan2", {
2507
+ var atan2 = mathTyped3("atan2", {
2473
2508
  "number, number": (y, x) => Math.atan2(y, x),
2474
2509
  "BigNumber, BigNumber": (y, x) => y.atan2(x)
2475
2510
  });
2476
- var acsc = mathTyped2("acsc", {
2511
+ var acsc = mathTyped3("acsc", {
2477
2512
  number: (a) => Math.asin(1 / a),
2478
2513
  Complex: (a) => a.inverse().asin(),
2479
2514
  // BigNumber: acsc(a) = asin(1/a) — matches the forward csc's BigNumber path.
2480
2515
  BigNumber: (a) => BigNumber2.fromNumber(1).divide(a).asin()
2481
2516
  });
2482
- var asec = mathTyped2("asec", {
2517
+ var asec = mathTyped3("asec", {
2483
2518
  number: (a) => Math.acos(1 / a),
2484
2519
  Complex: (a) => a.inverse().acos(),
2485
2520
  // BigNumber: asec(a) = acos(1/a).
2486
2521
  BigNumber: (a) => BigNumber2.fromNumber(1).divide(a).acos()
2487
2522
  });
2488
- var acot = mathTyped2("acot", {
2523
+ var acot = mathTyped3("acot", {
2489
2524
  number: (a) => Math.atan(1 / a),
2490
2525
  Complex: (a) => a.inverse().atan(),
2491
2526
  // BigNumber: acot(a) = atan(1/a).
2492
2527
  BigNumber: (a) => BigNumber2.fromNumber(1).divide(a).atan()
2493
2528
  });
2494
- var asinh = mathTyped2("asinh", {
2529
+ var asinh = mathTyped3("asinh", {
2495
2530
  number: (a) => Math.asinh(a),
2496
2531
  Complex: (a) => a.asinh(),
2497
2532
  BigNumber: (a) => a.asinh(),
@@ -2506,7 +2541,7 @@ var asinh = mathTyped2("asinh", {
2506
2541
  return out;
2507
2542
  }
2508
2543
  });
2509
- var acosh = mathTyped2("acosh", {
2544
+ var acosh = mathTyped3("acosh", {
2510
2545
  number: (a) => Math.acosh(a),
2511
2546
  Complex: (a) => a.acosh(),
2512
2547
  BigNumber: (a) => a.acosh(),
@@ -2521,7 +2556,7 @@ var acosh = mathTyped2("acosh", {
2521
2556
  return out;
2522
2557
  }
2523
2558
  });
2524
- var atanh = mathTyped2("atanh", {
2559
+ var atanh = mathTyped3("atanh", {
2525
2560
  number: (a) => Math.atanh(a),
2526
2561
  Complex: (a) => a.atanh(),
2527
2562
  BigNumber: (a) => a.atanh(),
@@ -2538,13 +2573,13 @@ var atanh = mathTyped2("atanh", {
2538
2573
  return out;
2539
2574
  }
2540
2575
  });
2541
- var toRadians = mathTyped2("toRadians", {
2576
+ var toRadians = mathTyped3("toRadians", {
2542
2577
  number: (deg) => deg * Math.PI / 180
2543
2578
  });
2544
- var toDegrees = mathTyped2("toDegrees", {
2579
+ var toDegrees = mathTyped3("toDegrees", {
2545
2580
  number: (rad) => rad * 180 / Math.PI
2546
2581
  });
2547
- var hypot = mathTyped2("hypot", {
2582
+ var hypot = mathTyped3("hypot", {
2548
2583
  number: (a) => Math.abs(a),
2549
2584
  "number, number": (a, b) => Math.hypot(a, b),
2550
2585
  "number, number, ...number": (a, b, rest) => Math.hypot(a, b, ...rest),
@@ -2577,12 +2612,12 @@ var typedTrigonometry = {
2577
2612
  };
2578
2613
 
2579
2614
  // src/typed/statistics.ts
2580
- import { mathTyped as mathTyped3 } from "@danielsimonjr/mathts-core";
2615
+ import { mathTyped as mathTyped4 } from "@danielsimonjr/mathts-core";
2581
2616
  import { computePool as computePool3 } from "@danielsimonjr/mathts-parallel";
2582
2617
  function toFloat64Array(arr7) {
2583
2618
  return new Float64Array(arr7);
2584
2619
  }
2585
- var parallelStatSum = mathTyped3("parallelStatSum", {
2620
+ var parallelStatSum = mathTyped4("parallelStatSum", {
2586
2621
  // Float64Array - parallel execution
2587
2622
  Float64Array: async (data) => {
2588
2623
  const result = await computePool3.sum(data);
@@ -2599,7 +2634,7 @@ var parallelStatSum = mathTyped3("parallelStatSum", {
2599
2634
  "number, number, number": (a, b, c) => a + b + c,
2600
2635
  "number, number, number, number": (a, b, c, d) => a + b + c + d
2601
2636
  });
2602
- var parallelStatMean = mathTyped3("parallelStatMean", {
2637
+ var parallelStatMean = mathTyped4("parallelStatMean", {
2603
2638
  // Float64Array - parallel execution
2604
2639
  Float64Array: async (data) => {
2605
2640
  const result = await computePool3.mean(data);
@@ -2617,7 +2652,7 @@ var parallelStatMean = mathTyped3("parallelStatMean", {
2617
2652
  "number, number, number": (a, b, c) => (a + b + c) / 3,
2618
2653
  "number, number, number, number": (a, b, c, d) => (a + b + c + d) / 4
2619
2654
  });
2620
- var parallelStatVariance = mathTyped3("parallelStatVariance", {
2655
+ var parallelStatVariance = mathTyped4("parallelStatVariance", {
2621
2656
  // Float64Array with default normalization (unbiased)
2622
2657
  Float64Array: async (data) => {
2623
2658
  const result = await computePool3.variance(data);
@@ -2664,7 +2699,7 @@ var parallelStatVariance = mathTyped3("parallelStatVariance", {
2664
2699
  return ((a - mean6) ** 2 + (b - mean6) ** 2 + (c - mean6) ** 2) / 2;
2665
2700
  }
2666
2701
  });
2667
- var parallelStatStd = mathTyped3("parallelStatStd", {
2702
+ var parallelStatStd = mathTyped4("parallelStatStd", {
2668
2703
  // Float64Array with default normalization (unbiased)
2669
2704
  Float64Array: async (data) => {
2670
2705
  const result = await computePool3.std(data);
@@ -2690,7 +2725,7 @@ var parallelStatStd = mathTyped3("parallelStatStd", {
2690
2725
  return parallelStatStd(data, normalization);
2691
2726
  }
2692
2727
  });
2693
- var parallelStatMin = mathTyped3("parallelStatMin", {
2728
+ var parallelStatMin = mathTyped4("parallelStatMin", {
2694
2729
  // Float64Array - parallel execution
2695
2730
  Float64Array: async (data) => {
2696
2731
  const result = await computePool3.min(data);
@@ -2710,7 +2745,7 @@ var parallelStatMin = mathTyped3("parallelStatMin", {
2710
2745
  // Four numbers
2711
2746
  "number, number, number, number": (a, b, c, d) => Math.min(a, b, c, d)
2712
2747
  });
2713
- var parallelStatMax = mathTyped3("parallelStatMax", {
2748
+ var parallelStatMax = mathTyped4("parallelStatMax", {
2714
2749
  // Float64Array - parallel execution
2715
2750
  Float64Array: async (data) => {
2716
2751
  const result = await computePool3.max(data);
@@ -2730,7 +2765,7 @@ var parallelStatMax = mathTyped3("parallelStatMax", {
2730
2765
  // Four numbers
2731
2766
  "number, number, number, number": (a, b, c, d) => Math.max(a, b, c, d)
2732
2767
  });
2733
- var parallelStatMinMax = mathTyped3("parallelStatMinMax", {
2768
+ var parallelStatMinMax = mathTyped4("parallelStatMinMax", {
2734
2769
  // Float64Array - parallel execution
2735
2770
  Float64Array: async (data) => {
2736
2771
  const result = await computePool3.minMax(data);
@@ -2743,7 +2778,7 @@ var parallelStatMinMax = mathTyped3("parallelStatMinMax", {
2743
2778
  return result.result;
2744
2779
  }
2745
2780
  });
2746
- var parallelStatMedian = mathTyped3("parallelStatMedian", {
2781
+ var parallelStatMedian = mathTyped4("parallelStatMedian", {
2747
2782
  // Float64Array
2748
2783
  Float64Array: async (data) => {
2749
2784
  const n = data.length;
@@ -2769,7 +2804,7 @@ var parallelStatMedian = mathTyped3("parallelStatMedian", {
2769
2804
  return arr7[1];
2770
2805
  }
2771
2806
  });
2772
- var parallelStatMode = mathTyped3("parallelStatMode", {
2807
+ var parallelStatMode = mathTyped4("parallelStatMode", {
2773
2808
  // Number array
2774
2809
  Array: (arr7) => {
2775
2810
  if (arr7.length === 0) return [];
@@ -2792,7 +2827,7 @@ var parallelStatMode = mathTyped3("parallelStatMode", {
2792
2827
  return parallelStatMode(Array.from(data));
2793
2828
  }
2794
2829
  });
2795
- var parallelStatProd = mathTyped3("parallelStatProd", {
2830
+ var parallelStatProd = mathTyped4("parallelStatProd", {
2796
2831
  // Number array
2797
2832
  Array: (arr7) => {
2798
2833
  if (arr7.length === 0) return 1;
@@ -2819,7 +2854,7 @@ var parallelStatProd = mathTyped3("parallelStatProd", {
2819
2854
  "number, number, number": (a, b, c) => a * b * c,
2820
2855
  "number, number, number, number": (a, b, c, d) => a * b * c * d
2821
2856
  });
2822
- var parallelStatNorm = mathTyped3("parallelStatNorm", {
2857
+ var parallelStatNorm = mathTyped4("parallelStatNorm", {
2823
2858
  // Float64Array - parallel execution
2824
2859
  Float64Array: async (data) => {
2825
2860
  const result = await computePool3.norm(data);
@@ -2872,7 +2907,7 @@ var parallelStatNorm = mathTyped3("parallelStatNorm", {
2872
2907
  return parallelStatNorm(toFloat64Array(arr7), p);
2873
2908
  }
2874
2909
  });
2875
- var parallelStatDistance = mathTyped3("parallelStatDistance", {
2910
+ var parallelStatDistance = mathTyped4("parallelStatDistance", {
2876
2911
  // Float64Array - parallel execution
2877
2912
  "Float64Array, Float64Array": async (a, b) => {
2878
2913
  const result = await computePool3.distance(a, b);
@@ -2888,7 +2923,7 @@ var parallelStatDistance = mathTyped3("parallelStatDistance", {
2888
2923
  return Math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2);
2889
2924
  }
2890
2925
  });
2891
- var parallelStatCorr = mathTyped3("parallelStatCorr", {
2926
+ var parallelStatCorr = mathTyped4("parallelStatCorr", {
2892
2927
  // Float64Array pairs - compute correlation
2893
2928
  "Float64Array, Float64Array": async (x, y) => {
2894
2929
  const n = Math.min(x.length, y.length);
@@ -2912,7 +2947,7 @@ var parallelStatCorr = mathTyped3("parallelStatCorr", {
2912
2947
  return parallelStatCorr(toFloat64Array(x), toFloat64Array(y));
2913
2948
  }
2914
2949
  });
2915
- var parallelStatMAD = mathTyped3("parallelStatMAD", {
2950
+ var parallelStatMAD = mathTyped4("parallelStatMAD", {
2916
2951
  // Float64Array
2917
2952
  Float64Array: async (data) => {
2918
2953
  const n = data.length;
@@ -2930,7 +2965,7 @@ var parallelStatMAD = mathTyped3("parallelStatMAD", {
2930
2965
  return parallelStatMAD(toFloat64Array(arr7));
2931
2966
  }
2932
2967
  });
2933
- var parallelStatCumsum = mathTyped3("parallelStatCumsum", {
2968
+ var parallelStatCumsum = mathTyped4("parallelStatCumsum", {
2934
2969
  // Float64Array
2935
2970
  Float64Array: (data) => {
2936
2971
  const result = new Float64Array(data.length);
@@ -2952,7 +2987,7 @@ var parallelStatCumsum = mathTyped3("parallelStatCumsum", {
2952
2987
  return result;
2953
2988
  }
2954
2989
  });
2955
- var parallelStatQuantile = mathTyped3("parallelStatQuantile", {
2990
+ var parallelStatQuantile = mathTyped4("parallelStatQuantile", {
2956
2991
  // Float64Array with quantile value
2957
2992
  "Float64Array, number": (data, q) => {
2958
2993
  if (q < 0 || q > 1) {
@@ -2982,7 +3017,7 @@ function parallelStatPercentile(data, p) {
2982
3017
  if (p < 0 || p > 100) throw new Error("Percentile must be between 0 and 100");
2983
3018
  return parallelStatQuantile(data, p / 100);
2984
3019
  }
2985
- var parallelStatHistogram = mathTyped3("parallelStatHistogram", {
3020
+ var parallelStatHistogram = mathTyped4("parallelStatHistogram", {
2986
3021
  // Float64Array with number of bins
2987
3022
  "Float64Array, number": async (data, bins) => {
2988
3023
  const result = await computePool3.histogram(data, bins);
@@ -3109,7 +3144,7 @@ async function terminateStatistics() {
3109
3144
  }
3110
3145
 
3111
3146
  // src/typed/signal.ts
3112
- import { mathTyped as mathTyped4 } from "@danielsimonjr/mathts-core";
3147
+ import { mathTyped as mathTyped5 } from "@danielsimonjr/mathts-core";
3113
3148
  import { computePool as computePool4 } from "@danielsimonjr/mathts-parallel";
3114
3149
 
3115
3150
  // src/wasm/signal/wasm-bridge.ts
@@ -3549,7 +3584,7 @@ async function fourStepFFT(real, imag, inverse) {
3549
3584
  }
3550
3585
  return { real: outReal, imag: outImag };
3551
3586
  }
3552
- var parallelFFT = mathTyped4("parallelFFT", {
3587
+ var parallelFFT = mathTyped5("parallelFFT", {
3553
3588
  // FFT of number array
3554
3589
  Array: (signal) => {
3555
3590
  const n = signal.length;
@@ -3575,7 +3610,7 @@ var parallelFFT = mathTyped4("parallelFFT", {
3575
3610
  return { ...result, originalLength: n };
3576
3611
  }
3577
3612
  });
3578
- var parallelIFFT = mathTyped4("parallelIFFT", {
3613
+ var parallelIFFT = mathTyped5("parallelIFFT", {
3579
3614
  // IFFT from real/imag arrays
3580
3615
  "Float64Array, Float64Array": async (real, imag) => {
3581
3616
  return computePool4.shouldParallelize(real.length) ? fourStepFFT(real, imag, true) : fftCoreFloat64(real, imag, true);
@@ -3585,7 +3620,7 @@ var parallelIFFT = mathTyped4("parallelIFFT", {
3585
3620
  return computePool4.shouldParallelize(spectrum.real.length) ? fourStepFFT(spectrum.real, spectrum.imag, true) : fftCoreFloat64(spectrum.real, spectrum.imag, true);
3586
3621
  }
3587
3622
  });
3588
- var parallelFFTMagnitude = mathTyped4("parallelFFTMagnitude", {
3623
+ var parallelFFTMagnitude = mathTyped5("parallelFFTMagnitude", {
3589
3624
  "Float64Array, Float64Array": async (real, imag) => {
3590
3625
  if (computePool4.shouldParallelize(real.length)) {
3591
3626
  const r = await computePool4.applyKernel2(
@@ -3605,7 +3640,7 @@ var parallelFFTMagnitude = mathTyped4("parallelFFTMagnitude", {
3605
3640
  return parallelFFTMagnitude(spectrum.real, spectrum.imag);
3606
3641
  }
3607
3642
  });
3608
- var parallelFFTPower = mathTyped4("parallelFFTPower", {
3643
+ var parallelFFTPower = mathTyped5("parallelFFTPower", {
3609
3644
  "Float64Array, Float64Array": async (real, imag) => {
3610
3645
  if (computePool4.shouldParallelize(real.length)) {
3611
3646
  const r = await computePool4.applyKernel2(real, imag, "(re, im) => re * re + im * im");
@@ -3621,7 +3656,7 @@ var parallelFFTPower = mathTyped4("parallelFFTPower", {
3621
3656
  return parallelFFTPower(spectrum.real, spectrum.imag);
3622
3657
  }
3623
3658
  });
3624
- var parallelConv = mathTyped4("parallelConv", {
3659
+ var parallelConv = mathTyped5("parallelConv", {
3625
3660
  // Convolution of two Float64Arrays
3626
3661
  "Float64Array, Float64Array": async (x, h) => {
3627
3662
  const n = x.length;
@@ -3671,7 +3706,7 @@ var parallelConv = mathTyped4("parallelConv", {
3671
3706
  return parallelConv(new Float64Array(x), new Float64Array(h));
3672
3707
  }
3673
3708
  });
3674
- var parallelXCorr = mathTyped4("parallelXCorr", {
3709
+ var parallelXCorr = mathTyped5("parallelXCorr", {
3675
3710
  "Float64Array, Float64Array": async (x, h) => {
3676
3711
  const hReversed = new Float64Array(h.length);
3677
3712
  for (let i = 0; i < h.length; i++) {
@@ -3683,7 +3718,7 @@ var parallelXCorr = mathTyped4("parallelXCorr", {
3683
3718
  return parallelXCorr(new Float64Array(x), new Float64Array(h));
3684
3719
  }
3685
3720
  });
3686
- var parallelAutoCorr = mathTyped4("parallelAutoCorr", {
3721
+ var parallelAutoCorr = mathTyped5("parallelAutoCorr", {
3687
3722
  Float64Array: async (x) => {
3688
3723
  return parallelXCorr(x, x);
3689
3724
  },
@@ -4444,7 +4479,7 @@ async function terminateSignal() {
4444
4479
  }
4445
4480
 
4446
4481
  // src/typed/bitwise.ts
4447
- import { mathTyped as mathTyped5, BigNumber as BigNumber3 } from "@danielsimonjr/mathts-core";
4482
+ import { mathTyped as mathTyped6, BigNumber as BigNumber3 } from "@danielsimonjr/mathts-core";
4448
4483
  import { computePool as computePool5 } from "@danielsimonjr/mathts-parallel";
4449
4484
 
4450
4485
  // src/wasm/bitwise/wasm-bridge.ts
@@ -4523,7 +4558,7 @@ function logShiftBigInt(x, n) {
4523
4558
  const shifted = masked >> n;
4524
4559
  return shifted >= 0x80000000n ? shifted - 0x100000000n : shifted;
4525
4560
  }
4526
- var bitAnd = mathTyped5("bitAnd", {
4561
+ var bitAnd = mathTyped6("bitAnd", {
4527
4562
  "number, number": (a, b) => {
4528
4563
  if (!Number.isInteger(a) || !Number.isInteger(b)) {
4529
4564
  throw new Error("Integers expected in function bitAnd");
@@ -4553,7 +4588,7 @@ var bitAnd = mathTyped5("bitAnd", {
4553
4588
  a & b
4554
4589
  )
4555
4590
  });
4556
- var bitOr = mathTyped5("bitOr", {
4591
+ var bitOr = mathTyped6("bitOr", {
4557
4592
  "number, number": (a, b) => {
4558
4593
  if (!Number.isInteger(a) || !Number.isInteger(b)) {
4559
4594
  throw new Error("Integers expected in function bitOr");
@@ -4580,7 +4615,7 @@ var bitOr = mathTyped5("bitOr", {
4580
4615
  a | b
4581
4616
  )
4582
4617
  });
4583
- var bitXor = mathTyped5("bitXor", {
4618
+ var bitXor = mathTyped6("bitXor", {
4584
4619
  "number, number": (a, b) => {
4585
4620
  if (!Number.isInteger(a) || !Number.isInteger(b)) {
4586
4621
  throw new Error("Integers expected in function bitXor");
@@ -4607,7 +4642,7 @@ var bitXor = mathTyped5("bitXor", {
4607
4642
  a ^ b
4608
4643
  )
4609
4644
  });
4610
- var bitNot = mathTyped5("bitNot", {
4645
+ var bitNot = mathTyped6("bitNot", {
4611
4646
  number: (a) => {
4612
4647
  if (!Number.isInteger(a)) {
4613
4648
  throw new Error("Integer expected in function bitNot");
@@ -4628,7 +4663,7 @@ var bitNot = mathTyped5("bitNot", {
4628
4663
  return result.result;
4629
4664
  }
4630
4665
  });
4631
- var leftShift = mathTyped5("leftShift", {
4666
+ var leftShift = mathTyped6("leftShift", {
4632
4667
  "number, number": (a, b) => {
4633
4668
  if (!Number.isInteger(a) || !Number.isInteger(b)) {
4634
4669
  throw new Error("Integers expected in function leftShift");
@@ -4664,7 +4699,7 @@ var leftShift = mathTyped5("leftShift", {
4664
4699
  a << b
4665
4700
  )
4666
4701
  });
4667
- var rightArithShift = mathTyped5("rightArithShift", {
4702
+ var rightArithShift = mathTyped6("rightArithShift", {
4668
4703
  "number, number": (a, b) => {
4669
4704
  if (!Number.isInteger(a) || !Number.isInteger(b)) {
4670
4705
  throw new Error("Integers expected in function rightArithShift");
@@ -4700,7 +4735,7 @@ var rightArithShift = mathTyped5("rightArithShift", {
4700
4735
  a >> b
4701
4736
  )
4702
4737
  });
4703
- var rightLogShift = mathTyped5("rightLogShift", {
4738
+ var rightLogShift = mathTyped6("rightLogShift", {
4704
4739
  "number, number": (a, b) => {
4705
4740
  if (!Number.isInteger(a) || !Number.isInteger(b)) {
4706
4741
  throw new Error("Integers expected in function rightLogShift");
@@ -4747,7 +4782,7 @@ var typedBitwise = {
4747
4782
  };
4748
4783
 
4749
4784
  // src/typed/logical.ts
4750
- import { mathTyped as mathTyped6 } from "@danielsimonjr/mathts-core";
4785
+ import { mathTyped as mathTyped7 } from "@danielsimonjr/mathts-core";
4751
4786
  function isTruthyNumber(x) {
4752
4787
  return x !== 0 && !Number.isNaN(x);
4753
4788
  }
@@ -4760,14 +4795,14 @@ function isTruthyComplex(x) {
4760
4795
  function isTruthy(x) {
4761
4796
  return !!x;
4762
4797
  }
4763
- var not = mathTyped6("not", {
4798
+ var not = mathTyped7("not", {
4764
4799
  any: (x) => !isTruthy(x),
4765
4800
  number: (x) => !isTruthyNumber(x),
4766
4801
  bigint: (x) => x === 0n,
4767
4802
  BigNumber: (x) => !isTruthyBigNumber(x),
4768
4803
  Complex: (x) => !isTruthyComplex(x)
4769
4804
  });
4770
- var and = mathTyped6("and", {
4805
+ var and = mathTyped7("and", {
4771
4806
  "any, any": (a, b) => isTruthy(a) && isTruthy(b),
4772
4807
  "number, number": (a, b) => isTruthyNumber(a) && isTruthyNumber(b),
4773
4808
  "bigint, bigint": (a, b) => a !== 0n && b !== 0n,
@@ -4781,7 +4816,7 @@ var and = mathTyped6("and", {
4781
4816
  return isTruthy(a) && isTruthy(b) && restArr.every(isTruthy);
4782
4817
  }
4783
4818
  });
4784
- var or = mathTyped6("or", {
4819
+ var or = mathTyped7("or", {
4785
4820
  "any, any": (a, b) => isTruthy(a) || isTruthy(b),
4786
4821
  "number, number": (a, b) => isTruthyNumber(a) || isTruthyNumber(b),
4787
4822
  "bigint, bigint": (a, b) => a !== 0n || b !== 0n,
@@ -4795,7 +4830,7 @@ var or = mathTyped6("or", {
4795
4830
  return isTruthy(a) || isTruthy(b) || restArr.some(isTruthy);
4796
4831
  }
4797
4832
  });
4798
- var xor = mathTyped6("xor", {
4833
+ var xor = mathTyped7("xor", {
4799
4834
  "any, any": (a, b) => isTruthy(a) !== isTruthy(b),
4800
4835
  "number, number": (a, b) => isTruthyNumber(a) !== isTruthyNumber(b),
4801
4836
  "bigint, bigint": (a, b) => a !== 0n !== (b !== 0n),
@@ -4813,7 +4848,7 @@ var xor = mathTyped6("xor", {
4813
4848
  return result;
4814
4849
  }
4815
4850
  });
4816
- var nullish = mathTyped6("nullish", {
4851
+ var nullish = mathTyped7("nullish", {
4817
4852
  // Concrete numeric types: always return a (never null/undefined)
4818
4853
  "number, any": (a, _b) => a,
4819
4854
  "bigint, any": (a, _b) => a,
@@ -4839,13 +4874,13 @@ var typedLogical = {
4839
4874
  };
4840
4875
 
4841
4876
  // src/typed/complex.ts
4842
- import { mathTyped as mathTyped7, BigNumber as BigNumber5 } from "@danielsimonjr/mathts-core";
4877
+ import { mathTyped as mathTyped8, BigNumber as BigNumber5 } from "@danielsimonjr/mathts-core";
4843
4878
  function deepMapArray(arr7, fn) {
4844
4879
  return arr7.map(
4845
4880
  (item) => Array.isArray(item) ? deepMapArray(item, fn) : fn(item)
4846
4881
  );
4847
4882
  }
4848
- var arg = mathTyped7("arg", {
4883
+ var arg = mathTyped8("arg", {
4849
4884
  number: (x) => Math.atan2(0, x),
4850
4885
  bigint: (x) => {
4851
4886
  if (x > 0n) return 0;
@@ -4861,21 +4896,21 @@ var arg = mathTyped7("arg", {
4861
4896
  Complex: (x) => x.arg(),
4862
4897
  Array: (x) => deepMapArray(x, (item) => arg(item))
4863
4898
  });
4864
- var conj = mathTyped7("conj", {
4899
+ var conj = mathTyped8("conj", {
4865
4900
  number: (x) => x,
4866
4901
  bigint: (x) => x,
4867
4902
  BigNumber: (x) => x,
4868
4903
  Complex: (x) => x.conjugate(),
4869
4904
  Array: (x) => deepMapArray(x, (item) => conj(item))
4870
4905
  });
4871
- var im = mathTyped7("im", {
4906
+ var im = mathTyped8("im", {
4872
4907
  number: (_x) => 0,
4873
4908
  bigint: (_x) => 0,
4874
4909
  BigNumber: (_x) => BigNumber5.fromNumber(0),
4875
4910
  Complex: (x) => x.im,
4876
4911
  Array: (x) => deepMapArray(x, (item) => im(item))
4877
4912
  });
4878
- var re = mathTyped7("re", {
4913
+ var re = mathTyped8("re", {
4879
4914
  number: (x) => x,
4880
4915
  bigint: (x) => x,
4881
4916
  BigNumber: (x) => x,
@@ -4890,7 +4925,7 @@ var typedComplex = {
4890
4925
  };
4891
4926
 
4892
4927
  // src/typed/set.ts
4893
- import { mathTyped as mathTyped8 } from "@danielsimonjr/mathts-core";
4928
+ import { mathTyped as mathTyped9 } from "@danielsimonjr/mathts-core";
4894
4929
  function flattenArray(arr7) {
4895
4930
  const result = [];
4896
4931
  const stack = [...arr7];
@@ -4946,7 +4981,7 @@ function identify(sorted) {
4946
4981
  }
4947
4982
  return result;
4948
4983
  }
4949
- var setUnion = mathTyped8("setUnion", {
4984
+ var setUnion = mathTyped9("setUnion", {
4950
4985
  "Array, Array": (a1, a2) => {
4951
4986
  const b1 = toFlatArray(a1);
4952
4987
  const b2 = toFlatArray(a2);
@@ -4958,7 +4993,7 @@ var setUnion = mathTyped8("setUnion", {
4958
4993
  return [...diff1, ...inter, ...diff2];
4959
4994
  }
4960
4995
  });
4961
- var setIntersect = mathTyped8("setIntersect", {
4996
+ var setIntersect = mathTyped9("setIntersect", {
4962
4997
  "Array, Array": (a1, a2) => {
4963
4998
  const b1 = toFlatArray(a1);
4964
4999
  const b2 = toFlatArray(a2);
@@ -4966,7 +5001,7 @@ var setIntersect = mathTyped8("setIntersect", {
4966
5001
  return _intersect(b1, b2);
4967
5002
  }
4968
5003
  });
4969
- var setDifference = mathTyped8("setDifference", {
5004
+ var setDifference = mathTyped9("setDifference", {
4970
5005
  "Array, Array": (a1, a2) => {
4971
5006
  const b1 = toFlatArray(a1);
4972
5007
  const b2 = toFlatArray(a2);
@@ -4975,7 +5010,7 @@ var setDifference = mathTyped8("setDifference", {
4975
5010
  return _difference(b1, b2);
4976
5011
  }
4977
5012
  });
4978
- var setSymDifference = mathTyped8("setSymDifference", {
5013
+ var setSymDifference = mathTyped9("setSymDifference", {
4979
5014
  "Array, Array": (a1, a2) => {
4980
5015
  const b1 = toFlatArray(a1);
4981
5016
  const b2 = toFlatArray(a2);
@@ -4984,7 +5019,7 @@ var setSymDifference = mathTyped8("setSymDifference", {
4984
5019
  return [..._difference(b1, b2), ..._difference(b2, b1)];
4985
5020
  }
4986
5021
  });
4987
- var setIsSubset = mathTyped8("setIsSubset", {
5022
+ var setIsSubset = mathTyped9("setIsSubset", {
4988
5023
  "Array, Array": (a1, a2) => {
4989
5024
  const b1 = toFlatArray(a1);
4990
5025
  const b2 = toFlatArray(a2);
@@ -5001,7 +5036,7 @@ var setIsSubset = mathTyped8("setIsSubset", {
5001
5036
  return true;
5002
5037
  }
5003
5038
  });
5004
- var setMultiplicity = mathTyped8("setMultiplicity", {
5039
+ var setMultiplicity = mathTyped9("setMultiplicity", {
5005
5040
  "any, Array": (e, a) => {
5006
5041
  const b = toFlatArray(a);
5007
5042
  if (b.length === 0) return 0;
@@ -5012,7 +5047,7 @@ var setMultiplicity = mathTyped8("setMultiplicity", {
5012
5047
  return count2;
5013
5048
  }
5014
5049
  });
5015
- var setPowerset = mathTyped8("setPowerset", {
5050
+ var setPowerset = mathTyped9("setPowerset", {
5016
5051
  Array: (a) => {
5017
5052
  const b = toFlatArray(a).sort(naturalCompare);
5018
5053
  if (b.length === 0) return [];
@@ -5031,7 +5066,7 @@ var setPowerset = mathTyped8("setPowerset", {
5031
5066
  return result;
5032
5067
  }
5033
5068
  });
5034
- var setDistinct = mathTyped8("setDistinct", {
5069
+ var setDistinct = mathTyped9("setDistinct", {
5035
5070
  Array: (a) => {
5036
5071
  const b = toFlatArray(a).sort(naturalCompare);
5037
5072
  if (b.length === 0) return [];
@@ -5044,7 +5079,7 @@ var setDistinct = mathTyped8("setDistinct", {
5044
5079
  return result;
5045
5080
  }
5046
5081
  });
5047
- var setSize = mathTyped8("setSize", {
5082
+ var setSize = mathTyped9("setSize", {
5048
5083
  Array: (a) => toFlatArray(a).length,
5049
5084
  "Array, boolean": (a, unique) => {
5050
5085
  const b = toFlatArray(a);
@@ -5057,7 +5092,7 @@ var setSize = mathTyped8("setSize", {
5057
5092
  return count2;
5058
5093
  }
5059
5094
  });
5060
- var setCartesian = mathTyped8("setCartesian", {
5095
+ var setCartesian = mathTyped9("setCartesian", {
5061
5096
  "Array, Array": (a1, a2) => {
5062
5097
  const b1 = toFlatArray(a1).sort(naturalCompare);
5063
5098
  const b2 = toFlatArray(a2).sort(naturalCompare);
@@ -5109,7 +5144,7 @@ var typedSet = {
5109
5144
  };
5110
5145
 
5111
5146
  // src/typed/special.ts
5112
- import { mathTyped as mathTyped9, Complex as Complex5 } from "@danielsimonjr/mathts-core";
5147
+ import { mathTyped as mathTyped10, Complex as Complex5 } from "@danielsimonjr/mathts-core";
5113
5148
 
5114
5149
  // src/utils/number.ts
5115
5150
  import {
@@ -6864,7 +6899,7 @@ function fresnelSScalar(x) {
6864
6899
  }
6865
6900
  return sign3 * sum3;
6866
6901
  }
6867
- var erfc = mathTyped9("erfc", {
6902
+ var erfc = mathTyped10("erfc", {
6868
6903
  number: erfcScalar,
6869
6904
  Float64Array: (x) => {
6870
6905
  const wasm = elementwiseUnaryDispatch("erfc", x);
@@ -6872,7 +6907,7 @@ var erfc = mathTyped9("erfc", {
6872
6907
  return mapArray(x, erfcScalar, () => kernelSource([_erfSeries, _erfcCF, erfcScalar], "(x) => erfcScalar(x)"));
6873
6908
  }
6874
6909
  });
6875
- var erfi = mathTyped9("erfi", {
6910
+ var erfi = mathTyped10("erfi", {
6876
6911
  number: erfiScalar,
6877
6912
  Float64Array: (x) => mapArray(x, erfiScalar, () => kernelSource([erfiScalar], "(x) => erfiScalar(x)"))
6878
6913
  });
@@ -6892,7 +6927,7 @@ function lgammaComplex(z) {
6892
6927
  const term = zc.add(new Complex5(0.5, 0)).mul(t.log());
6893
6928
  return halfLog2Pi.add(term).sub(t).add(x.log());
6894
6929
  }
6895
- var lgamma = mathTyped9("lgamma", {
6930
+ var lgamma = mathTyped10("lgamma", {
6896
6931
  number: _lgamma,
6897
6932
  Complex: lgammaComplex,
6898
6933
  Float64Array: (x) => {
@@ -6902,7 +6937,7 @@ var lgamma = mathTyped9("lgamma", {
6902
6937
  return mapArray(x, _lgamma, () => kernelSource([_lgamma], "(x) => _lgamma(x)"));
6903
6938
  }
6904
6939
  });
6905
- var beta = mathTyped9("beta", {
6940
+ var beta = mathTyped10("beta", {
6906
6941
  "number, number": betaScalar,
6907
6942
  "Float64Array, number": (a, b) => mapArray(
6908
6943
  a,
@@ -6910,7 +6945,7 @@ var beta = mathTyped9("beta", {
6910
6945
  () => kernelSource([_lgamma, betaScalar], `(a) => betaScalar(a, ${b})`)
6911
6946
  )
6912
6947
  });
6913
- var gammainc = mathTyped9("gammainc", {
6948
+ var gammainc = mathTyped10("gammainc", {
6914
6949
  "number, number": gammaincScalar,
6915
6950
  "number, Float64Array": (a, x) => mapArray(
6916
6951
  x,
@@ -6918,7 +6953,7 @@ var gammainc = mathTyped9("gammainc", {
6918
6953
  () => kernelSource([_lgamma, gammaincScalar], `(x) => gammaincScalar(${a}, x)`)
6919
6954
  )
6920
6955
  });
6921
- var gammaincp = mathTyped9("gammaincp", {
6956
+ var gammaincp = mathTyped10("gammaincp", {
6922
6957
  "number, number": gammaincpScalar,
6923
6958
  "number, Float64Array": (a, x) => mapArray(
6924
6959
  x,
@@ -6926,7 +6961,7 @@ var gammaincp = mathTyped9("gammaincp", {
6926
6961
  () => kernelSource([_lgamma, gammaincScalar, gammaincpScalar], `(x) => gammaincpScalar(${a}, x)`)
6927
6962
  )
6928
6963
  });
6929
- var betainc = mathTyped9("betainc", {
6964
+ var betainc = mathTyped10("betainc", {
6930
6965
  "number, number, number": betaincScalar,
6931
6966
  "number, number, Float64Array": (a, b, x) => mapArray(
6932
6967
  x,
@@ -6934,11 +6969,11 @@ var betainc = mathTyped9("betainc", {
6934
6969
  () => kernelSource([_lgamma, betaincScalar], `(x) => betaincScalar(${a}, ${b}, x)`)
6935
6970
  )
6936
6971
  });
6937
- var digamma = mathTyped9("digamma", {
6972
+ var digamma = mathTyped10("digamma", {
6938
6973
  number: digammaScalar,
6939
6974
  Float64Array: (x) => mapArray(x, digammaScalar, () => kernelSource([digammaScalar], "(x) => digammaScalar(x)"))
6940
6975
  });
6941
- var besselJ0 = mathTyped9("besselJ0", {
6976
+ var besselJ0 = mathTyped10("besselJ0", {
6942
6977
  number: besselJ0Scalar,
6943
6978
  Float64Array: (x) => {
6944
6979
  if (x.length >= WASM_SPECIAL_THRESHOLD) {
@@ -6951,7 +6986,7 @@ var besselJ0 = mathTyped9("besselJ0", {
6951
6986
  );
6952
6987
  }
6953
6988
  });
6954
- var besselJ1 = mathTyped9("besselJ1", {
6989
+ var besselJ1 = mathTyped10("besselJ1", {
6955
6990
  number: besselJ1Scalar,
6956
6991
  Float64Array: (x) => {
6957
6992
  if (x.length >= WASM_SPECIAL_THRESHOLD) {
@@ -6964,7 +6999,7 @@ var besselJ1 = mathTyped9("besselJ1", {
6964
6999
  );
6965
7000
  }
6966
7001
  });
6967
- var besselY0 = mathTyped9("besselY0", {
7002
+ var besselY0 = mathTyped10("besselY0", {
6968
7003
  number: besselY0Scalar,
6969
7004
  Float64Array: (x) => {
6970
7005
  if (x.length >= WASM_SPECIAL_THRESHOLD) {
@@ -6977,7 +7012,7 @@ var besselY0 = mathTyped9("besselY0", {
6977
7012
  );
6978
7013
  }
6979
7014
  });
6980
- var besselY1 = mathTyped9("besselY1", {
7015
+ var besselY1 = mathTyped10("besselY1", {
6981
7016
  number: besselY1Scalar,
6982
7017
  Float64Array: (x) => {
6983
7018
  if (x.length >= WASM_SPECIAL_THRESHOLD) {
@@ -6990,7 +7025,7 @@ var besselY1 = mathTyped9("besselY1", {
6990
7025
  );
6991
7026
  }
6992
7027
  });
6993
- var besselJ = mathTyped9("besselJ", {
7028
+ var besselJ = mathTyped10("besselJ", {
6994
7029
  "number, number": besselJScalar,
6995
7030
  "number, Float64Array": (n, x) => {
6996
7031
  if (x.length >= WASM_SPECIAL_THRESHOLD) {
@@ -7006,7 +7041,7 @@ var besselJ = mathTyped9("besselJ", {
7006
7041
  );
7007
7042
  }
7008
7043
  });
7009
- var besselY = mathTyped9("besselY", {
7044
+ var besselY = mathTyped10("besselY", {
7010
7045
  "number, number": besselYScalar,
7011
7046
  "number, Float64Array": (n, x) => {
7012
7047
  if (x.length >= WASM_SPECIAL_THRESHOLD) {
@@ -7022,7 +7057,7 @@ var besselY = mathTyped9("besselY", {
7022
7057
  );
7023
7058
  }
7024
7059
  });
7025
- var besselI = mathTyped9("besselI", {
7060
+ var besselI = mathTyped10("besselI", {
7026
7061
  "number, number": besselIScalar,
7027
7062
  "number, Float64Array": (n, x) => mapArray(
7028
7063
  x,
@@ -7030,7 +7065,7 @@ var besselI = mathTyped9("besselI", {
7030
7065
  () => kernelSource([factorial, _lgamma, besselIScalar], `(x) => besselIScalar(${n}, x)`)
7031
7066
  )
7032
7067
  });
7033
- var besselK = mathTyped9("besselK", {
7068
+ var besselK = mathTyped10("besselK", {
7034
7069
  "number, number": besselKScalar,
7035
7070
  "number, Float64Array": (n, x) => mapArray(
7036
7071
  x,
@@ -7041,7 +7076,7 @@ var besselK = mathTyped9("besselK", {
7041
7076
  )
7042
7077
  )
7043
7078
  });
7044
- var ellipticK = mathTyped9("ellipticK", {
7079
+ var ellipticK = mathTyped10("ellipticK", {
7045
7080
  number: ellipticKScalar,
7046
7081
  Float64Array: (m) => {
7047
7082
  if (m.length >= WASM_SPECIAL_THRESHOLD) {
@@ -7054,7 +7089,7 @@ var ellipticK = mathTyped9("ellipticK", {
7054
7089
  );
7055
7090
  }
7056
7091
  });
7057
- var ellipticE = mathTyped9("ellipticE", {
7092
+ var ellipticE = mathTyped10("ellipticE", {
7058
7093
  "number, number": ellipticEScalar,
7059
7094
  number: ellipticECompleteScalar,
7060
7095
  Float64Array: (m) => {
@@ -7068,7 +7103,7 @@ var ellipticE = mathTyped9("ellipticE", {
7068
7103
  );
7069
7104
  }
7070
7105
  });
7071
- var chebyshevT = mathTyped9("chebyshevT", {
7106
+ var chebyshevT = mathTyped10("chebyshevT", {
7072
7107
  "number, number": chebyshevTScalar,
7073
7108
  "number, Float64Array": (n, x) => mapArray(
7074
7109
  x,
@@ -7076,7 +7111,7 @@ var chebyshevT = mathTyped9("chebyshevT", {
7076
7111
  () => kernelSource([chebyshevTScalar], `(x) => chebyshevTScalar(${n}, x)`)
7077
7112
  )
7078
7113
  });
7079
- var hermiteH = mathTyped9("hermiteH", {
7114
+ var hermiteH = mathTyped10("hermiteH", {
7080
7115
  "number, number": hermiteHScalar,
7081
7116
  "number, Float64Array": (n, x) => mapArray(
7082
7117
  x,
@@ -7084,7 +7119,7 @@ var hermiteH = mathTyped9("hermiteH", {
7084
7119
  () => kernelSource([hermiteHScalar], `(x) => hermiteHScalar(${n}, x)`)
7085
7120
  )
7086
7121
  });
7087
- var laguerreL = mathTyped9("laguerreL", {
7122
+ var laguerreL = mathTyped10("laguerreL", {
7088
7123
  "number, number": laguerreLScalar,
7089
7124
  "number, Float64Array": (n, x) => mapArray(
7090
7125
  x,
@@ -7092,7 +7127,7 @@ var laguerreL = mathTyped9("laguerreL", {
7092
7127
  () => kernelSource([laguerreLScalar], `(x) => laguerreLScalar(${n}, x)`)
7093
7128
  )
7094
7129
  });
7095
- var legendreP = mathTyped9("legendreP", {
7130
+ var legendreP = mathTyped10("legendreP", {
7096
7131
  "number, number": legendrePScalar,
7097
7132
  "number, Float64Array": (n, x) => mapArray(
7098
7133
  x,
@@ -7100,11 +7135,11 @@ var legendreP = mathTyped9("legendreP", {
7100
7135
  () => kernelSource([legendrePScalar], `(x) => legendrePScalar(${n}, x)`)
7101
7136
  )
7102
7137
  });
7103
- var lambertW = mathTyped9("lambertW", {
7138
+ var lambertW = mathTyped10("lambertW", {
7104
7139
  number: lambertWScalar,
7105
7140
  Float64Array: (x) => mapArray(x, lambertWScalar, () => kernelSource([lambertWScalar], "(x) => lambertWScalar(x)"))
7106
7141
  });
7107
- var cosIntegral = mathTyped9("cosIntegral", {
7142
+ var cosIntegral = mathTyped10("cosIntegral", {
7108
7143
  number: cosIntegralScalar,
7109
7144
  Float64Array: (x) => mapArray(
7110
7145
  x,
@@ -7112,7 +7147,7 @@ var cosIntegral = mathTyped9("cosIntegral", {
7112
7147
  () => kernelSource([cosIntegralScalar], "(x) => cosIntegralScalar(x)")
7113
7148
  )
7114
7149
  });
7115
- var sinIntegral = mathTyped9("sinIntegral", {
7150
+ var sinIntegral = mathTyped10("sinIntegral", {
7116
7151
  number: sinIntegralScalar,
7117
7152
  Float64Array: (x) => mapArray(
7118
7153
  x,
@@ -7120,7 +7155,7 @@ var sinIntegral = mathTyped9("sinIntegral", {
7120
7155
  () => kernelSource([sinIntegralScalar], "(x) => sinIntegralScalar(x)")
7121
7156
  )
7122
7157
  });
7123
- var logIntegral = mathTyped9("logIntegral", {
7158
+ var logIntegral = mathTyped10("logIntegral", {
7124
7159
  number: logIntegralScalar,
7125
7160
  Float64Array: (x) => mapArray(
7126
7161
  x,
@@ -7128,7 +7163,7 @@ var logIntegral = mathTyped9("logIntegral", {
7128
7163
  () => kernelSource([expIntegralEiScalar, logIntegralScalar], "(x) => logIntegralScalar(x)")
7129
7164
  )
7130
7165
  });
7131
- var expIntegralEi = mathTyped9("expIntegralEi", {
7166
+ var expIntegralEi = mathTyped10("expIntegralEi", {
7132
7167
  number: expIntegralEiScalar,
7133
7168
  Float64Array: (x) => mapArray(
7134
7169
  x,
@@ -7136,15 +7171,15 @@ var expIntegralEi = mathTyped9("expIntegralEi", {
7136
7171
  () => kernelSource([expIntegralEiScalar], "(x) => expIntegralEiScalar(x)")
7137
7172
  )
7138
7173
  });
7139
- var fresnelC = mathTyped9("fresnelC", {
7174
+ var fresnelC = mathTyped10("fresnelC", {
7140
7175
  number: fresnelCScalar,
7141
7176
  Float64Array: (x) => mapArray(x, fresnelCScalar, () => kernelSource([fresnelCScalar], "(x) => fresnelCScalar(x)"))
7142
7177
  });
7143
- var fresnelS = mathTyped9("fresnelS", {
7178
+ var fresnelS = mathTyped10("fresnelS", {
7144
7179
  number: fresnelSScalar,
7145
7180
  Float64Array: (x) => mapArray(x, fresnelSScalar, () => kernelSource([fresnelSScalar], "(x) => fresnelSScalar(x)"))
7146
7181
  });
7147
- var airyAi = mathTyped9("airyAi", {
7182
+ var airyAi = mathTyped10("airyAi", {
7148
7183
  number: airyAiScalar,
7149
7184
  Float64Array: (x) => {
7150
7185
  if (x.length >= WASM_SPECIAL_THRESHOLD) {
@@ -7153,7 +7188,7 @@ var airyAi = mathTyped9("airyAi", {
7153
7188
  return mapArray(x, airyAiScalar, () => kernelSource([airyUCoeffs, airyAsymPQ, airyAiScalar], "(x) => airyAiScalar(x)"));
7154
7189
  }
7155
7190
  });
7156
- var airyBi = mathTyped9("airyBi", {
7191
+ var airyBi = mathTyped10("airyBi", {
7157
7192
  number: airyBiScalar,
7158
7193
  Float64Array: (x) => {
7159
7194
  if (x.length >= WASM_SPECIAL_THRESHOLD) {
@@ -7162,49 +7197,49 @@ var airyBi = mathTyped9("airyBi", {
7162
7197
  return mapArray(x, airyBiScalar, () => kernelSource([airyUCoeffs, airyAsymPQ, airyBiScalar], "(x) => airyBiScalar(x)"));
7163
7198
  }
7164
7199
  });
7165
- var carlsonRC = mathTyped9("carlsonRC", {
7200
+ var carlsonRC = mathTyped10("carlsonRC", {
7166
7201
  "number, number": carlsonRCScalar,
7167
7202
  "Float64Array, Float64Array": (xs, ys) => {
7168
7203
  if (xs.length >= WASM_SPECIAL_THRESHOLD) return carlsonRCDispatch(xs, ys);
7169
7204
  return carlsonRCJS(xs, ys);
7170
7205
  }
7171
7206
  });
7172
- var carlsonRF = mathTyped9("carlsonRF", {
7207
+ var carlsonRF = mathTyped10("carlsonRF", {
7173
7208
  "number, number, number": carlsonRFScalar,
7174
7209
  "Float64Array, Float64Array, Float64Array": (xs, ys, zs) => {
7175
7210
  if (xs.length >= WASM_SPECIAL_THRESHOLD) return carlsonRFDispatch(xs, ys, zs);
7176
7211
  return carlsonRFJS(xs, ys, zs);
7177
7212
  }
7178
7213
  });
7179
- var carlsonRD = mathTyped9("carlsonRD", {
7214
+ var carlsonRD = mathTyped10("carlsonRD", {
7180
7215
  "number, number, number": carlsonRDScalar,
7181
7216
  "Float64Array, Float64Array, Float64Array": (xs, ys, zs) => {
7182
7217
  if (xs.length >= WASM_SPECIAL_THRESHOLD) return carlsonRDDispatch(xs, ys, zs);
7183
7218
  return carlsonRDJS(xs, ys, zs);
7184
7219
  }
7185
7220
  });
7186
- var carlsonRJ = mathTyped9("carlsonRJ", {
7221
+ var carlsonRJ = mathTyped10("carlsonRJ", {
7187
7222
  "number, number, number, number": carlsonRJScalar,
7188
7223
  "Float64Array, Float64Array, Float64Array, Float64Array": (xs, ys, zs, ps) => {
7189
7224
  if (xs.length >= WASM_SPECIAL_THRESHOLD) return carlsonRJDispatch(xs, ys, zs, ps);
7190
7225
  return carlsonRJJS(xs, ys, zs, ps);
7191
7226
  }
7192
7227
  });
7193
- var ellipticF = mathTyped9("ellipticF", {
7228
+ var ellipticF = mathTyped10("ellipticF", {
7194
7229
  "number, number": ellipticFIncompleteScalar,
7195
7230
  "Float64Array, Float64Array": (phis, ms) => {
7196
7231
  if (phis.length >= WASM_SPECIAL_THRESHOLD) return ellipticFIncompleteDispatch(phis, ms);
7197
7232
  return ellipticFIncompleteJS(phis, ms);
7198
7233
  }
7199
7234
  });
7200
- var ellipticEIncomplete = mathTyped9("ellipticEIncomplete", {
7235
+ var ellipticEIncomplete = mathTyped10("ellipticEIncomplete", {
7201
7236
  "number, number": ellipticEIncompleteScalar,
7202
7237
  "Float64Array, Float64Array": (phis, ms) => {
7203
7238
  if (phis.length >= WASM_SPECIAL_THRESHOLD) return ellipticEIncompleteDispatch(phis, ms);
7204
7239
  return ellipticEIncompleteJS(phis, ms);
7205
7240
  }
7206
7241
  });
7207
- var ellipticPi = mathTyped9("ellipticPi", {
7242
+ var ellipticPi = mathTyped10("ellipticPi", {
7208
7243
  "number, number, number": ellipticPiIncompleteScalar,
7209
7244
  "Float64Array, Float64Array, Float64Array": (ns, phis, ms) => {
7210
7245
  if (ns.length >= WASM_SPECIAL_THRESHOLD) return ellipticPiIncompleteDispatch(ns, phis, ms);
@@ -7285,7 +7320,7 @@ function fuseUnaryChain(ops, xs) {
7285
7320
  }
7286
7321
 
7287
7322
  // src/typed/distributions.ts
7288
- import { mathTyped as mathTyped10 } from "@danielsimonjr/mathts-core";
7323
+ import { mathTyped as mathTyped11 } from "@danielsimonjr/mathts-core";
7289
7324
  var LN2 = Math.log(2);
7290
7325
  function _lgammaD(x) {
7291
7326
  if (x <= 0 && x === Math.floor(x)) return Infinity;
@@ -7401,7 +7436,7 @@ function bernoulliPMFScalar(k, p) {
7401
7436
  if (k === 0) return 1 - p;
7402
7437
  return NaN;
7403
7438
  }
7404
- var normalPDF = mathTyped10("normalPDF", {
7439
+ var normalPDF = mathTyped11("normalPDF", {
7405
7440
  number: (x) => normalPDFScalar(x, 0, 1),
7406
7441
  "number, number, number": (x, mu, sigma) => normalPDFScalar(x, mu, sigma),
7407
7442
  Float64Array: (x) => mapArray(
@@ -7415,7 +7450,7 @@ var normalPDF = mathTyped10("normalPDF", {
7415
7450
  () => kernelSource([normalPDFScalar], `(x) => normalPDFScalar(x, ${mu}, ${sigma})`)
7416
7451
  )
7417
7452
  });
7418
- var normalCDF = mathTyped10("normalCDF", {
7453
+ var normalCDF = mathTyped11("normalCDF", {
7419
7454
  number: (x) => normalCDFScalar(x, 0, 1),
7420
7455
  "number, number, number": (x, mu, sigma) => normalCDFScalar(x, mu, sigma),
7421
7456
  Float64Array: (x) => mapArray(
@@ -7429,7 +7464,7 @@ var normalCDF = mathTyped10("normalCDF", {
7429
7464
  () => kernelSource([_erfc, normalCDFScalar], `(x) => normalCDFScalar(x, ${mu}, ${sigma})`)
7430
7465
  )
7431
7466
  });
7432
- var exponentialPDF = mathTyped10("exponentialPDF", {
7467
+ var exponentialPDF = mathTyped11("exponentialPDF", {
7433
7468
  "number, number": (x, lambda) => exponentialPDFScalar(x, lambda),
7434
7469
  "Float64Array, number": (x, lambda) => mapArray(
7435
7470
  x,
@@ -7437,7 +7472,7 @@ var exponentialPDF = mathTyped10("exponentialPDF", {
7437
7472
  () => kernelSource([exponentialPDFScalar], `(x) => exponentialPDFScalar(x, ${lambda})`)
7438
7473
  )
7439
7474
  });
7440
- var exponentialCDF = mathTyped10("exponentialCDF", {
7475
+ var exponentialCDF = mathTyped11("exponentialCDF", {
7441
7476
  "number, number": (x, lambda) => exponentialCDFScalar(x, lambda),
7442
7477
  "Float64Array, number": (x, lambda) => mapArray(
7443
7478
  x,
@@ -7445,7 +7480,7 @@ var exponentialCDF = mathTyped10("exponentialCDF", {
7445
7480
  () => kernelSource([exponentialCDFScalar], `(x) => exponentialCDFScalar(x, ${lambda})`)
7446
7481
  )
7447
7482
  });
7448
- var poissonPMF = mathTyped10("poissonPMF", {
7483
+ var poissonPMF = mathTyped11("poissonPMF", {
7449
7484
  "number, number": (k, lambda) => poissonPMFScalar(k, lambda),
7450
7485
  "Float64Array, number": (k, lambda) => mapArray(
7451
7486
  k,
@@ -7453,7 +7488,7 @@ var poissonPMF = mathTyped10("poissonPMF", {
7453
7488
  () => kernelSource([_logFactorial, poissonPMFScalar], `(k) => poissonPMFScalar(k, ${lambda})`)
7454
7489
  )
7455
7490
  });
7456
- var binomialPMF = mathTyped10("binomialPMF", {
7491
+ var binomialPMF = mathTyped11("binomialPMF", {
7457
7492
  "number, number, number": (k, n, p) => binomialPMFScalar(k, n, p),
7458
7493
  "Float64Array, number, number": (k, n, p) => mapArray(
7459
7494
  k,
@@ -7464,7 +7499,7 @@ var binomialPMF = mathTyped10("binomialPMF", {
7464
7499
  )
7465
7500
  )
7466
7501
  });
7467
- var geometricPMF = mathTyped10("geometricPMF", {
7502
+ var geometricPMF = mathTyped11("geometricPMF", {
7468
7503
  "number, number": (k, p) => geometricPMFScalar(k, p),
7469
7504
  "Float64Array, number": (k, p) => mapArray(
7470
7505
  k,
@@ -7472,7 +7507,7 @@ var geometricPMF = mathTyped10("geometricPMF", {
7472
7507
  () => kernelSource([geometricPMFScalar], `(k) => geometricPMFScalar(k, ${p})`)
7473
7508
  )
7474
7509
  });
7475
- var bernoulliPMF = mathTyped10("bernoulliPMF", {
7510
+ var bernoulliPMF = mathTyped11("bernoulliPMF", {
7476
7511
  "number, number": (k, p) => bernoulliPMFScalar(k, p),
7477
7512
  "Float64Array, number": (k, p) => mapArray(
7478
7513
  k,
@@ -7480,7 +7515,7 @@ var bernoulliPMF = mathTyped10("bernoulliPMF", {
7480
7515
  () => kernelSource([bernoulliPMFScalar], `(k) => bernoulliPMFScalar(k, ${p})`)
7481
7516
  )
7482
7517
  });
7483
- var entropy = mathTyped10("entropy", {
7518
+ var entropy = mathTyped11("entropy", {
7484
7519
  Array: (probs) => {
7485
7520
  let h = 0;
7486
7521
  for (const p of probs) {
@@ -7492,7 +7527,7 @@ var entropy = mathTyped10("entropy", {
7492
7527
  return h;
7493
7528
  }
7494
7529
  });
7495
- var jsDivergence = mathTyped10("jsDivergence", {
7530
+ var jsDivergence = mathTyped11("jsDivergence", {
7496
7531
  "Array, Array": (p, q) => {
7497
7532
  if (p.length !== q.length) return NaN;
7498
7533
  let jsd = 0;
@@ -7513,7 +7548,7 @@ function betaPDFScalar(x, alpha, beta_) {
7513
7548
  const logB = _lgammaD(alpha) + _lgammaD(beta_) - _lgammaD(alpha + beta_);
7514
7549
  return Math.exp((alpha - 1) * Math.log(x) + (beta_ - 1) * Math.log(1 - x) - logB);
7515
7550
  }
7516
- var betaPDF = mathTyped10("betaPDF", {
7551
+ var betaPDF = mathTyped11("betaPDF", {
7517
7552
  "number, number, number": (x, alpha, beta_) => betaPDFScalar(x, alpha, beta_),
7518
7553
  "Float64Array, number, number": (x, alpha, beta_) => {
7519
7554
  const out = new Float64Array(x.length);
@@ -7545,7 +7580,7 @@ function gammaPDFScalar(x, shape, scale) {
7545
7580
  (shape - 1) * Math.log(x) - x / scale - _lgammaD(shape) - shape * Math.log(scale)
7546
7581
  );
7547
7582
  }
7548
- var gammaPDF = mathTyped10("gammaPDF", {
7583
+ var gammaPDF = mathTyped11("gammaPDF", {
7549
7584
  "number, number, number": (x, shape, scale) => gammaPDFScalar(x, shape, scale),
7550
7585
  "Float64Array, number, number": (x, shape, scale) => {
7551
7586
  const out = new Float64Array(x.length);
@@ -7570,7 +7605,7 @@ function studentTPDFScalar(x, df) {
7570
7605
  const logNorm = lgHalfNu1 - lgHalfNu - 0.5 * Math.log(df * Math.PI);
7571
7606
  return Math.exp(logNorm - (df + 1) / 2 * Math.log(1 + x * x / df));
7572
7607
  }
7573
- var studentTPDF = mathTyped10("studentTPDF", {
7608
+ var studentTPDF = mathTyped11("studentTPDF", {
7574
7609
  "number, number": (x, df) => studentTPDFScalar(x, df),
7575
7610
  "Float64Array, number": (x, df) => {
7576
7611
  const out = new Float64Array(x.length);
@@ -7601,7 +7636,7 @@ function noncentralChi2PDFScalar(x, df, ncp) {
7601
7636
  }
7602
7637
  return sum3;
7603
7638
  }
7604
- var noncentralChi2PDF = mathTyped10("noncentralChi2PDF", {
7639
+ var noncentralChi2PDF = mathTyped11("noncentralChi2PDF", {
7605
7640
  "number, number, number": (x, df, ncp) => noncentralChi2PDFScalar(x, df, ncp),
7606
7641
  "Float64Array, number, number": (x, df, ncp) => {
7607
7642
  const out = new Float64Array(x.length);
@@ -11750,8 +11785,8 @@ function solvePDE(pde, domain, bc) {
11750
11785
  }
11751
11786
 
11752
11787
  // src/typed/combinatorics.ts
11753
- import { mathTyped as mathTyped11 } from "@danielsimonjr/mathts-core";
11754
- var fibonacci = mathTyped11("fibonacci", {
11788
+ import { mathTyped as mathTyped12 } from "@danielsimonjr/mathts-core";
11789
+ var fibonacci = mathTyped12("fibonacci", {
11755
11790
  number: (n) => {
11756
11791
  if (n < 0 || !Number.isInteger(n)) {
11757
11792
  throw new Error("fibonacci requires a non-negative integer");
@@ -11780,7 +11815,7 @@ var fibonacci = mathTyped11("fibonacci", {
11780
11815
  return a;
11781
11816
  }
11782
11817
  });
11783
- var lucas = mathTyped11("lucas", {
11818
+ var lucas = mathTyped12("lucas", {
11784
11819
  number: (n) => {
11785
11820
  if (n < 0 || !Number.isInteger(n)) {
11786
11821
  throw new Error("lucas requires a non-negative integer");
@@ -11809,7 +11844,7 @@ var lucas = mathTyped11("lucas", {
11809
11844
  return 2 * b - a;
11810
11845
  }
11811
11846
  });
11812
- var doubleFactorial = mathTyped11("doubleFactorial", {
11847
+ var doubleFactorial = mathTyped12("doubleFactorial", {
11813
11848
  number: (n) => {
11814
11849
  if (!Number.isInteger(n) || n < -1) {
11815
11850
  throw new Error("doubleFactorial requires an integer >= -1");
@@ -11822,7 +11857,7 @@ var doubleFactorial = mathTyped11("doubleFactorial", {
11822
11857
  return result;
11823
11858
  }
11824
11859
  });
11825
- var risingFactorial = mathTyped11("risingFactorial", {
11860
+ var risingFactorial = mathTyped12("risingFactorial", {
11826
11861
  "number, number": (x, n) => {
11827
11862
  if (!Number.isInteger(n) || n < 0) {
11828
11863
  throw new Error("risingFactorial requires a non-negative integer for n");
@@ -11835,7 +11870,7 @@ var risingFactorial = mathTyped11("risingFactorial", {
11835
11870
  return result;
11836
11871
  }
11837
11872
  });
11838
- var fallingFactorial = mathTyped11("fallingFactorial", {
11873
+ var fallingFactorial = mathTyped12("fallingFactorial", {
11839
11874
  "number, number": (x, n) => {
11840
11875
  if (!Number.isInteger(n) || n < 0) {
11841
11876
  throw new Error("fallingFactorial requires a non-negative integer for n");
@@ -11848,7 +11883,7 @@ var fallingFactorial = mathTyped11("fallingFactorial", {
11848
11883
  return result;
11849
11884
  }
11850
11885
  });
11851
- var subfactorial = mathTyped11("subfactorial", {
11886
+ var subfactorial = mathTyped12("subfactorial", {
11852
11887
  number: (n) => {
11853
11888
  if (n < 0 || !Number.isInteger(n)) {
11854
11889
  throw new Error("subfactorial requires a non-negative integer");
@@ -11865,7 +11900,7 @@ var subfactorial = mathTyped11("subfactorial", {
11865
11900
  return prev1;
11866
11901
  }
11867
11902
  });
11868
- var prime = mathTyped11("prime", {
11903
+ var prime = mathTyped12("prime", {
11869
11904
  number: (n) => {
11870
11905
  if (n < 1 || !Number.isInteger(n)) {
11871
11906
  throw new Error("prime requires a positive integer");
@@ -11896,7 +11931,7 @@ function _sieveOfEratosthenes(limit2) {
11896
11931
  }
11897
11932
  return primes;
11898
11933
  }
11899
- var nextPrime = mathTyped11("nextPrime", {
11934
+ var nextPrime = mathTyped12("nextPrime", {
11900
11935
  number: (n) => {
11901
11936
  if (n < 0) throw new Error("nextPrime requires a non-negative number");
11902
11937
  let candidate = Math.floor(n) + 1;
@@ -11917,7 +11952,7 @@ function _isPrime(n) {
11917
11952
  }
11918
11953
  return true;
11919
11954
  }
11920
- var primePi = mathTyped11("primePi", {
11955
+ var primePi = mathTyped12("primePi", {
11921
11956
  number: (n) => {
11922
11957
  if (n < 2) return 0;
11923
11958
  const limit2 = Math.floor(n);
@@ -11925,7 +11960,7 @@ var primePi = mathTyped11("primePi", {
11925
11960
  return sieve.length;
11926
11961
  }
11927
11962
  });
11928
- var primeFactors = mathTyped11("primeFactors", {
11963
+ var primeFactors = mathTyped12("primeFactors", {
11929
11964
  number: (n) => {
11930
11965
  if (n < 2 || !Number.isInteger(n)) {
11931
11966
  throw new Error("primeFactors requires an integer >= 2");
@@ -11942,7 +11977,7 @@ var primeFactors = mathTyped11("primeFactors", {
11942
11977
  return factors;
11943
11978
  }
11944
11979
  });
11945
- var divisors = mathTyped11("divisors", {
11980
+ var divisors = mathTyped12("divisors", {
11946
11981
  number: (n) => {
11947
11982
  if (n < 1 || !Number.isInteger(n)) {
11948
11983
  throw new Error("divisors requires a positive integer");
@@ -11958,7 +11993,7 @@ var divisors = mathTyped11("divisors", {
11958
11993
  return small.concat(large.reverse());
11959
11994
  }
11960
11995
  });
11961
- var eulerPhi = mathTyped11("eulerPhi", {
11996
+ var eulerPhi = mathTyped12("eulerPhi", {
11962
11997
  number: (n) => {
11963
11998
  if (n < 1 || !Number.isInteger(n)) {
11964
11999
  throw new Error("eulerPhi requires a positive integer");
@@ -11975,7 +12010,7 @@ var eulerPhi = mathTyped11("eulerPhi", {
11975
12010
  return result;
11976
12011
  }
11977
12012
  });
11978
- var divisorSigma = mathTyped11("divisorSigma", {
12013
+ var divisorSigma = mathTyped12("divisorSigma", {
11979
12014
  number: (n) => {
11980
12015
  return _divisorSigmaImpl(n, 1);
11981
12016
  },
@@ -11999,7 +12034,7 @@ function _divisorSigmaImpl(n, k) {
11999
12034
  }
12000
12035
  return sum3;
12001
12036
  }
12002
- var carmichaelLambda = mathTyped11("carmichaelLambda", {
12037
+ var carmichaelLambda = mathTyped12("carmichaelLambda", {
12003
12038
  number: (n) => {
12004
12039
  if (n < 1 || !Number.isInteger(n)) {
12005
12040
  throw new Error("carmichaelLambda requires a positive integer");
@@ -12043,7 +12078,7 @@ function _gcd(a, b) {
12043
12078
  function _lcm(a, b) {
12044
12079
  return a / _gcd(a, b) * b;
12045
12080
  }
12046
- var moebiusMu = mathTyped11("moebiusMu", {
12081
+ var moebiusMu = mathTyped12("moebiusMu", {
12047
12082
  number: (n) => {
12048
12083
  if (n < 1 || !Number.isInteger(n)) {
12049
12084
  throw new Error("moebiusMu requires a positive integer");
@@ -12062,7 +12097,7 @@ var moebiusMu = mathTyped11("moebiusMu", {
12062
12097
  return numFactors % 2 === 0 ? 1 : -1;
12063
12098
  }
12064
12099
  });
12065
- var jacobiSymbol = mathTyped11("jacobiSymbol", {
12100
+ var jacobiSymbol = mathTyped12("jacobiSymbol", {
12066
12101
  "number, number": (a, n) => {
12067
12102
  if (n < 1 || !Number.isInteger(n) || n % 2 === 0) {
12068
12103
  throw new Error("jacobiSymbol: n must be a positive odd integer");
@@ -12087,7 +12122,7 @@ var jacobiSymbol = mathTyped11("jacobiSymbol", {
12087
12122
  return nn === 1 ? result : 0;
12088
12123
  }
12089
12124
  });
12090
- var chineseRemainder = mathTyped11("chineseRemainder", {
12125
+ var chineseRemainder = mathTyped12("chineseRemainder", {
12091
12126
  "Array, Array": (remainders, moduli) => {
12092
12127
  if (remainders.length !== moduli.length) {
12093
12128
  throw new Error("chineseRemainder: remainders and moduli must have same length");
@@ -12126,7 +12161,7 @@ function _modInverse(a, m) {
12126
12161
  if (old_r !== 1) return -1;
12127
12162
  return (old_s % m + m) % m;
12128
12163
  }
12129
- var lucasL = mathTyped11("lucasL", {
12164
+ var lucasL = mathTyped12("lucasL", {
12130
12165
  number: (n) => {
12131
12166
  if (n < 0 || !Number.isInteger(n)) {
12132
12167
  throw new Error("lucasL requires a non-negative integer");
@@ -12141,7 +12176,7 @@ var lucasL = mathTyped11("lucasL", {
12141
12176
  return b;
12142
12177
  }
12143
12178
  });
12144
- var partitions = mathTyped11("partitions", {
12179
+ var partitions = mathTyped12("partitions", {
12145
12180
  number: (n) => {
12146
12181
  if (n < 0 || !Number.isInteger(n)) {
12147
12182
  throw new Error("partitions requires a non-negative integer");
@@ -12156,7 +12191,7 @@ var partitions = mathTyped11("partitions", {
12156
12191
  return dp[n];
12157
12192
  }
12158
12193
  });
12159
- var harmonicNumber = mathTyped11("harmonicNumber", {
12194
+ var harmonicNumber = mathTyped12("harmonicNumber", {
12160
12195
  number: (n) => {
12161
12196
  if (n < 1 || !Number.isInteger(n)) {
12162
12197
  throw new Error("harmonicNumber requires a positive integer");
@@ -12168,7 +12203,7 @@ var harmonicNumber = mathTyped11("harmonicNumber", {
12168
12203
  return sum3;
12169
12204
  }
12170
12205
  });
12171
- var integerDigits = mathTyped11("integerDigits", {
12206
+ var integerDigits = mathTyped12("integerDigits", {
12172
12207
  number: (n) => {
12173
12208
  return _integerDigitsImpl(n, 10);
12174
12209
  },
@@ -14215,7 +14250,7 @@ import {
14215
14250
  matrixSqrtm as matrixSqrtmPrimitive,
14216
14251
  DenseMatrix as DenseMatrix3
14217
14252
  } from "@danielsimonjr/mathts-matrix";
14218
- import { mathTyped as mathTyped12 } from "@danielsimonjr/mathts-core";
14253
+ import { mathTyped as mathTyped13 } from "@danielsimonjr/mathts-core";
14219
14254
  import { computePool as computePool11 } from "@danielsimonjr/mathts-parallel";
14220
14255
  function cloneMatrix(A) {
14221
14256
  return A.map((r) => [...r]);
@@ -14845,7 +14880,7 @@ async function solveApprox(A, b, n) {
14845
14880
  }
14846
14881
  return x;
14847
14882
  }
14848
- var pinv = mathTyped12("pinv", {
14883
+ var pinv = mathTyped13("pinv", {
14849
14884
  DenseMatrix: (A) => matrixPinv(A),
14850
14885
  "DenseMatrix, Object": (A, opts) => matrixPinv(A, opts),
14851
14886
  // Array in → Array out (mathjs convention). Previously `pinv([[...]])` threw
@@ -14853,22 +14888,22 @@ var pinv = mathTyped12("pinv", {
14853
14888
  Array: (A) => matrixPinv(DenseMatrix3.fromArray(A)).toArray(),
14854
14889
  "Array, Object": (A, opts) => matrixPinv(DenseMatrix3.fromArray(A), opts).toArray()
14855
14890
  });
14856
- var cond = mathTyped12("cond", {
14891
+ var cond = mathTyped13("cond", {
14857
14892
  Array: (A) => matrixCond(A)
14858
14893
  });
14859
- var norm2 = mathTyped12("norm2", {
14894
+ var norm2 = mathTyped13("norm2", {
14860
14895
  Array: (A) => matrixNorm2(A)
14861
14896
  });
14862
- var normFro = mathTyped12("normFro", {
14897
+ var normFro = mathTyped13("normFro", {
14863
14898
  Array: (A) => matrixNormFro(A)
14864
14899
  });
14865
- var lowRankApprox = mathTyped12("lowRankApprox", {
14900
+ var lowRankApprox = mathTyped13("lowRankApprox", {
14866
14901
  "Array, number": (A, k) => matrixLowRankApprox(A, k)
14867
14902
  });
14868
- var singularValues2 = mathTyped12("singularValues", {
14903
+ var singularValues2 = mathTyped13("singularValues", {
14869
14904
  Array: (A) => matrixSingularValues(A)
14870
14905
  });
14871
- var matrixExpm = mathTyped12("matrixExpm", {
14906
+ var matrixExpm = mathTyped13("matrixExpm", {
14872
14907
  DenseMatrix: (A) => matrixExpmPrimitive(A),
14873
14908
  "DenseMatrix, Object": (A, _opts) => matrixExpmPrimitive(A),
14874
14909
  Array: (A) => {
@@ -14876,7 +14911,7 @@ var matrixExpm = mathTyped12("matrixExpm", {
14876
14911
  return matrixExpmPrimitive(D).toArray();
14877
14912
  }
14878
14913
  });
14879
- var matrixLogm = mathTyped12("matrixLogm", {
14914
+ var matrixLogm = mathTyped13("matrixLogm", {
14880
14915
  DenseMatrix: (A) => matrixLogmPrimitive(A),
14881
14916
  "DenseMatrix, Object": (A, opts) => matrixLogmPrimitive(A, opts),
14882
14917
  Array: (A) => {
@@ -14884,7 +14919,7 @@ var matrixLogm = mathTyped12("matrixLogm", {
14884
14919
  return matrixLogmPrimitive(D).toArray();
14885
14920
  }
14886
14921
  });
14887
- var matrixSqrtm = mathTyped12("matrixSqrtm", {
14922
+ var matrixSqrtm = mathTyped13("matrixSqrtm", {
14888
14923
  DenseMatrix: (A) => matrixSqrtmPrimitive(A),
14889
14924
  "DenseMatrix, Object": (A, opts) => matrixSqrtmPrimitive(A, opts),
14890
14925
  Array: (A) => {
@@ -14919,7 +14954,7 @@ async function gpuScale(a, scalar) {
14919
14954
 
14920
14955
  // src/typed/relational.ts
14921
14956
  import naturalSort from "javascript-natural-sort";
14922
- import { mathTyped as mathTyped13, Complex as Complex6, BigNumber as BigNumber6, Fraction as Fraction2 } from "@danielsimonjr/mathts-core";
14957
+ import { mathTyped as mathTyped14, Complex as Complex6, BigNumber as BigNumber6, Fraction as Fraction2 } from "@danielsimonjr/mathts-core";
14923
14958
  var REL_TOL = 1e-12;
14924
14959
  var ABS_TOL = 1e-15;
14925
14960
  function numbersNearlyEqual(x, y) {
@@ -14967,7 +15002,7 @@ function compareObjects(cmp, x, y) {
14967
15002
  }
14968
15003
  return 0;
14969
15004
  }
14970
- var equalScalar = mathTyped13("equalScalar", {
15005
+ var equalScalar = mathTyped14("equalScalar", {
14971
15006
  "boolean, boolean": (x, y) => x === y,
14972
15007
  "number, number": (x, y) => numbersNearlyEqual(x, y),
14973
15008
  "bigint, bigint": (x, y) => x === y,
@@ -14983,7 +15018,7 @@ var equalScalar = mathTyped13("equalScalar", {
14983
15018
  return JSON.stringify(x) === JSON.stringify(y);
14984
15019
  }
14985
15020
  });
14986
- var unequal = mathTyped13("unequal", {
15021
+ var unequal = mathTyped14("unequal", {
14987
15022
  "any, any": (x, y) => {
14988
15023
  if (x === null) return y !== null;
14989
15024
  if (y === null) return x !== null;
@@ -14992,7 +15027,7 @@ var unequal = mathTyped13("unequal", {
14992
15027
  return !equalScalar(x, y);
14993
15028
  }
14994
15029
  });
14995
- var deepEqual = mathTyped13("deepEqual", {
15030
+ var deepEqual = mathTyped14("deepEqual", {
14996
15031
  "any, any": (x, y) => {
14997
15032
  return _deepEqual(
14998
15033
  x.valueOf ? x.valueOf() : x,
@@ -15012,7 +15047,7 @@ function _deepEqual(x, y) {
15012
15047
  if (Array.isArray(y)) return false;
15013
15048
  return equalScalar(x, y);
15014
15049
  }
15015
- var compareText = mathTyped13("compareText", {
15050
+ var compareText = mathTyped14("compareText", {
15016
15051
  "string, string": (x, y) => {
15017
15052
  return x < y ? -1 : x > y ? 1 : 0;
15018
15053
  },
@@ -15022,12 +15057,12 @@ var compareText = mathTyped13("compareText", {
15022
15057
  return sx < sy ? -1 : sx > sy ? 1 : 0;
15023
15058
  }
15024
15059
  });
15025
- var equalText = mathTyped13("equalText", {
15060
+ var equalText = mathTyped14("equalText", {
15026
15061
  "any, any": (x, y) => {
15027
15062
  return compareText(x, y) === 0;
15028
15063
  }
15029
15064
  });
15030
- var compareNatural = mathTyped13("compareNatural", {
15065
+ var compareNatural = mathTyped14("compareNatural", {
15031
15066
  "any, any": (x, y) => _compareNatural(x, y)
15032
15067
  });
15033
15068
  function _compareNatural(x, y) {
@@ -15102,7 +15137,7 @@ function _numericCompare(x, y) {
15102
15137
  if (Number.isNaN(ny)) return -1;
15103
15138
  return nx > ny ? 1 : nx < ny ? -1 : 0;
15104
15139
  }
15105
- var compareUnits = mathTyped13("compareUnits", {
15140
+ var compareUnits = mathTyped14("compareUnits", {
15106
15141
  "any, any": (x, y) => {
15107
15142
  const ux = x;
15108
15143
  const uy = y;
@@ -15126,7 +15161,7 @@ var typedRelational = {
15126
15161
  };
15127
15162
 
15128
15163
  // src/typed/string.ts
15129
- import { mathTyped as mathTyped14, BigNumber as BigNumber7 } from "@danielsimonjr/mathts-core";
15164
+ import { mathTyped as mathTyped15, BigNumber as BigNumber7 } from "@danielsimonjr/mathts-core";
15130
15165
 
15131
15166
  // src/utils/is.ts
15132
15167
  function isNumber(x) {
@@ -15542,25 +15577,25 @@ function interpolate2(template, values, options) {
15542
15577
  return original;
15543
15578
  });
15544
15579
  }
15545
- var bin = mathTyped14("bin", {
15580
+ var bin = mathTyped15("bin", {
15546
15581
  number: (x) => numberToBase(x, 2),
15547
15582
  "number, number": (x, wordSize) => numberToBase(x, 2, wordSize),
15548
15583
  BigNumber: (x) => bigNumberToBase(x, 2),
15549
15584
  "BigNumber, number": (x, wordSize) => bigNumberToBase(x, 2, wordSize)
15550
15585
  });
15551
- var hex = mathTyped14("hex", {
15586
+ var hex = mathTyped15("hex", {
15552
15587
  number: (x) => numberToBase(x, 16),
15553
15588
  "number, number": (x, wordSize) => numberToBase(x, 16, wordSize),
15554
15589
  BigNumber: (x) => bigNumberToBase(x, 16),
15555
15590
  "BigNumber, number": (x, wordSize) => bigNumberToBase(x, 16, wordSize)
15556
15591
  });
15557
- var oct = mathTyped14("oct", {
15592
+ var oct = mathTyped15("oct", {
15558
15593
  number: (x) => numberToBase(x, 8),
15559
15594
  "number, number": (x, wordSize) => numberToBase(x, 8, wordSize),
15560
15595
  BigNumber: (x) => bigNumberToBase(x, 8),
15561
15596
  "BigNumber, number": (x, wordSize) => bigNumberToBase(x, 8, wordSize)
15562
15597
  });
15563
- var format4 = mathTyped14("format", {
15598
+ var format4 = mathTyped15("format", {
15564
15599
  // Single-arg: format with defaults. For BigNumber, utils/string isBigNumber check
15565
15600
  // may fail (core BigNumber uses .isBigNumber property but not on prototype), so
15566
15601
  // we intercept BigNumber explicitly before delegating to formatValue.
@@ -15588,7 +15623,7 @@ var format4 = mathTyped14("format", {
15588
15623
  return format3(x, options);
15589
15624
  }
15590
15625
  });
15591
- var print = mathTyped14("print", {
15626
+ var print = mathTyped15("print", {
15592
15627
  "string, Object | Array": (template, values) => interpolate2(template, values),
15593
15628
  "string, Object | Array, number | Object": (template, values, options) => interpolate2(template, values, options)
15594
15629
  });
@@ -15601,7 +15636,7 @@ var typedString = {
15601
15636
  };
15602
15637
 
15603
15638
  // src/typed/probability.ts
15604
- import { mathTyped as mathTyped15 } from "@danielsimonjr/mathts-core";
15639
+ import { mathTyped as mathTyped16 } from "@danielsimonjr/mathts-core";
15605
15640
  import seedrandom from "seedrandom";
15606
15641
  function makeRng(seed) {
15607
15642
  return seed === null ? seedrandom() : seedrandom(String(seed));
@@ -15666,13 +15701,13 @@ function combinationsExact(n, k) {
15666
15701
  }
15667
15702
  return Math.round(r);
15668
15703
  }
15669
- var bernoulli = mathTyped15("bernoulli", {
15704
+ var bernoulli = mathTyped16("bernoulli", {
15670
15705
  number: (n) => bernoulliNumber(n)
15671
15706
  });
15672
- var combinations = mathTyped15("combinations", {
15707
+ var combinations = mathTyped16("combinations", {
15673
15708
  "number, number": (n, k) => combinationsExact(n, k)
15674
15709
  });
15675
- var combinationsWithRep = mathTyped15("combinationsWithRep", {
15710
+ var combinationsWithRep = mathTyped16("combinationsWithRep", {
15676
15711
  "number, number": (n, k) => {
15677
15712
  if (!Number.isInteger(n) || n < 1) {
15678
15713
  throw new TypeError(
@@ -15685,7 +15720,7 @@ var combinationsWithRep = mathTyped15("combinationsWithRep", {
15685
15720
  return combinationsExact(n + k - 1, k);
15686
15721
  }
15687
15722
  });
15688
- var multinomial = mathTyped15("multinomial", {
15723
+ var multinomial = mathTyped16("multinomial", {
15689
15724
  Array: (a) => {
15690
15725
  let sum3 = 0;
15691
15726
  let denomLog = 0;
@@ -15701,7 +15736,7 @@ var multinomial = mathTyped15("multinomial", {
15701
15736
  return Math.round(Math.exp(numLog - denomLog));
15702
15737
  }
15703
15738
  });
15704
- var permutations = mathTyped15("permutations", {
15739
+ var permutations = mathTyped16("permutations", {
15705
15740
  number: (n) => {
15706
15741
  if (!Number.isInteger(n) || n < 0) {
15707
15742
  throw new TypeError("Non-negative integer expected in function permutations");
@@ -15727,7 +15762,7 @@ var _rng = makeRng(null);
15727
15762
  function seedProbabilityRng(seed) {
15728
15763
  _rng = makeRng(seed);
15729
15764
  }
15730
- var random = mathTyped15("random", {
15765
+ var random = mathTyped16("random", {
15731
15766
  "": () => _rng(),
15732
15767
  number: (max2) => {
15733
15768
  if (max2 < 0) throw new RangeError("max must be non-negative");
@@ -15738,7 +15773,7 @@ var random = mathTyped15("random", {
15738
15773
  return min2 + _rng() * (max2 - min2);
15739
15774
  }
15740
15775
  });
15741
- var randomInt = mathTyped15("randomInt", {
15776
+ var randomInt = mathTyped16("randomInt", {
15742
15777
  "": () => Math.floor(_rng() * 2),
15743
15778
  number: (max2) => {
15744
15779
  if (!Number.isInteger(max2) || max2 < 1) {
@@ -15753,7 +15788,7 @@ var randomInt = mathTyped15("randomInt", {
15753
15788
  return Math.floor(min2 + _rng() * (max2 - min2));
15754
15789
  }
15755
15790
  });
15756
- var pickRandom = mathTyped15("pickRandom", {
15791
+ var pickRandom = mathTyped16("pickRandom", {
15757
15792
  Array: (arr7) => _pick(arr7, 1, void 0)[0],
15758
15793
  "Array, number": (arr7, n) => _pick(arr7, n, void 0),
15759
15794
  "Array, Array": (arr7, weights) => _pick(arr7, 1, weights)[0],
@@ -15809,13 +15844,13 @@ var typedProbability = {
15809
15844
  };
15810
15845
 
15811
15846
  // src/typed/unit.ts
15812
- import { mathTyped as mathTyped16 } from "@danielsimonjr/mathts-core";
15847
+ import { mathTyped as mathTyped17 } from "@danielsimonjr/mathts-core";
15813
15848
  import { Unit } from "@danielsimonjr/mathts-core";
15814
- var to = mathTyped16("to", {
15849
+ var to = mathTyped17("to", {
15815
15850
  "Unit, string": (value, target) => value.to(target),
15816
15851
  "number, string": (value, target) => new Unit(value, target)
15817
15852
  });
15818
- var toBest = mathTyped16("toBest", {
15853
+ var toBest = mathTyped17("toBest", {
15819
15854
  Unit: (value) => value.toBest()
15820
15855
  });
15821
15856
  var typedUnit = {
@@ -15875,7 +15910,7 @@ import {
15875
15910
  } from "@danielsimonjr/mathts-core";
15876
15911
 
15877
15912
  // src/factories/scope.ts
15878
- import { mathTyped as mathTyped17, Complex as Complex7, Fraction as Fraction3, BigNumber as BigNumber8 } from "@danielsimonjr/mathts-core";
15913
+ import { mathTyped as mathTyped18, Complex as Complex7, Fraction as Fraction3, BigNumber as BigNumber8 } from "@danielsimonjr/mathts-core";
15879
15914
 
15880
15915
  // src/typed/typed-bridge.ts
15881
15916
  import { registerNativeTypes } from "@danielsimonjr/mathts-core";
@@ -15919,7 +15954,7 @@ var DEFAULT_CONFIG = {
15919
15954
 
15920
15955
  // src/factories/scope.ts
15921
15956
  initTypeBridge();
15922
- var typed = mathTyped17;
15957
+ var typed = mathTyped18;
15923
15958
  var extraTypes = [
15924
15959
  // mathjs uses lowercase 'function' in signatures; typed-function registers 'Function'
15925
15960
  {
@@ -16013,7 +16048,7 @@ for (const t of extraTypes) {
16013
16048
  }
16014
16049
  }
16015
16050
  var factoryScope = {
16016
- typed: mathTyped17,
16051
+ typed: mathTyped18,
16017
16052
  config: DEFAULT_CONFIG,
16018
16053
  // Class constructors (uppercase) — factories use `new BigNumber(...)` etc.
16019
16054
  Complex: Complex7,
@@ -39652,6 +39687,33 @@ function numberFactory(name254, value) {
39652
39687
  }
39653
39688
 
39654
39689
  // src/factories/index.ts
39690
+ import {
39691
+ createAndTransform,
39692
+ createBitAndTransform,
39693
+ createBitOrTransform,
39694
+ createColumnTransform,
39695
+ createConcatTransform,
39696
+ createCumSumTransform,
39697
+ createDiffTransform,
39698
+ createFilterTransform,
39699
+ createForEachTransform,
39700
+ createIndexTransform,
39701
+ createMapTransform,
39702
+ createMapSlicesTransform,
39703
+ createMaxTransform,
39704
+ createMeanTransform,
39705
+ createMinTransform,
39706
+ createNullishTransform,
39707
+ createOrTransform,
39708
+ createPrintTransform,
39709
+ createQuantileSeqTransform,
39710
+ createRangeTransform,
39711
+ createRowTransform,
39712
+ createStdTransform,
39713
+ createSubsetTransform,
39714
+ createSumTransform,
39715
+ createVarianceTransform
39716
+ } from "@danielsimonjr/mathts-expression";
39655
39717
  var addScalar = createAddScalar(factoryScope);
39656
39718
  var multiplyScalar = createMultiplyScalar(
39657
39719
  factoryScope
@@ -40455,6 +40517,38 @@ var cumsum = factory_cumsum;
40455
40517
  var ctranspose = factory_ctranspose;
40456
40518
  var createUnit = factory_createUnit;
40457
40519
  Object.assign(_mathWithTransform, factoryScope);
40520
+ {
40521
+ const transformFactories = [
40522
+ createAndTransform,
40523
+ createBitAndTransform,
40524
+ createBitOrTransform,
40525
+ createColumnTransform,
40526
+ createConcatTransform,
40527
+ createCumSumTransform,
40528
+ createDiffTransform,
40529
+ createFilterTransform,
40530
+ createForEachTransform,
40531
+ createIndexTransform,
40532
+ createMapTransform,
40533
+ createMapSlicesTransform,
40534
+ createMaxTransform,
40535
+ createMeanTransform,
40536
+ createMinTransform,
40537
+ createNullishTransform,
40538
+ createOrTransform,
40539
+ createPrintTransform,
40540
+ createQuantileSeqTransform,
40541
+ createRangeTransform,
40542
+ createRowTransform,
40543
+ createStdTransform,
40544
+ createSubsetTransform,
40545
+ createSumTransform,
40546
+ createVarianceTransform
40547
+ ];
40548
+ for (const create of transformFactories) {
40549
+ _mathWithTransform[create.fn] = create(factoryScope);
40550
+ }
40551
+ }
40458
40552
 
40459
40553
  // src/factories/evaluate.ts
40460
40554
  var mathScope = {
@@ -40482,6 +40576,38 @@ var mathScope = {
40482
40576
  true: true,
40483
40577
  false: false
40484
40578
  };
40579
+ {
40580
+ const mwt = factoryScope.mathWithTransform;
40581
+ for (const key of [
40582
+ "and",
40583
+ "bitAnd",
40584
+ "bitOr",
40585
+ "column",
40586
+ "concat",
40587
+ "cumsum",
40588
+ "diff",
40589
+ "filter",
40590
+ "forEach",
40591
+ "index",
40592
+ "map",
40593
+ "mapSlices",
40594
+ "max",
40595
+ "mean",
40596
+ "min",
40597
+ "nullish",
40598
+ "or",
40599
+ "print",
40600
+ "quantileSeq",
40601
+ "range",
40602
+ "row",
40603
+ "std",
40604
+ "subset",
40605
+ "sum",
40606
+ "variance"
40607
+ ]) {
40608
+ if (typeof mwt[key] === "function") mathScope[key] = mwt[key];
40609
+ }
40610
+ }
40485
40611
  var parse = factoryScope.parse;
40486
40612
  var evaluate = createEvaluate(parse, mathScope);
40487
40613
  function compileExpr(expr) {