@danielsimonjr/mathts-functions 0.37.1 → 0.39.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
@@ -3636,9 +3636,9 @@ function applyWindowDispatch(samples, windowName) {
3636
3636
  const wasm = getWasm();
3637
3637
  if (wasm && isAsWasm(wasm)) {
3638
3638
  try {
3639
- const out = withAsF64(wasm, [samples], (mod2, [h]) => {
3640
- mod2["apply_window_f64"](h, wt);
3641
- return asReadReturnedF64(mod2, h);
3639
+ const out = withAsF64(wasm, [samples], (mod3, [h]) => {
3640
+ mod3["apply_window_f64"](h, wt);
3641
+ return asReadReturnedF64(mod3, h);
3642
3642
  });
3643
3643
  if (out && out.length === samples.length) {
3644
3644
  samples.set(out);
@@ -3659,9 +3659,9 @@ function welchPSDDispatch(samples, frameLength, overlap, windowName) {
3659
3659
  const out = withAsF64(
3660
3660
  wasm,
3661
3661
  [samples],
3662
- (mod2, [h]) => asReadReturnedF64(
3663
- mod2,
3664
- mod2["welch_psd_f64"](
3662
+ (mod3, [h]) => asReadReturnedF64(
3663
+ mod3,
3664
+ mod3["welch_psd_f64"](
3665
3665
  h,
3666
3666
  frameLength,
3667
3667
  overlap,
@@ -3685,9 +3685,9 @@ function bartlettPSDDispatch(samples, frameLength) {
3685
3685
  const out = withAsF64(
3686
3686
  wasm,
3687
3687
  [samples],
3688
- (mod2, [h]) => asReadReturnedF64(
3689
- mod2,
3690
- mod2["bartlett_psd_f64"](h, frameLength)
3688
+ (mod3, [h]) => asReadReturnedF64(
3689
+ mod3,
3690
+ mod3["bartlett_psd_f64"](h, frameLength)
3691
3691
  )
3692
3692
  );
3693
3693
  if (out && out.length > 0) return out;
@@ -3706,7 +3706,7 @@ function goertzelDispatch(samples, targetFreq, sampleRate) {
3706
3706
  const r = withAsF64(
3707
3707
  wasm,
3708
3708
  [samples],
3709
- (mod2, [h]) => mod2["goertzel_f64"](
3709
+ (mod3, [h]) => mod3["goertzel_f64"](
3710
3710
  h,
3711
3711
  targetFreq,
3712
3712
  sampleRate
@@ -3728,9 +3728,9 @@ function chirpZTransformDispatch(samples, m, phiStartRe, phiStartIm, phiStepRe,
3728
3728
  const interleaved = withAsF64(
3729
3729
  wasm,
3730
3730
  [samples],
3731
- (mod2, [h]) => asReadReturnedF64(
3732
- mod2,
3733
- mod2["chirp_z_transform_f64"](h, m, phiStartRe, phiStartIm, phiStepRe, phiStepIm)
3731
+ (mod3, [h]) => asReadReturnedF64(
3732
+ mod3,
3733
+ mod3["chirp_z_transform_f64"](h, m, phiStartRe, phiStartIm, phiStepRe, phiStepIm)
3734
3734
  )
3735
3735
  );
3736
3736
  if (interleaved && interleaved.length === 2 * m) {
@@ -3749,6 +3749,139 @@ function chirpZTransformDispatch(samples, m, phiStartRe, phiStartIm, phiStepRe,
3749
3749
  return chirpZTransformJS(samples, m, phiStartRe, phiStartIm, phiStepRe, phiStepIm);
3750
3750
  }
3751
3751
 
3752
+ // src/signal/wavelet-filters.ts
3753
+ var DEC_LO_TABLE = {
3754
+ haar: [0.7071067811865476, 0.7071067811865476],
3755
+ db1: [0.7071067811865476, 0.7071067811865476],
3756
+ db2: [-0.12940952255126037, 0.2241438680420134, 0.8365163037378079, 0.48296291314453416],
3757
+ db3: [
3758
+ 0.03522629188570953,
3759
+ -0.08544127388202666,
3760
+ -0.13501102001025458,
3761
+ 0.45987750211849154,
3762
+ 0.8068915093110925,
3763
+ 0.33267055295008263
3764
+ ],
3765
+ db4: [
3766
+ -0.010597401785069032,
3767
+ 0.0328830116668852,
3768
+ 0.030841381835560764,
3769
+ -0.18703481171909309,
3770
+ -0.027983769416859854,
3771
+ 0.6308807679298589,
3772
+ 0.7148465705529157,
3773
+ 0.2303778133088965
3774
+ ],
3775
+ sym2: [-0.12940952255092145, 0.22414386804185735, 0.836516303737469, 0.48296291314469025],
3776
+ sym3: [
3777
+ 0.035226291882100656,
3778
+ -0.08544127388224149,
3779
+ -0.13501102001039084,
3780
+ 0.4598775021193313,
3781
+ 0.8068915093133388,
3782
+ 0.3326705529509569
3783
+ ],
3784
+ sym4: [
3785
+ -0.07576571478927333,
3786
+ -0.02963552764599851,
3787
+ 0.49761866763201545,
3788
+ 0.8037387518059161,
3789
+ 0.29785779560527736,
3790
+ -0.09921954357684722,
3791
+ -0.012603967262037833,
3792
+ 0.0322231006040427
3793
+ ],
3794
+ coif1: [
3795
+ -0.015655728135791993,
3796
+ -0.07273261951252645,
3797
+ 0.3848648468648578,
3798
+ 0.8525720202116004,
3799
+ 0.3378976624574818,
3800
+ -0.07273261951252645
3801
+ ],
3802
+ coif2: [
3803
+ -720549445520347e-18,
3804
+ -0.0018232088709110323,
3805
+ 0.005611434819368834,
3806
+ 0.02368017194684777,
3807
+ -0.05943441864643109,
3808
+ -0.07648859907828076,
3809
+ 0.4170051844232391,
3810
+ 0.8127236354494135,
3811
+ 0.3861100668227629,
3812
+ -0.0673725547237256,
3813
+ -0.04146493678687178,
3814
+ 0.01638733646320364
3815
+ ]
3816
+ };
3817
+ var SUPPORTED_WAVELETS = Object.keys(DEC_LO_TABLE);
3818
+ function getWaveletFilters(wavelet) {
3819
+ const decLo = DEC_LO_TABLE[wavelet];
3820
+ if (!decLo) {
3821
+ throw new Error(
3822
+ `unsupported wavelet "${wavelet}". Supported families: ${SUPPORTED_WAVELETS.join(", ")}`
3823
+ );
3824
+ }
3825
+ const L = decLo.length;
3826
+ const decHi = new Array(L);
3827
+ for (let k = 0; k < L; k++) {
3828
+ decHi[k] = (k % 2 === 0 ? -1 : 1) * decLo[L - 1 - k];
3829
+ }
3830
+ const recLo = decLo.slice().reverse();
3831
+ const recHi = decHi.slice().reverse();
3832
+ return { decLo, decHi, recLo, recHi };
3833
+ }
3834
+ function mod2(a, m) {
3835
+ const r = a % m;
3836
+ return r < 0 ? r + m : r;
3837
+ }
3838
+ function dwtPeriodization(x, wavelet) {
3839
+ const n = x.length;
3840
+ if (n < 2) throw new Error("signal must have at least 2 samples");
3841
+ const { decLo, decHi } = getWaveletFilters(wavelet);
3842
+ const L = decLo.length;
3843
+ const offset = Math.floor(L / 2);
3844
+ const half = Math.ceil(n / 2);
3845
+ const approx = new Array(half);
3846
+ const detail = new Array(half);
3847
+ for (let i = 0; i < half; i++) {
3848
+ let sa = 0;
3849
+ let sd = 0;
3850
+ for (let k = 0; k < L; k++) {
3851
+ const idx = mod2(2 * i - k + offset, n);
3852
+ const xi = x[idx];
3853
+ sa += decLo[k] * xi;
3854
+ sd += decHi[k] * xi;
3855
+ }
3856
+ approx[i] = sa;
3857
+ detail[i] = sd;
3858
+ }
3859
+ return { approx, detail };
3860
+ }
3861
+ function idwtPeriodization(approx, detail, wavelet) {
3862
+ if (approx.length !== detail.length) {
3863
+ throw new Error("approx and detail must have equal length");
3864
+ }
3865
+ const { recLo, recHi } = getWaveletFilters(wavelet);
3866
+ const half = approx.length;
3867
+ const n = half * 2;
3868
+ const L = recLo.length;
3869
+ const shift = Math.floor(L / 2) - 1;
3870
+ const x = new Array(n);
3871
+ for (let m = 0; m < n; m++) {
3872
+ let s = 0;
3873
+ for (let k = 0; k < L; k++) {
3874
+ const idx = mod2(m - k + shift, n);
3875
+ if (idx % 2 === 0) {
3876
+ const j = idx / 2;
3877
+ s += recLo[k] * approx[j] + recHi[k] * detail[j];
3878
+ }
3879
+ }
3880
+ x[m] = s;
3881
+ }
3882
+ return x;
3883
+ }
3884
+
3752
3885
  // src/typed/signal.ts
3753
3886
  var WASM_THRESHOLD = 64;
3754
3887
  function isPowerOf22(n) {
@@ -4182,7 +4315,11 @@ function dwt(x, wavelet = "haar") {
4182
4315
  }
4183
4316
  return { approx, detail };
4184
4317
  } else {
4185
- throw new Error(`dwt: unsupported wavelet "${wavelet}"`);
4318
+ try {
4319
+ return dwtPeriodization(x, wavelet);
4320
+ } catch (err) {
4321
+ throw new Error(`dwt: ${err instanceof Error ? err.message : String(err)}`);
4322
+ }
4186
4323
  }
4187
4324
  }
4188
4325
  async function fft2d(x) {
@@ -4737,9 +4874,9 @@ function runBinaryBitwiseWasm(op, a, b) {
4737
4874
  const n = a.length;
4738
4875
  const names = BINARY_OPS[op];
4739
4876
  try {
4740
- return withAsI32(wasm, [a, b, new Int32Array(n)], (mod2, [ha, hb, hr]) => {
4741
- mod2[names.as](ha, hb, hr);
4742
- return asReadReturnedI32(mod2, hr);
4877
+ return withAsI32(wasm, [a, b, new Int32Array(n)], (mod3, [ha, hb, hr]) => {
4878
+ mod3[names.as](ha, hb, hr);
4879
+ return asReadReturnedI32(mod3, hr);
4743
4880
  });
4744
4881
  } catch {
4745
4882
  return null;
@@ -4751,9 +4888,9 @@ function runUnaryBitwiseWasm(op, a) {
4751
4888
  const n = a.length;
4752
4889
  const names = UNARY_OPS[op];
4753
4890
  try {
4754
- return withAsI32(wasm, [a, new Int32Array(n)], (mod2, [ha, hr]) => {
4755
- mod2[names.as](ha, hr);
4756
- return asReadReturnedI32(mod2, hr);
4891
+ return withAsI32(wasm, [a, new Int32Array(n)], (mod3, [ha, hr]) => {
4892
+ mod3[names.as](ha, hr);
4893
+ return asReadReturnedI32(mod3, hr);
4757
4894
  });
4758
4895
  } catch {
4759
4896
  return null;
@@ -6479,7 +6616,7 @@ function besselOrderDispatch(order, xs, asName, js) {
6479
6616
  const out = withAsF64(
6480
6617
  wasm,
6481
6618
  [xs],
6482
- (mod2, [h]) => asReadReturnedF64(mod2, mod2[asName](order, h))
6619
+ (mod3, [h]) => asReadReturnedF64(mod3, mod3[asName](order, h))
6483
6620
  );
6484
6621
  if (out) return out;
6485
6622
  } catch {
@@ -6741,7 +6878,7 @@ function multiArrayDispatch(name254, inputs, js) {
6741
6878
  const out = withAsF64(
6742
6879
  wasm,
6743
6880
  inputs,
6744
- (mod2, headers) => asReadReturnedF64(mod2, mod2[name254](...headers))
6881
+ (mod3, headers) => asReadReturnedF64(mod3, mod3[name254](...headers))
6745
6882
  );
6746
6883
  if (out) return out;
6747
6884
  } catch {
@@ -6876,60 +7013,73 @@ function digammaScalar(x) {
6876
7013
  }
6877
7014
  return result;
6878
7015
  }
6879
- function besselKAsym(nu, x) {
6880
- const mu = 4 * nu * nu;
6881
- let a = 1;
6882
- let xk = 1;
6883
- let sum3 = 1;
6884
- let prevMag = Infinity;
6885
- for (let k = 1; k <= 40; k++) {
6886
- const t1 = 2 * k - 1;
6887
- a = a * (mu - t1 * t1) / (8 * k);
6888
- xk *= x;
6889
- const t = a / xk;
6890
- if (Math.abs(t) > prevMag) break;
6891
- prevMag = Math.abs(t);
6892
- sum3 += t;
6893
- }
6894
- return Math.sqrt(Math.PI / (2 * x)) * Math.exp(-x) * sum3;
6895
- }
6896
- function besselK0Series(x) {
6897
- const z = 0.25 * x * x;
6898
- let t = 1;
6899
- let I0 = 1;
6900
- let h = 0;
6901
- let s = 0;
6902
- for (let k = 1; k <= 80; k++) {
6903
- t *= z / (k * k);
6904
- I0 += t;
6905
- h += 1 / k;
6906
- s += h * t;
6907
- if (k > 2 && t <= I0 * 1e-18) break;
6908
- }
6909
- return -(Math.log(0.5 * x) + 0.5772156649015329) * I0 + s;
6910
- }
6911
- function besselK1Series(x) {
6912
- const z = 0.25 * x * x;
6913
- let w = 1;
6914
- let S1 = 1;
6915
- let hk = 0;
6916
- let hk1 = 1;
6917
- let S2 = (hk + hk1) * 1;
6918
- for (let k = 1; k <= 80; k++) {
6919
- w *= z / (k * (k + 1));
6920
- S1 += w;
6921
- hk += 1 / k;
6922
- hk1 += 1 / (k + 1);
6923
- S2 += (hk + hk1) * w;
6924
- if (k > 2 && w <= S1 * 1e-18) break;
6925
- }
6926
- return 1 / x + 0.5 * x * (Math.log(0.5 * x) + 0.5772156649015329) * S1 - 0.25 * x * S2;
7016
+ function besselK01(x) {
7017
+ const EPS4 = 1e-16;
7018
+ const xi = 1 / x;
7019
+ const xi2 = 2 * xi;
7020
+ let rkmu;
7021
+ let rk1;
7022
+ if (x < 2) {
7023
+ const x2 = 0.5 * x;
7024
+ const d = -Math.log(x2);
7025
+ let ff = -0.5772156649015329 + d;
7026
+ let sum3 = ff;
7027
+ let p = 0.5;
7028
+ let q = 0.5;
7029
+ let c = 1;
7030
+ const dd = x2 * x2;
7031
+ let sum1 = p;
7032
+ for (let i = 1; i <= 1e4; i++) {
7033
+ ff = (i * ff + p + q) / (i * i);
7034
+ c *= dd / i;
7035
+ p /= i;
7036
+ q /= i;
7037
+ const del = c * ff;
7038
+ sum3 += del;
7039
+ sum1 += c * (p - i * ff);
7040
+ if (Math.abs(del) < Math.abs(sum3) * EPS4) break;
7041
+ }
7042
+ rkmu = sum3;
7043
+ rk1 = sum1 * xi2;
7044
+ } else {
7045
+ const a1 = 0.25;
7046
+ let b = 2 * (1 + x);
7047
+ let d = 1 / b;
7048
+ let h = d;
7049
+ let delh = d;
7050
+ let q1 = 0;
7051
+ let q2 = 1;
7052
+ let q = a1;
7053
+ let cc = a1;
7054
+ let a = -a1;
7055
+ let s = 1 + q * delh;
7056
+ for (let i = 2; i <= 1e4; i++) {
7057
+ a -= 2 * (i - 1);
7058
+ cc = -a * cc / i;
7059
+ const qnew = (q1 - b * q2) / a;
7060
+ q1 = q2;
7061
+ q2 = qnew;
7062
+ q += cc * qnew;
7063
+ b += 2;
7064
+ d = 1 / (b + a * d);
7065
+ delh = (b * d - 1) * delh;
7066
+ h += delh;
7067
+ const dels = q * delh;
7068
+ s += dels;
7069
+ if (Math.abs(dels / s) < EPS4) break;
7070
+ }
7071
+ h = a1 * h;
7072
+ rkmu = Math.sqrt(Math.PI / (2 * x)) * Math.exp(-x) / s;
7073
+ rk1 = rkmu * (x + 0.5 - h) * xi;
7074
+ }
7075
+ return [rkmu, rk1];
6927
7076
  }
6928
7077
  function besselKScalar(n, x) {
6929
7078
  const ni = Math.round(Math.abs(n));
6930
7079
  if (x <= 0) return NaN;
6931
- const k0 = x <= 8 ? besselK0Series(x) : besselKAsym(0, x);
6932
- const k1 = x <= 8 ? besselK1Series(x) : besselKAsym(1, x);
7080
+ const k01 = besselK01(x);
7081
+ const k0 = k01[0];
7082
+ const k1 = k01[1];
6933
7083
  if (ni === 0) return k0;
6934
7084
  if (ni === 1) return k1;
6935
7085
  let kPrev = k0;
@@ -7349,10 +7499,7 @@ var besselK = mathTyped10("besselK", {
7349
7499
  "number, Float64Array": (n, x) => mapArray(
7350
7500
  x,
7351
7501
  (v) => besselKScalar(n, v),
7352
- () => kernelSource(
7353
- [besselKAsym, besselK0Series, besselK1Series, besselKScalar],
7354
- `(x) => besselKScalar(${n}, x)`
7355
- )
7502
+ () => kernelSource([besselK01, besselKScalar], `(x) => besselKScalar(${n}, x)`)
7356
7503
  )
7357
7504
  });
7358
7505
  var ellipticK = mathTyped10("ellipticK", {
@@ -9152,7 +9299,7 @@ function polyMulDispatch(a, b) {
9152
9299
  const out = withAsF64(
9153
9300
  wasm,
9154
9301
  [a, b],
9155
- (mod2, [ha, hb]) => asReadReturnedF64(mod2, mod2["poly_mul_f64"](ha, hb))
9302
+ (mod3, [ha, hb]) => asReadReturnedF64(mod3, mod3["poly_mul_f64"](ha, hb))
9156
9303
  );
9157
9304
  if (out) return out;
9158
9305
  } catch {
@@ -9171,9 +9318,9 @@ function polyDivModDispatch(num2, den) {
9171
9318
  const flat = withAsF64(
9172
9319
  wasm,
9173
9320
  [num2, den],
9174
- (mod2, [hn, hd]) => asReadReturnedF64(
9175
- mod2,
9176
- mod2["poly_div_mod_f64"](hn, hd)
9321
+ (mod3, [hn, hd]) => asReadReturnedF64(
9322
+ mod3,
9323
+ mod3["poly_div_mod_f64"](hn, hd)
9177
9324
  )
9178
9325
  );
9179
9326
  if (flat) {
@@ -9274,7 +9421,7 @@ function resultantDispatch(p, q) {
9274
9421
  const r = withAsF64(
9275
9422
  wasm,
9276
9423
  [p, q],
9277
- (mod2, [hp, hq]) => mod2["poly_resultant_f64"](hp, hq)
9424
+ (mod3, [hp, hq]) => mod3["poly_resultant_f64"](hp, hq)
9278
9425
  );
9279
9426
  if (r !== null) return r;
9280
9427
  } catch {
@@ -9292,7 +9439,7 @@ function discriminantDispatch(p) {
9292
9439
  const r = withAsF64(
9293
9440
  wasm,
9294
9441
  [p],
9295
- (mod2, [hp]) => mod2["poly_discriminant_f64"](hp)
9442
+ (mod3, [hp]) => mod3["poly_discriminant_f64"](hp)
9296
9443
  );
9297
9444
  if (r !== null) return r;
9298
9445
  } catch {
@@ -9405,9 +9552,9 @@ function fitDispatch(xs, ys, degree2, asName, jsFallback) {
9405
9552
  const out = withAsF64(
9406
9553
  wasm,
9407
9554
  [xs, ys],
9408
- (mod2, [hx, hy]) => asReadReturnedF64(
9409
- mod2,
9410
- mod2[asName](hx, hy, degree2)
9555
+ (mod3, [hx, hy]) => asReadReturnedF64(
9556
+ mod3,
9557
+ mod3[asName](hx, hy, degree2)
9411
9558
  )
9412
9559
  );
9413
9560
  if (out && out.length === degree2 + 1 && out.every((v) => Number.isFinite(v))) {
@@ -10938,9 +11085,9 @@ function tridiagSolveDispatch(diag2, lower, upper, rhs) {
10938
11085
  const result = withAsF64(
10939
11086
  wasm,
10940
11087
  [diag2, lower, upper, rhs],
10941
- (mod2, [hd, hl, hu, hr]) => asReadReturnedF64(
10942
- mod2,
10943
- mod2["tridiag_solve_f64"](
11088
+ (mod3, [hd, hl, hu, hr]) => asReadReturnedF64(
11089
+ mod3,
11090
+ mod3["tridiag_solve_f64"](
10944
11091
  hd,
10945
11092
  hl,
10946
11093
  hu,
@@ -10979,9 +11126,9 @@ function dividedDifferenceDispatch(xs, ys) {
10979
11126
  const result = withAsF64(
10980
11127
  wasm,
10981
11128
  [xs, ys],
10982
- (mod2, [hx, hy]) => asReadReturnedF64(
10983
- mod2,
10984
- mod2["divided_difference_f64"](hx, hy)
11129
+ (mod3, [hx, hy]) => asReadReturnedF64(
11130
+ mod3,
11131
+ mod3["divided_difference_f64"](hx, hy)
10985
11132
  )
10986
11133
  );
10987
11134
  if (result && result.length === n) return result;
@@ -28436,7 +28583,7 @@ var createGcd = /* @__PURE__ */ factory(
28436
28583
  DenseMatrix: DenseMatrix6,
28437
28584
  concat: concat3
28438
28585
  }) => {
28439
- const mod2 = createMod({
28586
+ const mod3 = createMod({
28440
28587
  typed: typed3,
28441
28588
  config: config2,
28442
28589
  round: round2,
@@ -28522,7 +28669,7 @@ var createGcd = /* @__PURE__ */ factory(
28522
28669
  }
28523
28670
  let r;
28524
28671
  while (b !== 0) {
28525
- r = mod2(a, b);
28672
+ r = mod3(a, b);
28526
28673
  a = b;
28527
28674
  b = r;
28528
28675
  }
@@ -28534,7 +28681,7 @@ var createGcd = /* @__PURE__ */ factory(
28534
28681
  }
28535
28682
  const zero = new BigNumber9(0);
28536
28683
  while (!b.isZero()) {
28537
- const r = mod2(a, b);
28684
+ const r = mod3(a, b);
28538
28685
  a = b;
28539
28686
  b = r;
28540
28687
  }
@@ -30305,7 +30452,7 @@ var createInvmod = /* @__PURE__ */ factory(
30305
30452
  xgcd: xgcd2,
30306
30453
  equal: equal2,
30307
30454
  smaller: smaller2,
30308
- mod: mod2,
30455
+ mod: mod3,
30309
30456
  add: add3,
30310
30457
  isInteger: isInteger3
30311
30458
  }) => {
@@ -30316,13 +30463,13 @@ var createInvmod = /* @__PURE__ */ factory(
30316
30463
  function invmod2(a, b) {
30317
30464
  if (!isInteger3(a) || !isInteger3(b))
30318
30465
  throw new Error("Parameters in function invmod must be integer numbers");
30319
- a = mod2(a, b);
30466
+ a = mod3(a, b);
30320
30467
  if (equal2(b, 0)) throw new Error("Divisor must be non zero");
30321
30468
  const res = xgcd2(a, b);
30322
30469
  const resVal = res.valueOf();
30323
30470
  const [gcd2, invValue] = resVal;
30324
30471
  if (!equal2(gcd2, 1)) return NaN;
30325
- let inv3 = mod2(invValue, b);
30472
+ let inv3 = mod3(invValue, b);
30326
30473
  if (smaller2(inv3, 0)) inv3 = add3(inv3, b);
30327
30474
  return inv3;
30328
30475
  }
@@ -36212,6 +36359,21 @@ var createVariance = /* @__PURE__ */ factory(
36212
36359
  );
36213
36360
 
36214
36361
  // src/statistics/quantileSeq.ts
36362
+ var QUANTILE_MODES = [
36363
+ "linear",
36364
+ "lower",
36365
+ "higher",
36366
+ "nearest",
36367
+ "midpoint"
36368
+ ];
36369
+ function _assertMode(mode2) {
36370
+ if (!QUANTILE_MODES.includes(mode2)) {
36371
+ throw new Error(
36372
+ `Unknown quantile interpolation mode "${mode2}". Expected one of: ${QUANTILE_MODES.join(", ")}`
36373
+ );
36374
+ }
36375
+ return mode2;
36376
+ }
36215
36377
  var name222 = "quantileSeq";
36216
36378
  var dependencies222 = [
36217
36379
  "typed",
@@ -36249,24 +36411,29 @@ var createQuantileSeq = /* @__PURE__ */ factory(
36249
36411
  return typed3(name222, {
36250
36412
  "Array | Matrix, number | BigNumber": (data, p) => _quantileSeqProbNumber(data, p, false),
36251
36413
  "Array | Matrix, number | BigNumber, number": (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbNumber),
36414
+ // Third arg as a string selects the interpolation mode (linear default).
36415
+ "Array | Matrix, number | BigNumber, string": (data, prob, mode2) => _quantileSeqProbNumber(data, prob, false, _assertMode(mode2)),
36252
36416
  "Array | Matrix, number | BigNumber, boolean": _quantileSeqProbNumber,
36253
36417
  "Array | Matrix, number | BigNumber, boolean, number": (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbNumber),
36418
+ "Array | Matrix, number | BigNumber, boolean, string": (data, prob, sorted, mode2) => _quantileSeqProbNumber(data, prob, sorted, _assertMode(mode2)),
36254
36419
  "Array | Matrix, Array | Matrix": (data, p) => _quantileSeqProbCollection(data, p, false),
36255
36420
  "Array | Matrix, Array | Matrix, number": (data, prob, dim) => _quantileSeqDim(data, prob, false, dim, _quantileSeqProbCollection),
36421
+ "Array | Matrix, Array | Matrix, string": (data, p, mode2) => _quantileSeqProbCollection(data, p, false, _assertMode(mode2)),
36256
36422
  "Array | Matrix, Array | Matrix, boolean": _quantileSeqProbCollection,
36257
- "Array | Matrix, Array | Matrix, boolean, number": (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbCollection)
36423
+ "Array | Matrix, Array | Matrix, boolean, number": (data, prob, sorted, dim) => _quantileSeqDim(data, prob, sorted, dim, _quantileSeqProbCollection),
36424
+ "Array | Matrix, Array | Matrix, boolean, string": (data, p, sorted, mode2) => _quantileSeqProbCollection(data, p, sorted, _assertMode(mode2))
36258
36425
  });
36259
36426
  function _quantileSeqDim(data, prob, sorted, dim, fn) {
36260
36427
  return mapSlices2(data, dim, (x) => fn(x, prob, sorted));
36261
36428
  }
36262
- function _quantileSeqProbNumber(data, probOrN, sorted) {
36429
+ function _quantileSeqProbNumber(data, probOrN, sorted, mode2 = "linear") {
36263
36430
  let probArr;
36264
36431
  const dataArr = data.valueOf();
36265
36432
  if (smaller2(probOrN, 0)) {
36266
36433
  throw new Error("N/prob must be non-negative");
36267
36434
  }
36268
36435
  if (smallerEq2(probOrN, 1)) {
36269
- return isNumber(probOrN) ? _quantileSeq2(dataArr, probOrN, sorted) : bignumber2(_quantileSeq2(dataArr, probOrN, sorted));
36436
+ return isNumber(probOrN) ? _quantileSeq2(dataArr, probOrN, sorted, mode2) : bignumber2(_quantileSeq2(dataArr, probOrN, sorted, mode2));
36270
36437
  }
36271
36438
  if (larger2(probOrN, 1)) {
36272
36439
  if (!isInteger3(probOrN)) {
@@ -36281,22 +36448,22 @@ var createQuantileSeq = /* @__PURE__ */ factory(
36281
36448
  probArr = [];
36282
36449
  for (let i = 0; smaller2(i, probOrN); i++) {
36283
36450
  const prob = divide2(i + 1, nPlusOne);
36284
- probArr.push(_quantileSeq2(dataArr, prob, sorted));
36451
+ probArr.push(_quantileSeq2(dataArr, prob, sorted, mode2));
36285
36452
  }
36286
36453
  return isNumber(probOrN) ? probArr : bignumber2(probArr);
36287
36454
  }
36288
36455
  return void 0;
36289
36456
  }
36290
- function _quantileSeqProbCollection(data, probOrN, sorted) {
36457
+ function _quantileSeqProbCollection(data, probOrN, sorted, mode2 = "linear") {
36291
36458
  const dataArr = data.valueOf();
36292
36459
  const probOrNArr = probOrN.valueOf();
36293
36460
  const probArr = [];
36294
36461
  for (let i = 0; i < probOrNArr.length; ++i) {
36295
- probArr.push(_quantileSeq2(dataArr, probOrNArr[i], sorted));
36462
+ probArr.push(_quantileSeq2(dataArr, probOrNArr[i], sorted, mode2));
36296
36463
  }
36297
36464
  return probArr;
36298
36465
  }
36299
- function _quantileSeq2(array, prob, sorted) {
36466
+ function _quantileSeq2(array, prob, sorted, mode2 = "linear") {
36300
36467
  const flat = flatten2(array);
36301
36468
  const len = flat.length;
36302
36469
  if (len === 0) {
@@ -36322,11 +36489,28 @@ var createQuantileSeq = /* @__PURE__ */ factory(
36322
36489
  }
36323
36490
  }
36324
36491
  }
36325
- const fracPartConverted = isBigNumber(left) && isNumber(fracPart) ? bignumber2(fracPart) : fracPart;
36326
- return add3(
36327
- multiply2(left, subtract3(1, fracPartConverted)),
36328
- multiply2(right, fracPartConverted)
36329
- );
36492
+ switch (mode2) {
36493
+ case "lower":
36494
+ return left;
36495
+ case "higher":
36496
+ return right;
36497
+ case "nearest": {
36498
+ const c = compare2(fracPart, 0.5);
36499
+ if (c < 0) return left;
36500
+ if (c > 0) return right;
36501
+ return integerPart % 2 === 0 ? left : right;
36502
+ }
36503
+ case "midpoint":
36504
+ return divide2(add3(left, right), 2);
36505
+ case "linear":
36506
+ default: {
36507
+ const fracPartConverted = isBigNumber(left) && isNumber(fracPart) ? bignumber2(fracPart) : fracPart;
36508
+ return add3(
36509
+ multiply2(left, subtract3(1, fracPartConverted)),
36510
+ multiply2(right, fracPartConverted)
36511
+ );
36512
+ }
36513
+ }
36330
36514
  }
36331
36515
  }
36332
36516
  );
@@ -44770,20 +44954,20 @@ function stirlingS1(n, k) {
44770
44954
  }
44771
44955
  return s[n][k];
44772
44956
  }
44773
- function modPowBig(base, exp2, mod2) {
44774
- let b = (base % mod2 + mod2) % mod2;
44957
+ function modPowBig(base, exp2, mod3) {
44958
+ let b = (base % mod3 + mod3) % mod3;
44775
44959
  let e = exp2;
44776
44960
  let result = 1n;
44777
44961
  while (e > 0n) {
44778
- if (e & 1n) result = result * b % mod2;
44779
- b = b * b % mod2;
44962
+ if (e & 1n) result = result * b % mod3;
44963
+ b = b * b % mod3;
44780
44964
  e >>= 1n;
44781
44965
  }
44782
44966
  return result;
44783
44967
  }
44784
- function modInverseBig(a, mod2) {
44968
+ function modInverseBig(a, mod3) {
44785
44969
  let oldR = a;
44786
- let r = mod2;
44970
+ let r = mod3;
44787
44971
  let oldS = 1n;
44788
44972
  let s = 0n;
44789
44973
  while (r !== 0n) {
@@ -44791,7 +44975,7 @@ function modInverseBig(a, mod2) {
44791
44975
  [oldR, r] = [r, oldR - q * r];
44792
44976
  [oldS, s] = [s, oldS - q * s];
44793
44977
  }
44794
- return (oldS % mod2 + mod2) % mod2;
44978
+ return (oldS % mod3 + mod3) % mod3;
44795
44979
  }
44796
44980
  function discreteLog(g, h, p) {
44797
44981
  if (!Number.isInteger(g) || !Number.isInteger(h) || !Number.isInteger(p) || p < 2) {
@@ -46669,6 +46853,12 @@ import { eig as eig3 } from "@danielsimonjr/mathts-matrix";
46669
46853
  function cSub(a, b) {
46670
46854
  return { re: a.re - b.re, im: a.im - b.im };
46671
46855
  }
46856
+ function cAdd(a, b) {
46857
+ return { re: a.re + b.re, im: a.im + b.im };
46858
+ }
46859
+ function cScale(a, s) {
46860
+ return { re: a.re * s, im: a.im * s };
46861
+ }
46672
46862
  function cMul(a, b) {
46673
46863
  return { re: a.re * b.re - a.im * b.im, im: a.re * b.im + a.im * b.re };
46674
46864
  }
@@ -46685,6 +46875,11 @@ function cZeros(n) {
46685
46875
  im: Array.from({ length: n }, () => new Array(n).fill(0))
46686
46876
  };
46687
46877
  }
46878
+ function cIdentity(n) {
46879
+ const m = cZeros(n);
46880
+ for (let i = 0; i < n; i++) m.re[i][i] = 1;
46881
+ return m;
46882
+ }
46688
46883
  function cFromReal(A) {
46689
46884
  const n = A.length;
46690
46885
  return {
@@ -46751,7 +46946,81 @@ function isDiagonal(A, n) {
46751
46946
  }
46752
46947
  return true;
46753
46948
  }
46754
- function funm(A, f) {
46949
+ function clusterEigenvalues(values, tol) {
46950
+ const acc = [];
46951
+ for (const v of values) {
46952
+ let placed = false;
46953
+ for (const c of acc) {
46954
+ const rep = { re: c.sumRe / c.count, im: c.sumIm / c.count };
46955
+ if (cAbs(cSub(v, rep)) < tol) {
46956
+ c.sumRe += v.re;
46957
+ c.sumIm += v.im;
46958
+ c.count += 1;
46959
+ placed = true;
46960
+ break;
46961
+ }
46962
+ }
46963
+ if (!placed) acc.push({ sumRe: v.re, sumIm: v.im, count: 1 });
46964
+ }
46965
+ return acc.map((c) => ({
46966
+ value: { re: c.sumRe / c.count, im: c.sumIm / c.count },
46967
+ count: c.count
46968
+ }));
46969
+ }
46970
+ function factorialNum(k) {
46971
+ let r = 1;
46972
+ for (let i = 2; i <= k; i++) r *= i;
46973
+ return r;
46974
+ }
46975
+ function numericalDerivative2(f, z, order) {
46976
+ const at = (dx) => f({ re: z.re + dx, im: z.im });
46977
+ switch (order) {
46978
+ case 1: {
46979
+ const h = 1e-6;
46980
+ return cScale(cSub(at(h), at(-h)), 1 / (2 * h));
46981
+ }
46982
+ case 2: {
46983
+ const h = 1e-4;
46984
+ const t = cSub(cAdd(at(h), at(-h)), cScale(at(0), 2));
46985
+ return cScale(t, 1 / (h * h));
46986
+ }
46987
+ case 3: {
46988
+ const h = 1e-3;
46989
+ const t = cSub(cAdd(at(2 * h), cScale(at(-h), 2)), cAdd(cScale(at(h), 2), at(-2 * h)));
46990
+ return cScale(t, 1 / (2 * h * h * h));
46991
+ }
46992
+ case 4: {
46993
+ const h = 0.01;
46994
+ let t = at(2 * h);
46995
+ t = cSub(t, cScale(at(h), 4));
46996
+ t = cAdd(t, cScale(at(0), 6));
46997
+ t = cSub(t, cScale(at(-h), 4));
46998
+ t = cAdd(t, at(-2 * h));
46999
+ return cScale(t, 1 / (h * h * h * h));
47000
+ }
47001
+ default:
47002
+ throw new Error(
47003
+ `funm: numerical derivatives of order ${order} are not supported (eigenvalue multiplicity ${order + 1} exceeds the finite-difference stencils); supply analytic derivatives via the fDerivs argument (fDerivs[k] = f^(k+1))`
47004
+ );
47005
+ }
47006
+ }
47007
+ function taylorCoeffs(f, fDerivs, z, maxOrder) {
47008
+ const coeffs = [f(z)];
47009
+ for (let L = 1; L <= maxOrder; L++) {
47010
+ const deriv = fDerivs && fDerivs.length >= L ? fDerivs[L - 1](z) : numericalDerivative2(f, z, L);
47011
+ coeffs.push(cScale(deriv, 1 / factorialNum(L)));
47012
+ }
47013
+ return coeffs;
47014
+ }
47015
+ function cIsFinite(M) {
47016
+ for (let i = 0; i < M.re.length; i++) {
47017
+ for (let j = 0; j < M.re.length; j++) {
47018
+ if (!Number.isFinite(M.re[i][j]) || !Number.isFinite(M.im[i][j])) return false;
47019
+ }
47020
+ }
47021
+ return true;
47022
+ }
47023
+ function funm(A, f, fDerivs) {
46755
47024
  const n = A.length;
46756
47025
  if (n === 0) return { re: [], im: [] };
46757
47026
  for (const row2 of A) {
@@ -46769,29 +47038,59 @@ function funm(A, f) {
46769
47038
  const { values } = eig3(A, { computeVectors: false });
46770
47039
  const maxAbs = values.reduce((m, v) => Math.max(m, cAbs(v)), 0);
46771
47040
  const tol = EIGENVALUE_DISTINCT_REL_TOL * Math.max(1, maxAbs);
46772
- for (let i = 0; i < n; i++) {
46773
- for (let j = i + 1; j < n; j++) {
46774
- if (cAbs(cSub(values[i], values[j])) < tol) {
46775
- throw new Error(
46776
- "funm: matrix has repeated (or numerically indistinguishable) eigenvalues and is not diagonal \u2014 defective/non-diagonalizable matrices are not supported (Schur-Parlett block recurrence not yet implemented)"
46777
- );
47041
+ const clusters = clusterEigenvalues(values, tol);
47042
+ if (clusters.length === n) {
47043
+ const F2 = cZeros(n);
47044
+ for (let i = 0; i < n; i++) {
47045
+ const lambdaI = values[i];
47046
+ let numerator = cFromReal(A);
47047
+ let denom = { re: 1, im: 0 };
47048
+ let first = true;
47049
+ for (let j = 0; j < n; j++) {
47050
+ if (j === i) continue;
47051
+ const factor2 = cShiftedReal(A, values[j]);
47052
+ numerator = first ? factor2 : cMatMul(numerator, factor2);
47053
+ first = false;
47054
+ denom = cMul(denom, cSub(lambdaI, values[j]));
46778
47055
  }
47056
+ cAccumulate(F2, f(lambdaI), cMatScalarDiv(numerator, denom));
46779
47057
  }
47058
+ return F2;
46780
47059
  }
46781
- const F = cZeros(n);
46782
- for (let i = 0; i < n; i++) {
46783
- const lambdaI = values[i];
46784
- let numerator = cFromReal(A);
46785
- let denom = { re: 1, im: 0 };
46786
- let first = true;
46787
- for (let j = 0; j < n; j++) {
46788
- if (j === i) continue;
46789
- const factor2 = cShiftedReal(A, values[j]);
46790
- numerator = first ? factor2 : cMatMul(numerator, factor2);
46791
- first = false;
46792
- denom = cMul(denom, cSub(lambdaI, values[j]));
47060
+ const nodes = [];
47061
+ const clusterIdx = [];
47062
+ const taylor2 = clusters.map(
47063
+ (c) => taylorCoeffs(f, fDerivs, c.value, c.count - 1)
47064
+ );
47065
+ clusters.forEach((c, ci) => {
47066
+ for (let r = 0; r < c.count; r++) {
47067
+ nodes.push(c.value);
47068
+ clusterIdx.push(ci);
47069
+ }
47070
+ });
47071
+ const dd = Array.from({ length: n }, () => new Array(n));
47072
+ for (let i = 0; i < n; i++) dd[i][i] = taylor2[clusterIdx[i]][0];
47073
+ for (let L = 1; L < n; L++) {
47074
+ for (let i = 0; i + L < n; i++) {
47075
+ const j = i + L;
47076
+ if (clusterIdx[i] === clusterIdx[j]) {
47077
+ dd[i][j] = taylor2[clusterIdx[i]][L];
47078
+ } else {
47079
+ dd[i][j] = cDiv(cSub(dd[i + 1][j], dd[i][j - 1]), cSub(nodes[j], nodes[i]));
47080
+ }
46793
47081
  }
46794
- cAccumulate(F, f(lambdaI), cMatScalarDiv(numerator, denom));
47082
+ }
47083
+ const F = cZeros(n);
47084
+ let P2 = cIdentity(n);
47085
+ cAccumulate(F, dd[0][0], P2);
47086
+ for (let k = 1; k < n; k++) {
47087
+ P2 = cMatMul(P2, cShiftedReal(A, nodes[k - 1]));
47088
+ cAccumulate(F, dd[0][k], P2);
47089
+ }
47090
+ if (!cIsFinite(F)) {
47091
+ throw new Error(
47092
+ "funm: result is non-finite \u2014 f (or one of its derivatives) is singular at a repeated eigenvalue (e.g. sqrt/log at 0), so the matrix function is undefined there"
47093
+ );
46795
47094
  }
46796
47095
  return F;
46797
47096
  }
@@ -46807,11 +47106,17 @@ function complexSin(z) {
46807
47106
  im: Math.cos(z.re) * Math.sinh(z.im)
46808
47107
  };
46809
47108
  }
47109
+ function trigDerivs(base, n) {
47110
+ return Array.from({ length: Math.max(0, n - 1) }, (_unused, k) => {
47111
+ const shift = (k + 1) * Math.PI / 2;
47112
+ return (z) => base({ re: z.re + shift, im: z.im });
47113
+ });
47114
+ }
46810
47115
  function cosm(A) {
46811
- return funm(A, complexCos);
47116
+ return funm(A, complexCos, trigDerivs(complexCos, A.length));
46812
47117
  }
46813
47118
  function sinm(A) {
46814
- return funm(A, complexSin);
47119
+ return funm(A, complexSin, trigDerivs(complexSin, A.length));
46815
47120
  }
46816
47121
 
46817
47122
  // src/numeric/control-equations.ts
@@ -48611,17 +48916,17 @@ function filtfilt(b, a, x) {
48611
48916
  ).y.reverse();
48612
48917
  return back.slice(pad, pad + n);
48613
48918
  }
48614
- var cAdd = (p, q) => p.add(q);
48919
+ var cAdd2 = (p, q) => p.add(q);
48615
48920
  var cSub2 = (p, q) => p.sub(q);
48616
48921
  var cMul2 = (p, q) => p.multiply(q);
48617
48922
  var cDiv2 = (p, q) => p.divide(q);
48618
- var cScale = (p, s) => cMul2(p, new Complex11(s, 0));
48923
+ var cScale2 = (p, s) => cMul2(p, new Complex11(s, 0));
48619
48924
  function polyFromRoots(roots) {
48620
48925
  let c = [new Complex11(1, 0)];
48621
48926
  for (const r of roots) {
48622
48927
  const next = Array.from({ length: c.length + 1 }, () => new Complex11(0, 0));
48623
48928
  for (let i = 0; i < c.length; i++) {
48624
- next[i] = cAdd(next[i], c[i]);
48929
+ next[i] = cAdd2(next[i], c[i]);
48625
48930
  next[i + 1] = cSub2(next[i + 1], cMul2(c[i], r));
48626
48931
  }
48627
48932
  c = next;
@@ -48636,8 +48941,8 @@ function relativeDegree(z, p) {
48636
48941
  function lp2lpZpk(z, p, k, wo) {
48637
48942
  const degree2 = relativeDegree(z, p);
48638
48943
  return {
48639
- z: z.map((zv) => cScale(zv, wo)),
48640
- p: p.map((pv) => cScale(pv, wo)),
48944
+ z: z.map((zv) => cScale2(zv, wo)),
48945
+ p: p.map((pv) => cScale2(pv, wo)),
48641
48946
  k: k * Math.pow(wo, degree2)
48642
48947
  };
48643
48948
  }
@@ -48656,8 +48961,8 @@ function lp2bpZpk(z, p, k, wo, bw) {
48656
48961
  const degree2 = relativeDegree(z, p);
48657
48962
  const wo2 = new Complex11(wo * wo, 0);
48658
48963
  const shift = (roots) => {
48659
- const lp = roots.map((r) => cScale(r, bw / 2));
48660
- const plus = lp.map((r) => cAdd(r, cSub2(cMul2(r, r), wo2).sqrt()));
48964
+ const lp = roots.map((r) => cScale2(r, bw / 2));
48965
+ const plus = lp.map((r) => cAdd2(r, cSub2(cMul2(r, r), wo2).sqrt()));
48661
48966
  const minus = lp.map((r) => cSub2(r, cSub2(cMul2(r, r), wo2).sqrt()));
48662
48967
  return plus.concat(minus);
48663
48968
  };
@@ -48671,7 +48976,7 @@ function lp2bsZpk(z, p, k, wo, bw) {
48671
48976
  const bw2 = new Complex11(bw / 2, 0);
48672
48977
  const shift = (roots) => {
48673
48978
  const hp = roots.map((r) => cDiv2(bw2, r));
48674
- const plus = hp.map((r) => cAdd(r, cSub2(cMul2(r, r), wo2).sqrt()));
48979
+ const plus = hp.map((r) => cAdd2(r, cSub2(cMul2(r, r), wo2).sqrt()));
48675
48980
  const minus = hp.map((r) => cSub2(r, cSub2(cMul2(r, r), wo2).sqrt()));
48676
48981
  return plus.concat(minus);
48677
48982
  };
@@ -48687,7 +48992,7 @@ function lp2bsZpk(z, p, k, wo, bw) {
48687
48992
  function bilinearZpk(z, p, k, fs) {
48688
48993
  const degree2 = relativeDegree(z, p);
48689
48994
  const fs2 = new Complex11(2 * fs, 0);
48690
- const zZ = z.map((zv) => cDiv2(cAdd(fs2, zv), cSub2(fs2, zv)));
48995
+ const zZ = z.map((zv) => cDiv2(cAdd2(fs2, zv), cSub2(fs2, zv)));
48691
48996
  for (let i = 0; i < degree2; i++) zZ.push(new Complex11(-1, 0));
48692
48997
  let prodZ = new Complex11(1, 0);
48693
48998
  for (const zv of z) prodZ = cMul2(prodZ, cSub2(fs2, zv));
@@ -48695,7 +49000,7 @@ function bilinearZpk(z, p, k, fs) {
48695
49000
  for (const pv of p) prodP = cMul2(prodP, cSub2(fs2, pv));
48696
49001
  return {
48697
49002
  z: zZ,
48698
- p: p.map((pv) => cDiv2(cAdd(fs2, pv), cSub2(fs2, pv))),
49003
+ p: p.map((pv) => cDiv2(cAdd2(fs2, pv), cSub2(fs2, pv))),
48699
49004
  k: k * cDiv2(prodZ, prodP).re
48700
49005
  };
48701
49006
  }
@@ -48961,10 +49266,10 @@ function arcJacSn(w, m) {
48961
49266
  let wn = w;
48962
49267
  for (let i = 0; i < ks.length - 1; i++) {
48963
49268
  const knext = ks[i + 1];
48964
- const comp = complementComplex(cScale(wn, ks[i]));
48965
- wn = cDiv2(cScale(wn, 2), cMul2(new Complex12(1 + knext, 0), new Complex12(1, 0).add(comp)));
49269
+ const comp = complementComplex(cScale2(wn, ks[i]));
49270
+ wn = cDiv2(cScale2(wn, 2), cMul2(new Complex12(1 + knext, 0), new Complex12(1, 0).add(comp)));
48966
49271
  }
48967
- return cScale(cScale(wn.asin(), 2 / Math.PI), K);
49272
+ return cScale2(cScale2(wn.asin(), 2 / Math.PI), K);
48968
49273
  }
48969
49274
  function arcJacSc1(w, m) {
48970
49275
  const z = arcJacSn(new Complex12(0, w), m);
@@ -49523,20 +49828,11 @@ function remez(numtaps, bands, desired) {
49523
49828
 
49524
49829
  // src/signal/wavelets.ts
49525
49830
  function idwt(approx, detail, wavelet = "haar") {
49526
- if (wavelet !== "haar" && wavelet !== "db1") {
49527
- throw new Error(`idwt: unsupported wavelet "${wavelet}"`);
49528
- }
49529
- if (approx.length !== detail.length) {
49530
- throw new Error("idwt: approx and detail must have equal length");
49531
- }
49532
- const half = approx.length;
49533
- const s = 1 / Math.SQRT2;
49534
- const x = new Array(half * 2);
49535
- for (let i = 0; i < half; i++) {
49536
- x[2 * i] = s * (approx[i] + detail[i]);
49537
- x[2 * i + 1] = s * (approx[i] - detail[i]);
49831
+ try {
49832
+ return idwtPeriodization(approx, detail, wavelet);
49833
+ } catch (err) {
49834
+ throw new Error(`idwt: ${err instanceof Error ? err.message : String(err)}`);
49538
49835
  }
49539
- return x;
49540
49836
  }
49541
49837
  function wavedec(x, wavelet = "haar", level = 1) {
49542
49838
  if (!Number.isInteger(level) || level < 1) {
@@ -24,13 +24,23 @@
24
24
  * any polynomial or entire function `f` (cos, sin, sqrt, exp, log, …)
25
25
  * whenever the spectrum is simple.
26
26
  *
27
- * Limitation (documented, not yet implemented): matrices with repeated (or
28
- * numerically indistinguishable) eigenvalues that are NOT diagonal — i.e.
29
- * genuinely defective/non-diagonalizable matrices, or diagonalizable
30
- * matrices with a repeated eigenvalue and off-diagonal structure are not
31
- * supported; `funm` throws rather than silently return a wrong answer. A
32
- * full Schur-Parlett block recurrence (Higham 2008 Ch. 9) would lift this
33
- * restriction; that is future work, not required by the current call sites.
27
+ * Defective / repeated-eigenvalue matrices (confluent Hermite interpolation):
28
+ * - When eigenvalues repeat (or cluster within `EIGENVALUE_DISTINCT_REL_TOL`),
29
+ * `f(A)` depends on `f` AND its derivatives at each repeated eigenvalue —
30
+ * for a Jordan block `J = λI + N` (N nilpotent, `N^s = 0`),
31
+ * f(J) = Σ_{k=0}^{s-1} f^(k)(λ)/k! · N^k.
32
+ * `funm` builds the confluent node list (each distinct eigenvalue repeated
33
+ * to its multiplicity) and evaluates the Newton divided-difference form
34
+ * f(A) = Σ_k f[z_0,…,z_k] · Π_{i<k}(A − z_i I),
35
+ * where a run of equal nodes contributes the Taylor coefficient
36
+ * `f^(L)(z)/L!`. This subsumes the simple-spectrum Lagrange path.
37
+ * - Derivatives of `f` come from the optional `fDerivs` argument
38
+ * (`fDerivs[k] = f^(k+1)`, machine precision — wired for `cosm`/`sinm`) or,
39
+ * when omitted, from finite-difference stencils (~1e-6 accuracy).
40
+ * - `funm` throws (rather than return a wrong/`NaN` answer) only when `f` or a
41
+ * derivative is genuinely singular at a repeated eigenvalue (e.g.
42
+ * `sqrt`/`log` at 0) or when a needed numerical derivative order exceeds the
43
+ * built-in stencils (multiplicity > 5 with no analytic derivatives).
34
44
  *
35
45
  * @packageDocumentation
36
46
  */
@@ -50,25 +60,40 @@ export type ScalarComplexFunction = (z: ComplexValue) => ComplexValue;
50
60
  * Evaluate the matrix function `f(A)` for a square real matrix `A`, returning
51
61
  * a complex matrix `{re, im}`.
52
62
  *
53
- * Supports diagonal matrices unconditionally (exact, elementwise), and
54
- * general diagonalizable matrices whose eigenvalues are pairwise distinct
55
- * (Lagrange-Sylvester interpolation on the spectrum — see module docs).
56
- * Throws for matrices with repeated or numerically indistinguishable
57
- * eigenvalues that are not diagonal (defective / non-diagonalizable case;
58
- * not yet supported see module docs for the Schur-Parlett follow-up).
63
+ * Supports:
64
+ * - diagonal matrices unconditionally (exact, elementwise);
65
+ * - diagonalizable matrices with pairwise-distinct eigenvalues
66
+ * (Lagrange-Sylvester interpolation the fast simple-spectrum branch);
67
+ * - defective / non-diagonalizable matrices with repeated (or numerically
68
+ * clustered) eigenvalues, via **confluent Hermite interpolation** (Newton
69
+ * divided differences over repeated eigenvalue nodes). A matrix function of
70
+ * a defective matrix depends on `f` AND its derivatives at each repeated
71
+ * eigenvalue (for a Jordan block `J = λI + N`, `f(J) = Σ_k f^(k)(λ)/k! · N^k`),
72
+ * so this branch needs derivatives of `f`: pass them analytically via
73
+ * `fDerivs` for machine precision, or they are approximated numerically.
74
+ *
75
+ * Throws (rather than return a wrong/`NaN` answer) when `f` or its derivatives
76
+ * are singular at a repeated eigenvalue (e.g. `sqrt`/`log` at 0), or when a
77
+ * needed numerical derivative order exceeds the built-in stencils.
59
78
  *
60
79
  * @param A - Square real matrix, as a plain 2-D array.
61
- * @param f - Scalar function to apply to each eigenvalue, e.g. `cos`, `sin`,
80
+ * @param f - Scalar function to apply to the spectrum, e.g. `cos`, `sin`,
62
81
  * `sqrt`, `exp`, `log`, extended to complex arguments.
82
+ * @param fDerivs - Optional analytic derivatives of `f`: `fDerivs[k]` is
83
+ * `f^(k+1)`. Needed only for defective matrices; when omitted, derivatives
84
+ * are computed by finite differences (~1e-6 accuracy). Additive and
85
+ * non-breaking — distinct-spectrum inputs never consult it.
63
86
  * @returns `{ re, im }` — the (possibly complex) matrix `f(A)`.
64
87
  */
65
- export declare function funm(A: number[][], f: ScalarComplexFunction): ComplexMatrix;
88
+ export declare function funm(A: number[][], f: ScalarComplexFunction, fDerivs?: ScalarComplexFunction[]): ComplexMatrix;
66
89
  /** Complex cosine: `cos(z) = cos(re)cosh(im) - i sin(re)sinh(im)`. */
67
90
  export declare function complexCos(z: ComplexValue): ComplexValue;
68
91
  /** Complex sine: `sin(z) = sin(re)cosh(im) + i cos(re)sinh(im)`. */
69
92
  export declare function complexSin(z: ComplexValue): ComplexValue;
70
- /** Matrix cosine `cos(A)`, via {@link funm} with {@link complexCos}. */
93
+ /** Matrix cosine `cos(A)`, via {@link funm} with {@link complexCos}. Passes
94
+ * exact analytic derivatives so defective matrices are machine-precise. */
71
95
  export declare function cosm(A: number[][]): ComplexMatrix;
72
- /** Matrix sine `sin(A)`, via {@link funm} with {@link complexSin}. */
96
+ /** Matrix sine `sin(A)`, via {@link funm} with {@link complexSin}. Passes
97
+ * exact analytic derivatives so defective matrices are machine-precise. */
73
98
  export declare function sinm(A: number[][]): ComplexMatrix;
74
99
  //# sourceMappingURL=matrix-functions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"matrix-functions.d.ts","sourceRoot":"","sources":["../../src/numeric/matrix-functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAIH,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IACf,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;CAChB;AAED,uEAAuE;AACvE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,EAAE,YAAY,KAAK,YAAY,CAAC;AAoHtE;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,qBAAqB,GAAG,aAAa,CAuD3E;AAED,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,YAAY,CAKxD;AAED,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,YAAY,CAKxD;AAED,wEAAwE;AACxE,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,aAAa,CAEjD;AAED,sEAAsE;AACtE,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,aAAa,CAEjD"}
1
+ {"version":3,"file":"matrix-functions.d.ts","sourceRoot":"","sources":["../../src/numeric/matrix-functions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AAIH,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IACf,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;CAChB;AAED,uEAAuE;AACvE,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,EAAE,YAAY,KAAK,YAAY,CAAC;AA0PtE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,IAAI,CAClB,CAAC,EAAE,MAAM,EAAE,EAAE,EACb,CAAC,EAAE,qBAAqB,EACxB,OAAO,CAAC,EAAE,qBAAqB,EAAE,GAChC,aAAa,CAmGf;AAED,sEAAsE;AACtE,wBAAgB,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,YAAY,CAKxD;AAED,oEAAoE;AACpE,wBAAgB,UAAU,CAAC,CAAC,EAAE,YAAY,GAAG,YAAY,CAKxD;AAeD;2EAC2E;AAC3E,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,aAAa,CAEjD;AAED;2EAC2E;AAC3E,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,aAAa,CAEjD"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Orthogonal wavelet filter table + a general periodization-boundary filter
3
+ * bank, shared by `dwt` (`../typed/signal.ts`) and `idwt`/`wavedec`/`waverec`
4
+ * (`./wavelets.ts`). This module is a dependency-free leaf: it must not
5
+ * import from `typed/signal.ts` (which imports `dwt` derivatives) to avoid a
6
+ * cycle.
7
+ *
8
+ * Each wavelet is stored as its decomposition low-pass filter (`dec_lo`),
9
+ * pinned bit-for-bit against PyWavelets 1.8.0 (`pywt.Wavelet(name).dec_lo`).
10
+ * The other three orthogonal filters are derived by the standard QMF
11
+ * relations (verified against pywt's `dec_hi`/`rec_lo`/`rec_hi` for every
12
+ * entry below, tolerance 1e-14):
13
+ *
14
+ * dec_hi[k] = -(-1)^k * dec_lo[L-1-k] (alternating flip of the reverse)
15
+ * rec_lo = reverse(dec_lo)
16
+ * rec_hi = reverse(dec_hi)
17
+ *
18
+ * Boundary mode is **periodization** (matches `pywt.dwt(..., mode='periodization')`
19
+ * exactly, bit-for-bit, verified against pywt for signal lengths 8/15/16/32):
20
+ * treating the signal as circularly periodic yields exactly `ceil(N/2)`
21
+ * coefficients per band and admits an exact analytic inverse. The phase
22
+ * alignment (derived empirically against pywt, then verified across many
23
+ * filter lengths and signal lengths) is:
24
+ *
25
+ * analysis: cA[n] = sum_k decLo[k] * x[(2n - k + floor(L/2)) mod N]
26
+ * cD[n] = sum_k decHi[k] * x[(2n - k + floor(L/2)) mod N]
27
+ * synthesis: x[m] = sum_k recLo[k] * cA[j] + recHi[k] * cD[j]
28
+ * where idx = mod(m - k + floor(L/2) - 1, N), only when idx is
29
+ * even (j = idx / 2) — odd idx contributes zero (upsampling).
30
+ *
31
+ * @packageDocumentation
32
+ */
33
+ /** Wavelet names supported by `dwt`/`idwt`/`wavedec`/`waverec`. */
34
+ export declare const SUPPORTED_WAVELETS: readonly string[];
35
+ /** The four orthogonal filters for a wavelet family. */
36
+ export interface WaveletFilters {
37
+ decLo: number[];
38
+ decHi: number[];
39
+ recLo: number[];
40
+ recHi: number[];
41
+ }
42
+ /**
43
+ * Looks up (and derives) the four orthogonal filters for `wavelet`.
44
+ *
45
+ * @throws if `wavelet` is not one of `SUPPORTED_WAVELETS`.
46
+ */
47
+ export declare function getWaveletFilters(wavelet: string): WaveletFilters;
48
+ /**
49
+ * Single-level DWT via a general orthogonal filter bank with periodization
50
+ * boundary handling. Matches `pywt.dwt(x, wavelet, mode='periodization')`
51
+ * bit-for-bit for every supported family.
52
+ *
53
+ * @param x - Input signal (length >= 2)
54
+ * @param wavelet - One of `SUPPORTED_WAVELETS`
55
+ * @returns `{ approx, detail }`, each of length `ceil(x.length / 2)`
56
+ */
57
+ export declare function dwtPeriodization(x: number[], wavelet: string): {
58
+ approx: number[];
59
+ detail: number[];
60
+ };
61
+ /**
62
+ * Inverse single-level DWT (periodization boundary), the exact analytic
63
+ * inverse of `dwtPeriodization`. Matches
64
+ * `pywt.idwt(approx, detail, wavelet, mode='periodization')` bit-for-bit.
65
+ *
66
+ * @param approx - Approximation (low-pass) coefficients
67
+ * @param detail - Detail (high-pass) coefficients, same length as `approx`
68
+ * @param wavelet - One of `SUPPORTED_WAVELETS`
69
+ * @returns Reconstructed signal, length `2 * approx.length`
70
+ */
71
+ export declare function idwtPeriodization(approx: number[], detail: number[], wavelet: string): number[];
72
+ //# sourceMappingURL=wavelet-filters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wavelet-filters.d.ts","sourceRoot":"","sources":["../../src/signal/wavelet-filters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAmCH,mEAAmE;AACnE,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAA8B,CAAC;AAE/E,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAejE;AAQD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC9B,CAAC,EAAE,MAAM,EAAE,EACX,OAAO,EAAE,MAAM,GACd;IAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAwBxC;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAwB/F"}
@@ -2,23 +2,24 @@
2
2
  * Phase 6 Task 4 — inverse DWT, multilevel wavedec/waverec (perfect
3
3
  * reconstruction), and the continuous wavelet transform (CWT).
4
4
  *
5
- * `idwt`/`wavedec`/`waverec` must invert the existing `dwt` (`../typed/signal.ts`)
6
- * exactly, so they match its Haar convention bit-for-bit: analysis filters
7
- * scaled by `s = 1/sqrt(2)`, `approx[i] = s*(x[2i]+x[2i+1])`,
8
- * `detail[i] = s*(x[2i]-x[2i+1])`. Haar's synthesis (reconstruction) filters
9
- * are the time-reverse of its analysis filters — for a symmetric 2-tap filter
10
- * that reversal is a no-op, so the closed-form inverse below is exact:
11
- * `x[2i] = s*(approx[i]+detail[i])`, `x[2i+1] = s*(approx[i]-detail[i])`.
5
+ * `idwt` inverts `dwt` (`../typed/signal.ts`) via the shared periodization
6
+ * filter bank in `./wavelet-filters.ts`, which supports the full family list
7
+ * (`SUPPORTED_WAVELETS`: haar, db1-4, sym2-4, coif1-2) and matches
8
+ * `pywt.idwt(..., mode='periodization')` bit-for-bit. For Haar/db1 this is
9
+ * verified equivalent to the earlier hardcoded closed-form 2-tap inverse
10
+ * (`x[2i] = s*(approx[i]+detail[i])`, `x[2i+1] = s*(approx[i]-detail[i])`,
11
+ * `s = 1/sqrt(2)`) no behavior change for existing callers.
12
12
  *
13
13
  * @packageDocumentation
14
14
  */
15
15
  /**
16
- * Inverse single-level discrete wavelet transform. Upsamples `approx`/`detail`
17
- * and combines them with the Haar synthesis filters, exactly inverting `dwt`.
16
+ * Inverse single-level discrete wavelet transform (periodization boundary).
17
+ * Exactly inverts `dwt` for every wavelet in `SUPPORTED_WAVELETS`
18
+ * (`./wavelet-filters.ts`): haar, db1-4, sym2-4, coif1-2.
18
19
  *
19
20
  * @param approx - Approximation (low-pass) coefficients
20
21
  * @param detail - Detail (high-pass) coefficients, same length as `approx`
21
- * @param wavelet - Wavelet name (currently only 'haar'/'db1', matching `dwt`)
22
+ * @param wavelet - Wavelet name (default 'haar'); see `SUPPORTED_WAVELETS`
22
23
  * @returns Reconstructed signal, length `2 * approx.length`
23
24
  */
24
25
  export declare function idwt(approx: number[], detail: number[], wavelet?: string): number[];
@@ -27,7 +28,8 @@ export declare function idwt(approx: number[], detail: number[], wavelet?: strin
27
28
  * approximation coefficients.
28
29
  *
29
30
  * @param x - Input signal
30
- * @param wavelet - Wavelet name (passed through to `dwt`)
31
+ * @param wavelet - Wavelet name (passed through to `dwt`); see
32
+ * `SUPPORTED_WAVELETS` in `./wavelet-filters.ts`
31
33
  * @param level - Number of decomposition levels (>= 1)
32
34
  * @returns `[cA_level, cD_level, cD_{level-1}, ..., cD_1]` (pywt order)
33
35
  */
@@ -1 +1 @@
1
- {"version":3,"file":"wavelets.d.ts","sourceRoot":"","sources":["../../src/signal/wavelets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAe,GAAG,MAAM,EAAE,CAgB3F;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAe,EAAE,KAAK,GAAE,MAAU,GAAG,MAAM,EAAE,EAAE,CAc5F;AAED;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,GAAE,MAAe,GAAG,MAAM,EAAE,CAU9E;AA2BD;;;;;;;;GAQG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAiB,GAAG,MAAM,EAAE,EAAE,CAYzF"}
1
+ {"version":3,"file":"wavelets.d.ts","sourceRoot":"","sources":["../../src/signal/wavelets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH;;;;;;;;;GASG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,MAAe,GAAG,MAAM,EAAE,CAM3F;AAED;;;;;;;;;GASG;AACH,wBAAg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AE,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IAC7C,SAAS,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IAC/C,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;IAC5C,SAAS,EAAE,aAAa,CAAC;CAC1B;AA0CD,eAAO,MAAM,iBAAiB,iFAiR7B,CAAC"}
@@ -125,10 +125,17 @@ export declare function dst(x: number[]): number[];
125
125
  */
126
126
  export declare function idst(X: number[]): number[];
127
127
  /**
128
- * Discrete wavelet transform using Haar wavelet.
128
+ * Single-level discrete wavelet transform (periodization boundary).
129
129
  *
130
- * @param x - Input signal (length must be power of 2)
131
- * @param wavelet - Wavelet name (currently only 'haar')
130
+ * Haar/db1 use a dedicated closed-form (and WASM-accelerated) 2-tap path.
131
+ * All other supported families (db2-4, sym2-4, coif1-2) route through the
132
+ * general orthogonal filter bank in `../signal/wavelet-filters.ts`, which is
133
+ * verified to reproduce this same Haar/db1 result bit-for-bit and to match
134
+ * `pywt.dwt(..., mode='periodization')` for every family.
135
+ *
136
+ * @param x - Input signal (length >= 2)
137
+ * @param wavelet - Wavelet name; see `SUPPORTED_WAVELETS` in
138
+ * `../signal/wavelet-filters.ts` for the full list
132
139
  * @returns { approx: number[], detail: number[] }
133
140
  */
134
141
  export declare function dwt(x: number[], wavelet?: string): {
@@ -1 +1 @@
1
- {"version":3,"file":"signal.d.ts","sourceRoot":"","sources":["../../src/typed/signal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH,OAAO,EACL,mBAAmB,EAOpB,MAAM,+BAA+B,CAAC;AAWvC,0CAA0C;AAC1C,KAAK,GAAG,GAAG,MAAM,CAAC;AAElB,4BAA4B;AAC5B,KAAK,GAAG,GAAG,MAAM,CAAC;AAgJlB;;;;GAIG;AACH,eAAO,MAAM,WAAW,wCAiDtB,CAAC;AAEH;;;;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C;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,wCAUrB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielsimonjr/mathts-functions",
3
- "version": "0.37.1",
3
+ "version": "0.39.0",
4
4
  "description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
5
5
  "author": "Daniel Simon Jr.",
6
6
  "license": "MIT",