@danielsimonjr/mathts-functions 0.2.7 → 0.2.9
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/factories/matrix-bridge.d.ts +1 -1
- package/dist/factories/matrix-bridge.d.ts.map +1 -1
- package/dist/index.js +239 -95
- package/dist/typed/cas.d.ts +17 -10
- package/dist/typed/cas.d.ts.map +1 -1
- package/package.json +71 -71
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"matrix-bridge.d.ts","sourceRoot":"","sources":["../../src/factories/matrix-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAkB,MAAM,8BAA8B,CAAC;AAU3E;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,KAAK,EAAE,MAAM,EAAE,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;gBAElB,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG;QAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE;IAapE;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;OAEG;IACH,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,OAAO,IAAI,MAAM;IAIjB,QAAQ,IAAI,MAAM,GAAG,SAAS;IAI9B,OAAO,IAAI,MAAM,EAAE,EAAE;IAIrB,IAAI,IAAI,MAAM,EAAE;IAIhB,OAAO,IAAI,MAAM,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"matrix-bridge.d.ts","sourceRoot":"","sources":["../../src/factories/matrix-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAkB,MAAM,8BAA8B,CAAC;AAU3E;;;;;GAKG;AACH,qBAAa,iBAAiB;IAC5B,K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M,EAAE,GAAG,EAAE,EACb,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,MAAM,EAAE,GACZ,IAAI;IA2CP;;OAEG;IACH,MAAM,CAAC,WAAW,CAChB,CAAC,EAAE,MAAM,EACT,MAAM,EAAE,GAAG,EAAE,EACb,KAAK,EAAE,MAAM,EAAE,EACf,GAAG,EAAE,MAAM,EAAE,EACb,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,GAC1C,IAAI;CAUR;AA2BD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,KAE9B,OAAO,GAAG,EAAE,EAAE,GAAG,iBAAiB,GAAG,kBAAkB,GAAG,MAAM,EAChE,cAAc,MAAM,KACnB,iBAAiB,GAAG,kBAAkB,CAoB1C"}
|
package/dist/index.js
CHANGED
|
@@ -15144,6 +15144,9 @@ var MathJSDenseMatrix = class _MathJSDenseMatrix {
|
|
|
15144
15144
|
return [...this._size];
|
|
15145
15145
|
}
|
|
15146
15146
|
toArray() {
|
|
15147
|
+
if (this._size.length === 1) {
|
|
15148
|
+
return [...this._data];
|
|
15149
|
+
}
|
|
15147
15150
|
return this._data.map((row2) => [...row2]);
|
|
15148
15151
|
}
|
|
15149
15152
|
toJSON() {
|
|
@@ -15176,6 +15179,14 @@ var MathJSDenseMatrix = class _MathJSDenseMatrix {
|
|
|
15176
15179
|
* Map over all elements, producing a new matrix.
|
|
15177
15180
|
*/
|
|
15178
15181
|
map(callback) {
|
|
15182
|
+
if (this._size.length === 1) {
|
|
15183
|
+
const flat = this._data.map(
|
|
15184
|
+
(val, i) => callback(val, [i], this)
|
|
15185
|
+
);
|
|
15186
|
+
const m = new _MathJSDenseMatrix(flat);
|
|
15187
|
+
m._size = [...this._size];
|
|
15188
|
+
return m;
|
|
15189
|
+
}
|
|
15179
15190
|
const result = this._data.map((row2, i) => row2.map((val, j) => callback(val, [i, j], this)));
|
|
15180
15191
|
return new _MathJSDenseMatrix(result);
|
|
15181
15192
|
}
|
|
@@ -15183,6 +15194,10 @@ var MathJSDenseMatrix = class _MathJSDenseMatrix {
|
|
|
15183
15194
|
* Iterate over all elements.
|
|
15184
15195
|
*/
|
|
15185
15196
|
forEach(callback) {
|
|
15197
|
+
if (this._size.length === 1) {
|
|
15198
|
+
this._data.forEach((val, i) => callback(val, [i], this));
|
|
15199
|
+
return;
|
|
15200
|
+
}
|
|
15186
15201
|
this._data.forEach((row2, i) => {
|
|
15187
15202
|
row2.forEach((val, j) => callback(val, [i, j], this));
|
|
15188
15203
|
});
|
|
@@ -15220,7 +15235,9 @@ var MathJSDenseMatrix = class _MathJSDenseMatrix {
|
|
|
15220
15235
|
* Deep clone.
|
|
15221
15236
|
*/
|
|
15222
15237
|
clone() {
|
|
15223
|
-
const
|
|
15238
|
+
const copy = this._size.length === 1 ? [...this._data] : this._data.map((row2) => [...row2]);
|
|
15239
|
+
const m = new _MathJSDenseMatrix(copy);
|
|
15240
|
+
m._size = [...this._size];
|
|
15224
15241
|
m._datatype = this._datatype;
|
|
15225
15242
|
return m;
|
|
15226
15243
|
}
|
|
@@ -17670,12 +17687,12 @@ var dependencies5 = ["typed", "Complex"];
|
|
|
17670
17687
|
var createExpm1 = /* @__PURE__ */ factory(
|
|
17671
17688
|
name5,
|
|
17672
17689
|
dependencies5,
|
|
17673
|
-
({ typed: typed3, Complex:
|
|
17690
|
+
({ typed: typed3, Complex: Complex9 }) => {
|
|
17674
17691
|
return typed3(name5, {
|
|
17675
17692
|
number: expm1Number,
|
|
17676
17693
|
Complex: function(x) {
|
|
17677
17694
|
const r = Math.exp(x.re);
|
|
17678
|
-
return new
|
|
17695
|
+
return new Complex9(r * Math.cos(x.im) - 1, r * Math.sin(x.im));
|
|
17679
17696
|
},
|
|
17680
17697
|
BigNumber: function(x) {
|
|
17681
17698
|
return x.exp().minus(1);
|
|
@@ -17704,12 +17721,12 @@ var log16 = log10Number(16);
|
|
|
17704
17721
|
var createLog10 = /* @__PURE__ */ factory(
|
|
17705
17722
|
name6,
|
|
17706
17723
|
dependencies6,
|
|
17707
|
-
({ typed: typed3, config, Complex:
|
|
17724
|
+
({ typed: typed3, config, Complex: Complex9 }) => {
|
|
17708
17725
|
function complexLog(c) {
|
|
17709
17726
|
return c.log().div(Math.LN10);
|
|
17710
17727
|
}
|
|
17711
17728
|
function complexLogNumber(x) {
|
|
17712
|
-
return complexLog(new
|
|
17729
|
+
return complexLog(new Complex9(x, 0));
|
|
17713
17730
|
}
|
|
17714
17731
|
return typed3(name6, {
|
|
17715
17732
|
number: function(x) {
|
|
@@ -17741,9 +17758,9 @@ var dependencies7 = ["typed", "config", "Complex"];
|
|
|
17741
17758
|
var createLog2 = /* @__PURE__ */ factory(
|
|
17742
17759
|
name7,
|
|
17743
17760
|
dependencies7,
|
|
17744
|
-
({ typed: typed3, config, Complex:
|
|
17761
|
+
({ typed: typed3, config, Complex: Complex9 }) => {
|
|
17745
17762
|
function complexLog2Number(x) {
|
|
17746
|
-
return _log2Complex(new
|
|
17763
|
+
return _log2Complex(new Complex9(x, 0));
|
|
17747
17764
|
}
|
|
17748
17765
|
return typed3(name7, {
|
|
17749
17766
|
number: function(x) {
|
|
@@ -17768,7 +17785,7 @@ var createLog2 = /* @__PURE__ */ factory(
|
|
|
17768
17785
|
});
|
|
17769
17786
|
function _log2Complex(x) {
|
|
17770
17787
|
const newX = Math.sqrt(x.re * x.re + x.im * x.im);
|
|
17771
|
-
return new
|
|
17788
|
+
return new Complex9(
|
|
17772
17789
|
Math.log2 ? Math.log2(newX) : Math.log(newX) / Math.LN2,
|
|
17773
17790
|
Math.atan2(x.im, x.re) / Math.LN2
|
|
17774
17791
|
);
|
|
@@ -17844,7 +17861,7 @@ var dependencies10 = ["config", "typed", "Complex"];
|
|
|
17844
17861
|
var createSqrt = /* @__PURE__ */ factory(
|
|
17845
17862
|
name10,
|
|
17846
17863
|
dependencies10,
|
|
17847
|
-
({ config, typed: typed3, Complex:
|
|
17864
|
+
({ config, typed: typed3, Complex: Complex9 }) => {
|
|
17848
17865
|
return typed3("sqrt", {
|
|
17849
17866
|
number: _sqrtNumber,
|
|
17850
17867
|
Complex: function(x) {
|
|
@@ -17867,7 +17884,7 @@ var createSqrt = /* @__PURE__ */ factory(
|
|
|
17867
17884
|
} else if (x >= 0 || config.predictable) {
|
|
17868
17885
|
return Math.sqrt(x);
|
|
17869
17886
|
} else {
|
|
17870
|
-
return new
|
|
17887
|
+
return new Complex9(x, 0).sqrt();
|
|
17871
17888
|
}
|
|
17872
17889
|
}
|
|
17873
17890
|
}
|
|
@@ -18859,7 +18876,7 @@ var dependencies29 = ["Complex", "typed"];
|
|
|
18859
18876
|
var createLgamma = /* @__PURE__ */ factory(
|
|
18860
18877
|
name29,
|
|
18861
18878
|
dependencies29,
|
|
18862
|
-
({ Complex:
|
|
18879
|
+
({ Complex: Complex9, typed: typed3 }) => {
|
|
18863
18880
|
const SMALL_RE = 7;
|
|
18864
18881
|
const SMALL_IM = 7;
|
|
18865
18882
|
const coeffs = [
|
|
@@ -18905,16 +18922,16 @@ var createLgamma = /* @__PURE__ */ factory(
|
|
|
18905
18922
|
const LOGPI = 1.1447298858494002;
|
|
18906
18923
|
const REFLECTION = 0.1;
|
|
18907
18924
|
if (n.isNaN()) {
|
|
18908
|
-
return new
|
|
18925
|
+
return new Complex9(NaN, NaN);
|
|
18909
18926
|
} else if (n.im === 0) {
|
|
18910
|
-
return new
|
|
18927
|
+
return new Complex9(lgammaNumber(n.re), 0);
|
|
18911
18928
|
} else if (n.re >= SMALL_RE || Math.abs(n.im) >= SMALL_IM) {
|
|
18912
18929
|
return lgammaStirling(n);
|
|
18913
18930
|
} else if (n.re <= REFLECTION) {
|
|
18914
18931
|
const tmp = copysign(TWOPI, n.im) * Math.floor(0.5 * n.re + 0.25);
|
|
18915
18932
|
const a = n.mul(Math.PI).sin().log();
|
|
18916
|
-
const b = lgammaComplex(new
|
|
18917
|
-
return new
|
|
18933
|
+
const b = lgammaComplex(new Complex9(1 - n.re, -n.im));
|
|
18934
|
+
return new Complex9(LOGPI, tmp).sub(a).sub(b);
|
|
18918
18935
|
} else if (n.im >= 0) {
|
|
18919
18936
|
return lgammaRecurrence(n);
|
|
18920
18937
|
} else {
|
|
@@ -18923,7 +18940,7 @@ var createLgamma = /* @__PURE__ */ factory(
|
|
|
18923
18940
|
}
|
|
18924
18941
|
function lgammaStirling(z) {
|
|
18925
18942
|
const leftPart = z.sub(0.5).mul(z.log()).sub(z).add(lnSqrt2PI);
|
|
18926
|
-
const rz = new
|
|
18943
|
+
const rz = new Complex9(1, 0).div(z);
|
|
18927
18944
|
const rzz = rz.div(z);
|
|
18928
18945
|
let a = coeffs[0];
|
|
18929
18946
|
let b = coeffs[1];
|
|
@@ -18949,7 +18966,7 @@ var createLgamma = /* @__PURE__ */ factory(
|
|
|
18949
18966
|
sb = nsb;
|
|
18950
18967
|
z = z.add(1);
|
|
18951
18968
|
}
|
|
18952
|
-
return lgammaStirling(z).sub(shiftprod.log()).sub(new
|
|
18969
|
+
return lgammaStirling(z).sub(shiftprod.log()).sub(new Complex9(0, signflips * 2 * Math.PI * 1));
|
|
18953
18970
|
}
|
|
18954
18971
|
}
|
|
18955
18972
|
);
|
|
@@ -19391,13 +19408,13 @@ var dependencies36 = ["typed", "config", "Complex"];
|
|
|
19391
19408
|
var createAcos = /* @__PURE__ */ factory(
|
|
19392
19409
|
name36,
|
|
19393
19410
|
dependencies36,
|
|
19394
|
-
({ typed: typed3, config, Complex:
|
|
19411
|
+
({ typed: typed3, config, Complex: Complex9 }) => {
|
|
19395
19412
|
return typed3(name36, {
|
|
19396
19413
|
number: function(x) {
|
|
19397
19414
|
if (x >= -1 && x <= 1 || config.predictable) {
|
|
19398
19415
|
return Math.acos(x);
|
|
19399
19416
|
} else {
|
|
19400
|
-
return new
|
|
19417
|
+
return new Complex9(x, 0).acos();
|
|
19401
19418
|
}
|
|
19402
19419
|
},
|
|
19403
19420
|
Complex: function(x) {
|
|
@@ -19416,16 +19433,16 @@ var dependencies37 = ["typed", "config", "Complex"];
|
|
|
19416
19433
|
var createAcosh = /* @__PURE__ */ factory(
|
|
19417
19434
|
name37,
|
|
19418
19435
|
dependencies37,
|
|
19419
|
-
({ typed: typed3, config, Complex:
|
|
19436
|
+
({ typed: typed3, config, Complex: Complex9 }) => {
|
|
19420
19437
|
return typed3(name37, {
|
|
19421
19438
|
number: function(x) {
|
|
19422
19439
|
if (x >= 1 || config.predictable) {
|
|
19423
19440
|
return acoshNumber(x);
|
|
19424
19441
|
}
|
|
19425
19442
|
if (x <= -1) {
|
|
19426
|
-
return new
|
|
19443
|
+
return new Complex9(Math.log(Math.sqrt(x * x - 1) - x), Math.PI);
|
|
19427
19444
|
}
|
|
19428
|
-
return new
|
|
19445
|
+
return new Complex9(x, 0).acosh();
|
|
19429
19446
|
},
|
|
19430
19447
|
Complex: function(x) {
|
|
19431
19448
|
return x.acosh();
|
|
@@ -19462,13 +19479,13 @@ var dependencies39 = ["typed", "config", "Complex", "BigNumber"];
|
|
|
19462
19479
|
var createAcoth = /* @__PURE__ */ factory(
|
|
19463
19480
|
name39,
|
|
19464
19481
|
dependencies39,
|
|
19465
|
-
({ typed: typed3, config, Complex:
|
|
19482
|
+
({ typed: typed3, config, Complex: Complex9, BigNumber: BigNumber9 }) => {
|
|
19466
19483
|
return typed3(name39, {
|
|
19467
19484
|
number: function(x) {
|
|
19468
19485
|
if (x >= 1 || x <= -1 || config.predictable) {
|
|
19469
19486
|
return acothNumber(x);
|
|
19470
19487
|
}
|
|
19471
|
-
return new
|
|
19488
|
+
return new Complex9(x, 0).acoth();
|
|
19472
19489
|
},
|
|
19473
19490
|
Complex: function(x) {
|
|
19474
19491
|
return x.acoth();
|
|
@@ -19486,13 +19503,13 @@ var dependencies40 = ["typed", "config", "Complex", "BigNumber"];
|
|
|
19486
19503
|
var createAcsc = /* @__PURE__ */ factory(
|
|
19487
19504
|
name40,
|
|
19488
19505
|
dependencies40,
|
|
19489
|
-
({ typed: typed3, config, Complex:
|
|
19506
|
+
({ typed: typed3, config, Complex: Complex9, BigNumber: BigNumber9 }) => {
|
|
19490
19507
|
return typed3(name40, {
|
|
19491
19508
|
number: function(x) {
|
|
19492
19509
|
if (x <= -1 || x >= 1 || config.predictable) {
|
|
19493
19510
|
return acscNumber(x);
|
|
19494
19511
|
}
|
|
19495
|
-
return new
|
|
19512
|
+
return new Complex9(x, 0).acsc();
|
|
19496
19513
|
},
|
|
19497
19514
|
Complex: function(x) {
|
|
19498
19515
|
return x.acsc();
|
|
@@ -19529,13 +19546,13 @@ var dependencies42 = ["typed", "config", "Complex", "BigNumber"];
|
|
|
19529
19546
|
var createAsec = /* @__PURE__ */ factory(
|
|
19530
19547
|
name42,
|
|
19531
19548
|
dependencies42,
|
|
19532
|
-
({ typed: typed3, config, Complex:
|
|
19549
|
+
({ typed: typed3, config, Complex: Complex9, BigNumber: BigNumber9 }) => {
|
|
19533
19550
|
return typed3(name42, {
|
|
19534
19551
|
number: function(x) {
|
|
19535
19552
|
if (x <= -1 || x >= 1 || config.predictable) {
|
|
19536
19553
|
return asecNumber(x);
|
|
19537
19554
|
}
|
|
19538
|
-
return new
|
|
19555
|
+
return new Complex9(x, 0).asec();
|
|
19539
19556
|
},
|
|
19540
19557
|
Complex: function(x) {
|
|
19541
19558
|
return x.asec();
|
|
@@ -19553,7 +19570,7 @@ var dependencies43 = ["typed", "config", "Complex", "BigNumber"];
|
|
|
19553
19570
|
var createAsech = /* @__PURE__ */ factory(
|
|
19554
19571
|
name43,
|
|
19555
19572
|
dependencies43,
|
|
19556
|
-
({ typed: typed3, config, Complex:
|
|
19573
|
+
({ typed: typed3, config, Complex: Complex9, BigNumber: BigNumber9 }) => {
|
|
19557
19574
|
return typed3(name43, {
|
|
19558
19575
|
number: function(x) {
|
|
19559
19576
|
if (x <= 1 && x >= -1 || config.predictable) {
|
|
@@ -19562,9 +19579,9 @@ var createAsech = /* @__PURE__ */ factory(
|
|
|
19562
19579
|
return asechNumber(x);
|
|
19563
19580
|
}
|
|
19564
19581
|
const ret = Math.sqrt(xInv * xInv - 1);
|
|
19565
|
-
return new
|
|
19582
|
+
return new Complex9(Math.log(ret - xInv), Math.PI);
|
|
19566
19583
|
}
|
|
19567
|
-
return new
|
|
19584
|
+
return new Complex9(x, 0).asech();
|
|
19568
19585
|
},
|
|
19569
19586
|
Complex: function(x) {
|
|
19570
19587
|
return x.asech();
|
|
@@ -19582,13 +19599,13 @@ var dependencies44 = ["typed", "config", "Complex"];
|
|
|
19582
19599
|
var createAsin = /* @__PURE__ */ factory(
|
|
19583
19600
|
name44,
|
|
19584
19601
|
dependencies44,
|
|
19585
|
-
({ typed: typed3, config, Complex:
|
|
19602
|
+
({ typed: typed3, config, Complex: Complex9 }) => {
|
|
19586
19603
|
return typed3(name44, {
|
|
19587
19604
|
number: function(x) {
|
|
19588
19605
|
if (x >= -1 && x <= 1 || config.predictable) {
|
|
19589
19606
|
return Math.asin(x);
|
|
19590
19607
|
} else {
|
|
19591
|
-
return new
|
|
19608
|
+
return new Complex9(x, 0).asin();
|
|
19592
19609
|
}
|
|
19593
19610
|
},
|
|
19594
19611
|
Complex: function(x) {
|
|
@@ -19647,13 +19664,13 @@ var dependencies47 = ["typed", "config", "Complex"];
|
|
|
19647
19664
|
var createAtanh = /* @__PURE__ */ factory(
|
|
19648
19665
|
name47,
|
|
19649
19666
|
dependencies47,
|
|
19650
|
-
({ typed: typed3, config, Complex:
|
|
19667
|
+
({ typed: typed3, config, Complex: Complex9 }) => {
|
|
19651
19668
|
return typed3(name47, {
|
|
19652
19669
|
number: function(x) {
|
|
19653
19670
|
if (x <= 1 && x >= -1 || config.predictable) {
|
|
19654
19671
|
return atanhNumber(x);
|
|
19655
19672
|
}
|
|
19656
|
-
return new
|
|
19673
|
+
return new Complex9(x, 0).atanh();
|
|
19657
19674
|
},
|
|
19658
19675
|
Complex: function(x) {
|
|
19659
19676
|
return x.atanh();
|
|
@@ -23377,7 +23394,7 @@ var createCbrt = /* @__PURE__ */ factory(
|
|
|
23377
23394
|
isNegative: isNegative2,
|
|
23378
23395
|
unaryMinus: unaryMinus2,
|
|
23379
23396
|
matrix: matrix2,
|
|
23380
|
-
Complex:
|
|
23397
|
+
Complex: Complex9,
|
|
23381
23398
|
BigNumber: BigNumber9,
|
|
23382
23399
|
Fraction: Fraction5
|
|
23383
23400
|
}) => {
|
|
@@ -23395,12 +23412,12 @@ var createCbrt = /* @__PURE__ */ factory(
|
|
|
23395
23412
|
function _cbrtComplex(x, allRoots) {
|
|
23396
23413
|
const arg3 = x.arg() / 3;
|
|
23397
23414
|
const abs2 = x.abs();
|
|
23398
|
-
const principal = new
|
|
23415
|
+
const principal = new Complex9(cbrtNumber(abs2), 0).mul(new Complex9(0, arg3).exp());
|
|
23399
23416
|
if (allRoots) {
|
|
23400
23417
|
const all = [
|
|
23401
23418
|
principal,
|
|
23402
|
-
new
|
|
23403
|
-
new
|
|
23419
|
+
new Complex9(cbrtNumber(abs2), 0).mul(new Complex9(0, arg3 + Math.PI * 2 / 3).exp()),
|
|
23420
|
+
new Complex9(cbrtNumber(abs2), 0).mul(new Complex9(0, arg3 - Math.PI * 2 / 3).exp())
|
|
23404
23421
|
];
|
|
23405
23422
|
return config.matrix === "Array" ? all : matrix2(all);
|
|
23406
23423
|
} else {
|
|
@@ -23449,27 +23466,27 @@ var createNthRoots = /* @__PURE__ */ factory(
|
|
|
23449
23466
|
typed: typed3,
|
|
23450
23467
|
config: _config,
|
|
23451
23468
|
divideScalar: _divideScalar,
|
|
23452
|
-
Complex:
|
|
23469
|
+
Complex: Complex9
|
|
23453
23470
|
}) => {
|
|
23454
23471
|
const _calculateExactResult = [
|
|
23455
23472
|
function realPos(val) {
|
|
23456
|
-
return new
|
|
23473
|
+
return new Complex9(val, 0);
|
|
23457
23474
|
},
|
|
23458
23475
|
function imagPos(val) {
|
|
23459
|
-
return new
|
|
23476
|
+
return new Complex9(0, val);
|
|
23460
23477
|
},
|
|
23461
23478
|
function realNeg(val) {
|
|
23462
|
-
return new
|
|
23479
|
+
return new Complex9(-val, 0);
|
|
23463
23480
|
},
|
|
23464
23481
|
function imagNeg(val) {
|
|
23465
|
-
return new
|
|
23482
|
+
return new Complex9(0, -val);
|
|
23466
23483
|
}
|
|
23467
23484
|
];
|
|
23468
23485
|
function _nthComplexRoots(a, root) {
|
|
23469
23486
|
if (root < 0) throw new Error("Root must be greater than zero");
|
|
23470
23487
|
if (root === 0) throw new Error("Root must be non-zero");
|
|
23471
23488
|
if (root % 1 !== 0) throw new Error("Root must be an integer");
|
|
23472
|
-
if (a === 0 || a.abs() === 0) return [new
|
|
23489
|
+
if (a === 0 || a.abs() === 0) return [new Complex9(0, 0)];
|
|
23473
23490
|
const aIsNumeric = typeof a === "number";
|
|
23474
23491
|
let offset;
|
|
23475
23492
|
if (aIsNumeric || a.re === 0 || a.im === 0) {
|
|
@@ -23491,7 +23508,7 @@ var createNthRoots = /* @__PURE__ */ factory(
|
|
|
23491
23508
|
roots.push(_calculateExactResult[halfPiFactor % 4](r));
|
|
23492
23509
|
continue;
|
|
23493
23510
|
}
|
|
23494
|
-
roots.push(new
|
|
23511
|
+
roots.push(new Complex9({ r, phi: (arg3 + 2 * Math.PI * k) / root }));
|
|
23495
23512
|
}
|
|
23496
23513
|
return roots;
|
|
23497
23514
|
}
|
|
@@ -23878,12 +23895,12 @@ var nlg16 = Math.log(16);
|
|
|
23878
23895
|
var createLog = /* @__PURE__ */ factory(
|
|
23879
23896
|
name112,
|
|
23880
23897
|
dependencies112,
|
|
23881
|
-
({ typed: typed3, typeOf: typeOf3, config, divideScalar: divideScalar2, Complex:
|
|
23898
|
+
({ typed: typed3, typeOf: typeOf3, config, divideScalar: divideScalar2, Complex: Complex9 }) => {
|
|
23882
23899
|
function complexLog(c) {
|
|
23883
23900
|
return c.log();
|
|
23884
23901
|
}
|
|
23885
23902
|
function complexLogNumber(x) {
|
|
23886
|
-
return complexLog(new
|
|
23903
|
+
return complexLog(new Complex9(x, 0));
|
|
23887
23904
|
}
|
|
23888
23905
|
return typed3(name112, {
|
|
23889
23906
|
number: function(x) {
|
|
@@ -25129,7 +25146,7 @@ var dependencies126 = ["typed", "add", "multiply", "Complex", "number"];
|
|
|
25129
25146
|
var createZpk2tf = /* @__PURE__ */ factory(
|
|
25130
25147
|
name126,
|
|
25131
25148
|
dependencies126,
|
|
25132
|
-
({ typed: typed3, add: add2, multiply: multiply2, Complex:
|
|
25149
|
+
({ typed: typed3, add: add2, multiply: multiply2, Complex: Complex9, number: number2 }) => {
|
|
25133
25150
|
return typed3(name126, {
|
|
25134
25151
|
"Array,Array,number": function(z, p, k) {
|
|
25135
25152
|
return _zpk2tf(z, p, k);
|
|
@@ -25151,17 +25168,17 @@ var createZpk2tf = /* @__PURE__ */ factory(
|
|
|
25151
25168
|
if (p.some((el) => el.type === "BigNumber")) {
|
|
25152
25169
|
p = p.map((el) => number2(el));
|
|
25153
25170
|
}
|
|
25154
|
-
let num = [
|
|
25155
|
-
let den = [
|
|
25171
|
+
let num = [Complex9(1, 0)];
|
|
25172
|
+
let den = [Complex9(1, 0)];
|
|
25156
25173
|
for (let i = 0; i < z.length; i++) {
|
|
25157
25174
|
let zero = z[i];
|
|
25158
|
-
if (typeof zero === "number") zero =
|
|
25159
|
-
num = _multiply(num, [
|
|
25175
|
+
if (typeof zero === "number") zero = Complex9(zero, 0);
|
|
25176
|
+
num = _multiply(num, [Complex9(1, 0), Complex9(-zero.re, -zero.im)]);
|
|
25160
25177
|
}
|
|
25161
25178
|
for (let i = 0; i < p.length; i++) {
|
|
25162
25179
|
let pole = p[i];
|
|
25163
|
-
if (typeof pole === "number") pole =
|
|
25164
|
-
den = _multiply(den, [
|
|
25180
|
+
if (typeof pole === "number") pole = Complex9(pole, 0);
|
|
25181
|
+
den = _multiply(den, [Complex9(1, 0), Complex9(-pole.re, -pole.im)]);
|
|
25165
25182
|
}
|
|
25166
25183
|
for (let i = 0; i < num.length; i++) {
|
|
25167
25184
|
num[i] = multiply2(num[i], k);
|
|
@@ -25171,7 +25188,7 @@ var createZpk2tf = /* @__PURE__ */ factory(
|
|
|
25171
25188
|
function _multiply(a, b) {
|
|
25172
25189
|
const c = [];
|
|
25173
25190
|
for (let i = 0; i < a.length + b.length - 1; i++) {
|
|
25174
|
-
c[i] =
|
|
25191
|
+
c[i] = Complex9(0, 0);
|
|
25175
25192
|
for (let j = 0; j < a.length; j++) {
|
|
25176
25193
|
if (i - j >= 0 && i - j < b.length) {
|
|
25177
25194
|
c[i] = add2(c[i], multiply2(a[j], b[i - j]));
|
|
@@ -26414,13 +26431,13 @@ var dependencies142 = ["typed", "config", "divideScalar", "log", "Complex"];
|
|
|
26414
26431
|
var createLog1p = /* @__PURE__ */ factory(
|
|
26415
26432
|
name142,
|
|
26416
26433
|
dependencies142,
|
|
26417
|
-
({ typed: typed3, config, divideScalar: divideScalar2, log: log3, Complex:
|
|
26434
|
+
({ typed: typed3, config, divideScalar: divideScalar2, log: log3, Complex: Complex9 }) => {
|
|
26418
26435
|
return typed3(name142, {
|
|
26419
26436
|
number: function(x) {
|
|
26420
26437
|
if (x >= -1 || config.predictable) {
|
|
26421
26438
|
return log1p2(x);
|
|
26422
26439
|
} else {
|
|
26423
|
-
return _log1pComplex(new
|
|
26440
|
+
return _log1pComplex(new Complex9(x, 0));
|
|
26424
26441
|
}
|
|
26425
26442
|
},
|
|
26426
26443
|
Complex: _log1pComplex,
|
|
@@ -26429,7 +26446,7 @@ var createLog1p = /* @__PURE__ */ factory(
|
|
|
26429
26446
|
if (!y.isNegative() || config.predictable) {
|
|
26430
26447
|
return y.ln();
|
|
26431
26448
|
} else {
|
|
26432
|
-
return _log1pComplex(new
|
|
26449
|
+
return _log1pComplex(new Complex9(x.toNumber(), 0));
|
|
26433
26450
|
}
|
|
26434
26451
|
},
|
|
26435
26452
|
"Array | Matrix": typed3.referToSelf(
|
|
@@ -26443,7 +26460,7 @@ var createLog1p = /* @__PURE__ */ factory(
|
|
|
26443
26460
|
});
|
|
26444
26461
|
function _log1pComplex(x) {
|
|
26445
26462
|
const xRe1p = x.re + 1;
|
|
26446
|
-
return new
|
|
26463
|
+
return new Complex9(Math.log(Math.sqrt(xRe1p * xRe1p + x.im * x.im)), Math.atan2(x.im, xRe1p));
|
|
26447
26464
|
}
|
|
26448
26465
|
}
|
|
26449
26466
|
);
|
|
@@ -26576,7 +26593,7 @@ var createPow = /* @__PURE__ */ factory(
|
|
|
26576
26593
|
inv: inv2,
|
|
26577
26594
|
number: number2,
|
|
26578
26595
|
fraction: fraction2,
|
|
26579
|
-
Complex:
|
|
26596
|
+
Complex: Complex9
|
|
26580
26597
|
}) => {
|
|
26581
26598
|
return typed3(name144, {
|
|
26582
26599
|
"number, number": _pow,
|
|
@@ -26587,7 +26604,7 @@ var createPow = /* @__PURE__ */ factory(
|
|
|
26587
26604
|
if (y.isInteger() || x.gte(0) || config.predictable) {
|
|
26588
26605
|
return x.pow(y);
|
|
26589
26606
|
} else {
|
|
26590
|
-
return new
|
|
26607
|
+
return new Complex9(x.toNumber(), 0).pow(y.toNumber(), 0);
|
|
26591
26608
|
}
|
|
26592
26609
|
},
|
|
26593
26610
|
"bigint, bigint": (x, y) => x ** y,
|
|
@@ -26636,7 +26653,7 @@ var createPow = /* @__PURE__ */ factory(
|
|
|
26636
26653
|
if (isPowZeroAtInfinity(x, y)) {
|
|
26637
26654
|
return 0;
|
|
26638
26655
|
}
|
|
26639
|
-
return new
|
|
26656
|
+
return new Complex9(x, 0).pow(y, 0);
|
|
26640
26657
|
}
|
|
26641
26658
|
}
|
|
26642
26659
|
function _powArray(x, y) {
|
|
@@ -28037,7 +28054,7 @@ var createFixNumber = /* @__PURE__ */ factory(
|
|
|
28037
28054
|
var createFix = /* @__PURE__ */ factory(
|
|
28038
28055
|
name167,
|
|
28039
28056
|
dependencies167,
|
|
28040
|
-
({ typed: typed3, Complex:
|
|
28057
|
+
({ typed: typed3, Complex: Complex9, matrix: matrix2, ceil: ceil2, floor: floor2, equalScalar: equalScalar3, zeros: zeros3, DenseMatrix: DenseMatrix3 }) => {
|
|
28041
28058
|
const matAlgo12xSfs = createMatAlgo12xSfs({ typed: typed3, DenseMatrix: DenseMatrix3 });
|
|
28042
28059
|
const matAlgo14xDs = createMatAlgo14xDs({ typed: typed3 });
|
|
28043
28060
|
const fixNumber = createFixNumber({ typed: typed3, ceil: ceil2, floor: floor2 });
|
|
@@ -28045,20 +28062,20 @@ var createFix = /* @__PURE__ */ factory(
|
|
|
28045
28062
|
number: fixNumber.signatures.number,
|
|
28046
28063
|
"number, number | BigNumber": fixNumber.signatures["number,number"],
|
|
28047
28064
|
Complex: function(x) {
|
|
28048
|
-
return new
|
|
28065
|
+
return new Complex9(
|
|
28049
28066
|
x.re > 0 ? Math.floor(x.re) : Math.ceil(x.re),
|
|
28050
28067
|
x.im > 0 ? Math.floor(x.im) : Math.ceil(x.im)
|
|
28051
28068
|
);
|
|
28052
28069
|
},
|
|
28053
28070
|
"Complex, number": function(x, n) {
|
|
28054
|
-
return new
|
|
28071
|
+
return new Complex9(
|
|
28055
28072
|
x.re > 0 ? floor2(x.re, n) : ceil2(x.re, n),
|
|
28056
28073
|
x.im > 0 ? floor2(x.im, n) : ceil2(x.im, n)
|
|
28057
28074
|
);
|
|
28058
28075
|
},
|
|
28059
28076
|
"Complex, BigNumber": function(x, bn) {
|
|
28060
28077
|
const n = bn.toNumber();
|
|
28061
|
-
return new
|
|
28078
|
+
return new Complex9(
|
|
28062
28079
|
x.re > 0 ? floor2(x.re, n) : ceil2(x.re, n),
|
|
28063
28080
|
x.im > 0 ? floor2(x.im, n) : ceil2(x.im, n)
|
|
28064
28081
|
);
|
|
@@ -28428,7 +28445,7 @@ var createPinv = /* @__PURE__ */ factory(
|
|
|
28428
28445
|
divideScalar: divideScalar2,
|
|
28429
28446
|
multiply: multiply2,
|
|
28430
28447
|
add: add2,
|
|
28431
|
-
Complex:
|
|
28448
|
+
Complex: Complex9
|
|
28432
28449
|
}) => {
|
|
28433
28450
|
return typed3(name172, {
|
|
28434
28451
|
"Array | Matrix": function(x) {
|
|
@@ -28523,12 +28540,12 @@ var createPinv = /* @__PURE__ */ factory(
|
|
|
28523
28540
|
return { C, F };
|
|
28524
28541
|
}
|
|
28525
28542
|
function _isZero(x) {
|
|
28526
|
-
return equal2(add2(x,
|
|
28543
|
+
return equal2(add2(x, Complex9(1, 1)), add2(0, Complex9(1, 1)));
|
|
28527
28544
|
}
|
|
28528
28545
|
function _isZeros(arr) {
|
|
28529
28546
|
return deepEqual3(
|
|
28530
|
-
add2(arr,
|
|
28531
|
-
add2(multiply2(arr, 0),
|
|
28547
|
+
add2(arr, Complex9(1, 1)),
|
|
28548
|
+
add2(multiply2(arr, 0), Complex9(1, 1))
|
|
28532
28549
|
);
|
|
28533
28550
|
}
|
|
28534
28551
|
}
|
|
@@ -28919,25 +28936,25 @@ var createGamma = /* @__PURE__ */ factory(
|
|
|
28919
28936
|
multiplyScalar: _multiplyScalar,
|
|
28920
28937
|
pow: _pow,
|
|
28921
28938
|
BigNumber: BigNumber9,
|
|
28922
|
-
Complex:
|
|
28939
|
+
Complex: Complex9
|
|
28923
28940
|
}) => {
|
|
28924
28941
|
function gammaComplex(n) {
|
|
28925
28942
|
if (n.im === 0) {
|
|
28926
28943
|
return gammaNumber(n.re);
|
|
28927
28944
|
}
|
|
28928
28945
|
if (n.re < 0.5) {
|
|
28929
|
-
const t2 = new
|
|
28930
|
-
const r = new
|
|
28946
|
+
const t2 = new Complex9(1 - n.re, -n.im);
|
|
28947
|
+
const r = new Complex9(Math.PI * n.re, Math.PI * n.im);
|
|
28931
28948
|
const gammaT = gammaComplex(t2);
|
|
28932
|
-
return new
|
|
28949
|
+
return new Complex9(Math.PI).div(r.sin()).div(gammaT);
|
|
28933
28950
|
}
|
|
28934
|
-
const z = new
|
|
28935
|
-
let x = new
|
|
28951
|
+
const z = new Complex9(n.re - 1, n.im);
|
|
28952
|
+
let x = new Complex9(gammaP[0], 0);
|
|
28936
28953
|
for (let i = 1; i < gammaP.length; ++i) {
|
|
28937
|
-
const gammaPval = new
|
|
28954
|
+
const gammaPval = new Complex9(gammaP[i], 0);
|
|
28938
28955
|
x = x.add(gammaPval.div(z.add(i)));
|
|
28939
28956
|
}
|
|
28940
|
-
const t = new
|
|
28957
|
+
const t = new Complex9(z.re + gammaG + 0.5, z.im);
|
|
28941
28958
|
const twoPiSqrt = Math.sqrt(2 * Math.PI);
|
|
28942
28959
|
const tpow = t.pow(z.add(0.5));
|
|
28943
28960
|
const expt = t.neg().exp();
|
|
@@ -32001,7 +32018,7 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
32001
32018
|
isNumeric: isNumeric2,
|
|
32002
32019
|
format: format6,
|
|
32003
32020
|
number: number2,
|
|
32004
|
-
Complex:
|
|
32021
|
+
Complex: Complex9,
|
|
32005
32022
|
BigNumber: BigNumber9,
|
|
32006
32023
|
Fraction: Fraction5
|
|
32007
32024
|
}) => {
|
|
@@ -34110,7 +34127,7 @@ var createUnitClass = /* @__PURE__ */ factory(
|
|
|
34110
34127
|
name: "VAR",
|
|
34111
34128
|
base: BASE_UNITS.POWER,
|
|
34112
34129
|
prefixes: PREFIXES.SHORT,
|
|
34113
|
-
value:
|
|
34130
|
+
value: Complex9.I,
|
|
34114
34131
|
offset: 0
|
|
34115
34132
|
},
|
|
34116
34133
|
VA: {
|
|
@@ -37186,7 +37203,7 @@ var dependencies226 = ["typed", "add", "multiply", "Complex", "divide", "matrix"
|
|
|
37186
37203
|
var createFreqz = /* @__PURE__ */ factory(
|
|
37187
37204
|
name226,
|
|
37188
37205
|
dependencies226,
|
|
37189
|
-
({ typed: typed3, add: add2, multiply: multiply2, Complex:
|
|
37206
|
+
({ typed: typed3, add: add2, multiply: multiply2, Complex: Complex9, divide: divide2, matrix: matrix2 }) => {
|
|
37190
37207
|
return typed3(name226, {
|
|
37191
37208
|
"Array, Array": function(b, a) {
|
|
37192
37209
|
const w = createBins(512);
|
|
@@ -37255,7 +37272,7 @@ var createFreqz = /* @__PURE__ */ factory(
|
|
|
37255
37272
|
);
|
|
37256
37273
|
const h = [];
|
|
37257
37274
|
for (let i = 0; i < w.length; i++) {
|
|
37258
|
-
h.push(
|
|
37275
|
+
h.push(Complex9(hRealAlloc.array[i], hImagAlloc.array[i]));
|
|
37259
37276
|
}
|
|
37260
37277
|
return { h, w };
|
|
37261
37278
|
} finally {
|
|
@@ -37277,18 +37294,18 @@ var createFreqz = /* @__PURE__ */ factory(
|
|
|
37277
37294
|
const num = [];
|
|
37278
37295
|
const den = [];
|
|
37279
37296
|
for (let i = 0; i < w.length; i++) {
|
|
37280
|
-
let sumNum =
|
|
37281
|
-
let sumDen =
|
|
37297
|
+
let sumNum = Complex9(0, 0);
|
|
37298
|
+
let sumDen = Complex9(0, 0);
|
|
37282
37299
|
for (let j = 0; j < b.length; j++) {
|
|
37283
37300
|
sumNum = add2(
|
|
37284
37301
|
sumNum,
|
|
37285
|
-
multiply2(b[j],
|
|
37302
|
+
multiply2(b[j], Complex9(Math.cos(-j * w[i]), Math.sin(-j * w[i])))
|
|
37286
37303
|
);
|
|
37287
37304
|
}
|
|
37288
37305
|
for (let j = 0; j < a.length; j++) {
|
|
37289
37306
|
sumDen = add2(
|
|
37290
37307
|
sumDen,
|
|
37291
|
-
multiply2(a[j],
|
|
37308
|
+
multiply2(a[j], Complex9(Math.cos(-j * w[i]), Math.sin(-j * w[i])))
|
|
37292
37309
|
);
|
|
37293
37310
|
}
|
|
37294
37311
|
num.push(sumNum);
|
|
@@ -38595,7 +38612,7 @@ var createZeta = /* @__PURE__ */ factory(
|
|
|
38595
38612
|
sin: sin2,
|
|
38596
38613
|
subtract: subtract2,
|
|
38597
38614
|
add: add2,
|
|
38598
|
-
Complex:
|
|
38615
|
+
Complex: Complex9,
|
|
38599
38616
|
BigNumber: BigNumber9,
|
|
38600
38617
|
pi
|
|
38601
38618
|
}) => {
|
|
@@ -38631,16 +38648,16 @@ var createZeta = /* @__PURE__ */ factory(
|
|
|
38631
38648
|
}
|
|
38632
38649
|
function zetaComplex(s) {
|
|
38633
38650
|
if (s.re === 0 && s.im === 0) {
|
|
38634
|
-
return new
|
|
38651
|
+
return new Complex9(-0.5);
|
|
38635
38652
|
}
|
|
38636
38653
|
if (s.re === 1) {
|
|
38637
|
-
return new
|
|
38654
|
+
return new Complex9(NaN, NaN);
|
|
38638
38655
|
}
|
|
38639
38656
|
if (s.re === Infinity && s.im === 0) {
|
|
38640
|
-
return new
|
|
38657
|
+
return new Complex9(1);
|
|
38641
38658
|
}
|
|
38642
38659
|
if (s.im === Infinity || s.re === -Infinity) {
|
|
38643
|
-
return new
|
|
38660
|
+
return new Complex9(NaN, NaN);
|
|
38644
38661
|
}
|
|
38645
38662
|
return zeta2(
|
|
38646
38663
|
s,
|
|
@@ -43744,6 +43761,7 @@ function reviver(_key, value) {
|
|
|
43744
43761
|
|
|
43745
43762
|
// src/typed/cas.ts
|
|
43746
43763
|
import { computePool as computePool13 } from "@danielsimonjr/mathts-parallel";
|
|
43764
|
+
import { Complex as Complex8 } from "@danielsimonjr/mathts-core";
|
|
43747
43765
|
function evalAt(expr, varName, value) {
|
|
43748
43766
|
return evaluate(expr, { [varName]: value });
|
|
43749
43767
|
}
|
|
@@ -44182,7 +44200,78 @@ function seriesCoefficient(expr, varName, x0, k) {
|
|
|
44182
44200
|
const deriv = numericalDerivative(expr, varName, x0, k);
|
|
44183
44201
|
return deriv / factorial3(k);
|
|
44184
44202
|
}
|
|
44185
|
-
function
|
|
44203
|
+
function realCbrt(x) {
|
|
44204
|
+
return x < 0 ? -Math.pow(-x, 1 / 3) : Math.pow(x, 1 / 3);
|
|
44205
|
+
}
|
|
44206
|
+
function quadraticRoots(a, b, c) {
|
|
44207
|
+
const disc = b * b - 4 * a * c;
|
|
44208
|
+
if (disc >= 0) {
|
|
44209
|
+
const s2 = Math.sqrt(disc);
|
|
44210
|
+
return [(-b + s2) / (2 * a), (-b - s2) / (2 * a)];
|
|
44211
|
+
}
|
|
44212
|
+
const s = Math.sqrt(-disc);
|
|
44213
|
+
const re3 = -b / (2 * a);
|
|
44214
|
+
const im3 = s / (2 * a);
|
|
44215
|
+
return [new Complex8(re3, im3), new Complex8(re3, -im3)];
|
|
44216
|
+
}
|
|
44217
|
+
function cubicRoots(a, b, c, d) {
|
|
44218
|
+
const B = b / a;
|
|
44219
|
+
const C = c / a;
|
|
44220
|
+
const D = d / a;
|
|
44221
|
+
const p = C - B * B / 3;
|
|
44222
|
+
const q = 2 * B * B * B / 27 - B * C / 3 + D;
|
|
44223
|
+
const shift = -B / 3;
|
|
44224
|
+
const disc = q * q / 4 + p * p * p / 27;
|
|
44225
|
+
if (Math.abs(disc) < 1e-12) {
|
|
44226
|
+
if (Math.abs(p) < 1e-12 && Math.abs(q) < 1e-12) return [shift];
|
|
44227
|
+
const u = realCbrt(-q / 2);
|
|
44228
|
+
return [2 * u + shift, -u + shift];
|
|
44229
|
+
}
|
|
44230
|
+
if (disc > 0) {
|
|
44231
|
+
const sq = Math.sqrt(disc);
|
|
44232
|
+
const u = realCbrt(-q / 2 + sq);
|
|
44233
|
+
const v = realCbrt(-q / 2 - sq);
|
|
44234
|
+
const realPart = -(u + v) / 2 + shift;
|
|
44235
|
+
const imagPart = (u - v) * Math.sqrt(3) / 2;
|
|
44236
|
+
return [u + v + shift, new Complex8(realPart, imagPart), new Complex8(realPart, -imagPart)];
|
|
44237
|
+
}
|
|
44238
|
+
const m = 2 * Math.sqrt(-p / 3);
|
|
44239
|
+
let arg3 = 3 * q / (2 * p) * Math.sqrt(-3 / p);
|
|
44240
|
+
arg3 = Math.max(-1, Math.min(1, arg3));
|
|
44241
|
+
const theta = Math.acos(arg3) / 3;
|
|
44242
|
+
return [0, 1, 2].map((k) => m * Math.cos(theta - 2 * Math.PI * k / 3) + shift);
|
|
44243
|
+
}
|
|
44244
|
+
function polyCoeffsDeg3(expr, varName) {
|
|
44245
|
+
const at = (x) => {
|
|
44246
|
+
const v = evalAt(expr, varName, x);
|
|
44247
|
+
return typeof v === "number" && Number.isFinite(v) ? v : NaN;
|
|
44248
|
+
};
|
|
44249
|
+
try {
|
|
44250
|
+
const f = [0, 1, 2, 3, 4].map(at);
|
|
44251
|
+
if (f.some((v) => !Number.isFinite(v))) return null;
|
|
44252
|
+
const d1 = f[1] - f[0];
|
|
44253
|
+
const d2 = f[2] - 2 * f[1] + f[0];
|
|
44254
|
+
const d3 = f[3] - 3 * f[2] + 3 * f[1] - f[0];
|
|
44255
|
+
const d4 = f[4] - 4 * f[3] + 6 * f[2] - 4 * f[1] + f[0];
|
|
44256
|
+
const scale = Math.max(1, ...f.map(Math.abs));
|
|
44257
|
+
if (Math.abs(d4) > 1e-7 * scale) return null;
|
|
44258
|
+
const c3 = d3 / 6;
|
|
44259
|
+
const c2 = d2 / 2 - d3 / 2;
|
|
44260
|
+
const c1 = d1 - d2 / 2 + d3 / 3;
|
|
44261
|
+
const c0 = f[0];
|
|
44262
|
+
const coeffs = [c0, c1, c2, c3];
|
|
44263
|
+
for (const x of [-1.5, 0.5, 2.5, 3.5]) {
|
|
44264
|
+
const recon = c0 + c1 * x + c2 * x * x + c3 * x * x * x;
|
|
44265
|
+
const actual = at(x);
|
|
44266
|
+
if (!Number.isFinite(actual)) return null;
|
|
44267
|
+
if (Math.abs(recon - actual) > 1e-6 * (1 + Math.abs(actual))) return null;
|
|
44268
|
+
}
|
|
44269
|
+
return coeffs;
|
|
44270
|
+
} catch {
|
|
44271
|
+
return null;
|
|
44272
|
+
}
|
|
44273
|
+
}
|
|
44274
|
+
function numericRealRoots(expr, varName) {
|
|
44186
44275
|
const roots = [];
|
|
44187
44276
|
const seen = /* @__PURE__ */ new Set();
|
|
44188
44277
|
const addRoot = (r) => {
|
|
@@ -44242,6 +44331,61 @@ function solve(expr, varName) {
|
|
|
44242
44331
|
roots.sort((a, b) => a - b);
|
|
44243
44332
|
return roots;
|
|
44244
44333
|
}
|
|
44334
|
+
function solve(equation, varName) {
|
|
44335
|
+
let expr = equation;
|
|
44336
|
+
if (equation.includes("=")) {
|
|
44337
|
+
const parts = equation.split("=");
|
|
44338
|
+
if (parts.length !== 2) {
|
|
44339
|
+
throw new SyntaxError("solve: equation must contain at most one '=' sign");
|
|
44340
|
+
}
|
|
44341
|
+
expr = `${parts[0].trim()} - (${parts[1].trim()})`;
|
|
44342
|
+
}
|
|
44343
|
+
const coeffs = polyCoeffsDeg3(expr, varName);
|
|
44344
|
+
if (coeffs) {
|
|
44345
|
+
let cleanComponent = function(x) {
|
|
44346
|
+
if (Math.abs(x) < 1e-10) return 0;
|
|
44347
|
+
const rounded = Math.round(x);
|
|
44348
|
+
return Math.abs(x - rounded) < 1e-8 ? rounded : x;
|
|
44349
|
+
}, pushReal = function(x) {
|
|
44350
|
+
const clean = cleanComponent(x);
|
|
44351
|
+
const key = `r${clean.toFixed(8)}`;
|
|
44352
|
+
if (!seen.has(key)) {
|
|
44353
|
+
seen.add(key);
|
|
44354
|
+
reals.push(clean);
|
|
44355
|
+
}
|
|
44356
|
+
};
|
|
44357
|
+
const [c0, c1, c2, c3] = coeffs;
|
|
44358
|
+
const eps = 1e-9;
|
|
44359
|
+
let raw = [];
|
|
44360
|
+
if (Math.abs(c3) > eps) raw = cubicRoots(c3, c2, c1, c0);
|
|
44361
|
+
else if (Math.abs(c2) > eps) raw = quadraticRoots(c2, c1, c0);
|
|
44362
|
+
else if (Math.abs(c1) > eps) raw = [-c0 / c1];
|
|
44363
|
+
else raw = [];
|
|
44364
|
+
const reals = [];
|
|
44365
|
+
const complexRoots = [];
|
|
44366
|
+
const seen = /* @__PURE__ */ new Set();
|
|
44367
|
+
for (const r of raw) {
|
|
44368
|
+
if (r instanceof Complex8) {
|
|
44369
|
+
if (Math.abs(r.im) < 1e-10) {
|
|
44370
|
+
pushReal(r.re);
|
|
44371
|
+
} else {
|
|
44372
|
+
const re3 = cleanComponent(r.re);
|
|
44373
|
+
const im3 = cleanComponent(r.im);
|
|
44374
|
+
const key = `${re3.toFixed(8)}|${im3.toFixed(8)}`;
|
|
44375
|
+
if (!seen.has(key)) {
|
|
44376
|
+
seen.add(key);
|
|
44377
|
+
complexRoots.push(new Complex8(re3, im3));
|
|
44378
|
+
}
|
|
44379
|
+
}
|
|
44380
|
+
} else {
|
|
44381
|
+
pushReal(r);
|
|
44382
|
+
}
|
|
44383
|
+
}
|
|
44384
|
+
reals.sort((a, b) => a - b);
|
|
44385
|
+
return [...reals, ...complexRoots];
|
|
44386
|
+
}
|
|
44387
|
+
return numericRealRoots(expr, varName);
|
|
44388
|
+
}
|
|
44245
44389
|
function implicitDiff(expr, x, y, scope) {
|
|
44246
44390
|
const dFdx = partialDerivative(expr, x, scope);
|
|
44247
44391
|
const dFdy = partialDerivative(expr, y, scope);
|
|
@@ -44565,8 +44709,8 @@ function solveQuarticRadicals(A, B, C, D, E, fm2, fm1, f0, f1, f2) {
|
|
|
44565
44709
|
const p2 = c2 / A - c1 * c1 / (3 * A * A);
|
|
44566
44710
|
const q2 = c3 / A - c1 * c2 / (3 * A * A) + 2 * c1 * c1 * c1 / (27 * A * A * A);
|
|
44567
44711
|
const tRoots2 = depressedCubicRoots(p2, q2);
|
|
44568
|
-
const
|
|
44569
|
-
const allRoots = [r, ...
|
|
44712
|
+
const cubicRoots2 = tRoots2.map((t) => t - shift2);
|
|
44713
|
+
const allRoots = [r, ...cubicRoots2];
|
|
44570
44714
|
return allRoots.map(formatCoeff);
|
|
44571
44715
|
}
|
|
44572
44716
|
}
|
package/dist/typed/cas.d.ts
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* @packageDocumentation
|
|
21
21
|
*/
|
|
22
22
|
import { parse } from '../factories/evaluate.js';
|
|
23
|
+
import { Complex } from '@danielsimonjr/mathts-core';
|
|
23
24
|
type f64 = number;
|
|
24
25
|
type MathNode = ReturnType<typeof parse>;
|
|
25
26
|
/**
|
|
@@ -280,21 +281,27 @@ export declare function series(expr: string, varName: string, x0?: f64, n?: numb
|
|
|
280
281
|
*/
|
|
281
282
|
export declare function seriesCoefficient(expr: string, varName: string, x0: f64, k: number): f64;
|
|
282
283
|
/**
|
|
283
|
-
* Solve an equation for a variable.
|
|
284
|
+
* Solve an equation or expression for a variable, returning its distinct roots.
|
|
284
285
|
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
286
|
+
* Accepts either an expression (treated as `expr = 0`) or a full equation with a
|
|
287
|
+
* single `=` sign. Polynomials of degree ≤ 3 yield exact closed-form roots —
|
|
288
|
+
* including complex conjugates — while higher-degree and transcendental
|
|
289
|
+
* equations fall back to a numeric scan for real roots. Real roots are returned
|
|
290
|
+
* first (cleaned of float noise and sorted ascending), followed by any complex
|
|
291
|
+
* roots.
|
|
291
292
|
*
|
|
292
293
|
* @example
|
|
293
|
-
* solve('x^2 - 4', 'x')
|
|
294
|
-
* solve('x^2 +
|
|
294
|
+
* solve('x^2 - 4', 'x') // => [-2, 2]
|
|
295
|
+
* solve('x^2 + 1 = 0', 'x') // => [Complex(0, 1), Complex(0, -1)]
|
|
295
296
|
* solve('2*x - 6', 'x') // => [3]
|
|
297
|
+
* solve('x^3 - 8', 'x') // => [2, Complex(-1, 1.732…), Complex(-1, -1.732…)]
|
|
298
|
+
* solve('cos(x)', 'x') // => numeric real roots
|
|
299
|
+
*
|
|
300
|
+
* @param equation - Expression (`expr = 0`) or equation with one `=` sign.
|
|
301
|
+
* @param varName - Variable to solve for.
|
|
302
|
+
* @returns Distinct roots: real numbers (sorted) then Complex.
|
|
296
303
|
*/
|
|
297
|
-
export declare function solve(
|
|
304
|
+
export declare function solve(equation: string, varName: string): Array<f64 | Complex>;
|
|
298
305
|
/**
|
|
299
306
|
* Compute dy/dx from an implicit equation F(x, y) = 0.
|
|
300
307
|
*
|
package/dist/typed/cas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cas.d.ts","sourceRoot":"","sources":["../../src/typed/cas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,KAAK,EAAY,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E,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AA8EpG;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC3D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;AA0C9E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAC3D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@danielsimonjr/mathts-functions",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
|
|
5
|
-
"author": "Daniel Simon Jr.",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"main": "./dist/index.js",
|
|
9
|
-
"module": "./dist/index.js",
|
|
10
|
-
"types": "./dist/index.d.ts",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"import": "./dist/index.js",
|
|
14
|
-
"types": "./dist/index.d.ts"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist",
|
|
19
|
-
"README.md"
|
|
20
|
-
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "tsup src/index.ts --format esm --clean && tsc -p tsconfig.dts.json",
|
|
23
|
-
"dev": "tsup src/index.ts --format esm --dts --watch",
|
|
24
|
-
"test": "vitest run",
|
|
25
|
-
"test:watch": "vitest",
|
|
26
|
-
"test:coverage": "vitest run --coverage",
|
|
27
|
-
"typecheck": "tsc --noEmit",
|
|
28
|
-
"lint": "eslint src --ext .ts",
|
|
29
|
-
"lint:fix": "eslint src --ext .ts --fix",
|
|
30
|
-
"clean": "rm -rf dist",
|
|
31
|
-
"build:prod": "tsup src/index.ts --format esm --clean --minify --treeshake"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"@danielsimonjr/mathts-core": "^0.1.
|
|
35
|
-
"@danielsimonjr/mathts-expression": "^0.2.4",
|
|
36
|
-
"@danielsimonjr/mathts-matrix": "^0.1.6",
|
|
37
|
-
"@danielsimonjr/mathts-parallel": "^0.2.2",
|
|
38
|
-
"bignumber.js": "^9.1.2",
|
|
39
|
-
"complex.js": "^2.2.5",
|
|
40
|
-
"decimal.js": "^10.4.3",
|
|
41
|
-
"escape-latex": "^1.2.0",
|
|
42
|
-
"fraction.js": "^5.2.1",
|
|
43
|
-
"javascript-natural-sort": "^0.7.1",
|
|
44
|
-
"seedrandom": "^3.0.5",
|
|
45
|
-
"tiny-emitter": "^2.1.0",
|
|
46
|
-
"typed-function": "github:danielsimonjr/typed-function"
|
|
47
|
-
},
|
|
48
|
-
"devDependencies": {
|
|
49
|
-
"@types/node": "^25.5.2",
|
|
50
|
-
"tsup": "^8.0.0",
|
|
51
|
-
"typescript": "^5.3.0",
|
|
52
|
-
"vitest": "^4.1.5"
|
|
53
|
-
},
|
|
54
|
-
"publishConfig": {
|
|
55
|
-
"access": "public"
|
|
56
|
-
},
|
|
57
|
-
"repository": {
|
|
58
|
-
"type": "git",
|
|
59
|
-
"url": "https://github.com/danielsimonjr/mathts",
|
|
60
|
-
"directory": "functions"
|
|
61
|
-
},
|
|
62
|
-
"keywords": [
|
|
63
|
-
"math",
|
|
64
|
-
"typescript",
|
|
65
|
-
"functions",
|
|
66
|
-
"arithmetic",
|
|
67
|
-
"algebra",
|
|
68
|
-
"trigonometry",
|
|
69
|
-
"statistics"
|
|
70
|
-
]
|
|
71
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@danielsimonjr/mathts-functions",
|
|
3
|
+
"version": "0.2.9",
|
|
4
|
+
"description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
|
|
5
|
+
"author": "Daniel Simon Jr.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "tsup src/index.ts --format esm --clean && tsc -p tsconfig.dts.json",
|
|
23
|
+
"dev": "tsup src/index.ts --format esm --dts --watch",
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"test:coverage": "vitest run --coverage",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"lint": "eslint src --ext .ts",
|
|
29
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
30
|
+
"clean": "rm -rf dist",
|
|
31
|
+
"build:prod": "tsup src/index.ts --format esm --clean --minify --treeshake"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@danielsimonjr/mathts-core": "^0.1.5",
|
|
35
|
+
"@danielsimonjr/mathts-expression": "^0.2.4",
|
|
36
|
+
"@danielsimonjr/mathts-matrix": "^0.1.6",
|
|
37
|
+
"@danielsimonjr/mathts-parallel": "^0.2.2",
|
|
38
|
+
"bignumber.js": "^9.1.2",
|
|
39
|
+
"complex.js": "^2.2.5",
|
|
40
|
+
"decimal.js": "^10.4.3",
|
|
41
|
+
"escape-latex": "^1.2.0",
|
|
42
|
+
"fraction.js": "^5.2.1",
|
|
43
|
+
"javascript-natural-sort": "^0.7.1",
|
|
44
|
+
"seedrandom": "^3.0.5",
|
|
45
|
+
"tiny-emitter": "^2.1.0",
|
|
46
|
+
"typed-function": "github:danielsimonjr/typed-function"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^25.5.2",
|
|
50
|
+
"tsup": "^8.0.0",
|
|
51
|
+
"typescript": "^5.3.0",
|
|
52
|
+
"vitest": "^4.1.5"
|
|
53
|
+
},
|
|
54
|
+
"publishConfig": {
|
|
55
|
+
"access": "public"
|
|
56
|
+
},
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "https://github.com/danielsimonjr/mathts",
|
|
60
|
+
"directory": "functions"
|
|
61
|
+
},
|
|
62
|
+
"keywords": [
|
|
63
|
+
"math",
|
|
64
|
+
"typescript",
|
|
65
|
+
"functions",
|
|
66
|
+
"arithmetic",
|
|
67
|
+
"algebra",
|
|
68
|
+
"trigonometry",
|
|
69
|
+
"statistics"
|
|
70
|
+
]
|
|
71
|
+
}
|