@danielsimonjr/mathts-functions 0.2.12 → 0.2.14
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 +187 -38
- package/dist/typed/arithmetic.d.ts.map +1 -1
- package/dist/typed/fused.d.ts +21 -0
- package/dist/typed/fused.d.ts.map +1 -0
- package/dist/typed/index.d.ts +1 -0
- package/dist/typed/index.d.ts.map +1 -1
- package/dist/typed/special.d.ts +5 -0
- package/dist/typed/special.d.ts.map +1 -1
- package/dist/typed/trigonometry.d.ts.map +1 -1
- package/dist/wasm/elementwise/wasm-bridge.d.ts +27 -0
- package/dist/wasm/elementwise/wasm-bridge.d.ts.map +1 -0
- package/dist/wasm/mathts.wasm +0 -0
- package/dist/wasm/wasm-manifest.json +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -144,6 +144,7 @@ __export(typed_exports, {
|
|
|
144
144
|
equalScalar: () => equalScalar,
|
|
145
145
|
equalText: () => equalText,
|
|
146
146
|
erfc: () => erfc,
|
|
147
|
+
erfcScalar: () => erfcScalar,
|
|
147
148
|
erfi: () => erfi,
|
|
148
149
|
eulerPhi: () => eulerPhi,
|
|
149
150
|
eventDetection: () => eventDetection,
|
|
@@ -170,6 +171,7 @@ __export(typed_exports, {
|
|
|
170
171
|
fresnelS: () => fresnelS,
|
|
171
172
|
fullSimplify: () => fullSimplify,
|
|
172
173
|
functionExpand: () => functionExpand,
|
|
174
|
+
fuseUnaryChain: () => fuseUnaryChain,
|
|
173
175
|
gammaDist: () => gammaDist,
|
|
174
176
|
gammaPDF: () => gammaPDF,
|
|
175
177
|
gammainc: () => gammainc,
|
|
@@ -459,6 +461,81 @@ __export(typed_exports, {
|
|
|
459
461
|
// src/typed/arithmetic.ts
|
|
460
462
|
import { mathTyped, Complex, Fraction, BigNumber } from "@danielsimonjr/mathts-core";
|
|
461
463
|
import { computePool } from "@danielsimonjr/mathts-parallel";
|
|
464
|
+
|
|
465
|
+
// src/wasm/elementwise/wasm-bridge.ts
|
|
466
|
+
var WASM_ELEMENTWISE_THRESHOLD = 1024;
|
|
467
|
+
function getWasm() {
|
|
468
|
+
try {
|
|
469
|
+
return wasmLoader.getModule();
|
|
470
|
+
} catch {
|
|
471
|
+
return null;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
var scratchBase = -1;
|
|
475
|
+
function elementwiseUnaryDispatch(op, xs) {
|
|
476
|
+
const n = xs.length;
|
|
477
|
+
if (n < WASM_ELEMENTWISE_THRESHOLD) return null;
|
|
478
|
+
const wasm = getWasm();
|
|
479
|
+
if (!wasm) return null;
|
|
480
|
+
const fn = wasm[`simd_${op}_array`];
|
|
481
|
+
const mem = wasm.memory;
|
|
482
|
+
if (typeof fn !== "function" || !(mem instanceof WebAssembly.Memory)) return null;
|
|
483
|
+
try {
|
|
484
|
+
const need = 2 * n * 8;
|
|
485
|
+
if (scratchBase < 0) scratchBase = mem.buffer.byteLength;
|
|
486
|
+
if (scratchBase + need > mem.buffer.byteLength) {
|
|
487
|
+
mem.grow(Math.ceil((scratchBase + need - mem.buffer.byteLength) / 65536));
|
|
488
|
+
}
|
|
489
|
+
const inOff = scratchBase;
|
|
490
|
+
const outOff = scratchBase + n * 8;
|
|
491
|
+
new Float64Array(mem.buffer, inOff, n).set(xs);
|
|
492
|
+
fn(inOff, outOff, n);
|
|
493
|
+
const result = new Float64Array(n);
|
|
494
|
+
result.set(new Float64Array(mem.buffer, outOff, n));
|
|
495
|
+
return result;
|
|
496
|
+
} catch {
|
|
497
|
+
return null;
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
function elementwiseChainDispatch(ops, xs) {
|
|
501
|
+
const n = xs.length;
|
|
502
|
+
if (ops.length === 0 || n < WASM_ELEMENTWISE_THRESHOLD) return null;
|
|
503
|
+
const wasm = getWasm();
|
|
504
|
+
if (!wasm) return null;
|
|
505
|
+
const mem = wasm.memory;
|
|
506
|
+
if (!(mem instanceof WebAssembly.Memory)) return null;
|
|
507
|
+
const kernels = [];
|
|
508
|
+
for (const op of ops) {
|
|
509
|
+
const fn = wasm[`simd_${op}_array`];
|
|
510
|
+
if (typeof fn !== "function") return null;
|
|
511
|
+
kernels.push(fn);
|
|
512
|
+
}
|
|
513
|
+
try {
|
|
514
|
+
const need = 2 * n * 8;
|
|
515
|
+
if (scratchBase < 0) scratchBase = mem.buffer.byteLength;
|
|
516
|
+
if (scratchBase + need > mem.buffer.byteLength) {
|
|
517
|
+
mem.grow(Math.ceil((scratchBase + need - mem.buffer.byteLength) / 65536));
|
|
518
|
+
}
|
|
519
|
+
const bufA = scratchBase;
|
|
520
|
+
const bufB = scratchBase + n * 8;
|
|
521
|
+
new Float64Array(mem.buffer, bufA, n).set(xs);
|
|
522
|
+
let cur = bufA;
|
|
523
|
+
let other = bufB;
|
|
524
|
+
for (const fn of kernels) {
|
|
525
|
+
fn(cur, other, n);
|
|
526
|
+
const t = cur;
|
|
527
|
+
cur = other;
|
|
528
|
+
other = t;
|
|
529
|
+
}
|
|
530
|
+
const result = new Float64Array(n);
|
|
531
|
+
result.set(new Float64Array(mem.buffer, cur, n));
|
|
532
|
+
return result;
|
|
533
|
+
} catch {
|
|
534
|
+
return null;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// src/typed/arithmetic.ts
|
|
462
539
|
var add = mathTyped("add", {
|
|
463
540
|
"number, number": (a, b) => a + b,
|
|
464
541
|
"bigint, bigint": (a, b) => a + b,
|
|
@@ -594,6 +671,8 @@ var abs = mathTyped("abs", {
|
|
|
594
671
|
BigNumber: (a) => a.abs(),
|
|
595
672
|
// Parallel array abs
|
|
596
673
|
Float64Array: async (a) => {
|
|
674
|
+
const wasm = elementwiseUnaryDispatch("abs", a);
|
|
675
|
+
if (wasm) return wasm;
|
|
597
676
|
const result = await computePool.abs(a);
|
|
598
677
|
return result.result;
|
|
599
678
|
}
|
|
@@ -693,6 +772,8 @@ var exp = mathTyped("exp", {
|
|
|
693
772
|
BigNumber: (a) => a.exp(),
|
|
694
773
|
// Parallel array exp
|
|
695
774
|
Float64Array: async (a) => {
|
|
775
|
+
const wasm = elementwiseUnaryDispatch("exp", a);
|
|
776
|
+
if (wasm) return wasm;
|
|
696
777
|
const result = await computePool.exp(a);
|
|
697
778
|
return result.result;
|
|
698
779
|
}
|
|
@@ -704,6 +785,8 @@ var log = mathTyped("log", {
|
|
|
704
785
|
"number, number": (a, base) => Math.log(a) / Math.log(base),
|
|
705
786
|
// Parallel array log
|
|
706
787
|
Float64Array: async (a) => {
|
|
788
|
+
const wasm = elementwiseUnaryDispatch("log", a);
|
|
789
|
+
if (wasm) return wasm;
|
|
707
790
|
const result = await computePool.log(a);
|
|
708
791
|
return result.result;
|
|
709
792
|
}
|
|
@@ -714,6 +797,8 @@ var log10 = mathTyped("log10", {
|
|
|
714
797
|
BigNumber: (a) => a.log10(),
|
|
715
798
|
// Parallel array log10
|
|
716
799
|
Float64Array: async (a) => {
|
|
800
|
+
const wasm = elementwiseUnaryDispatch("log10", a);
|
|
801
|
+
if (wasm) return wasm;
|
|
717
802
|
if (computePool.shouldParallelize(a.length)) {
|
|
718
803
|
const r = await computePool.applyKernel(a, "(x) => Math.log10(x)");
|
|
719
804
|
return r.result;
|
|
@@ -729,6 +814,8 @@ var log2 = mathTyped("log2", {
|
|
|
729
814
|
BigNumber: (a) => a.log2(),
|
|
730
815
|
// Parallel array log2
|
|
731
816
|
Float64Array: async (a) => {
|
|
817
|
+
const wasm = elementwiseUnaryDispatch("log2", a);
|
|
818
|
+
if (wasm) return wasm;
|
|
732
819
|
if (computePool.shouldParallelize(a.length)) {
|
|
733
820
|
const r = await computePool.applyKernel(a, "(x) => Math.log2(x)");
|
|
734
821
|
return r.result;
|
|
@@ -742,6 +829,8 @@ var log1p = mathTyped("log1p", {
|
|
|
742
829
|
number: (a) => Math.log1p(a),
|
|
743
830
|
// Parallel array log1p
|
|
744
831
|
Float64Array: async (a) => {
|
|
832
|
+
const wasm = elementwiseUnaryDispatch("log1p", a);
|
|
833
|
+
if (wasm) return wasm;
|
|
745
834
|
if (computePool.shouldParallelize(a.length)) {
|
|
746
835
|
const r = await computePool.applyKernel(a, "(x) => Math.log1p(x)");
|
|
747
836
|
return r.result;
|
|
@@ -755,6 +844,8 @@ var expm1 = mathTyped("expm1", {
|
|
|
755
844
|
number: (a) => Math.expm1(a),
|
|
756
845
|
// Parallel array expm1
|
|
757
846
|
Float64Array: async (a) => {
|
|
847
|
+
const wasm = elementwiseUnaryDispatch("expm1", a);
|
|
848
|
+
if (wasm) return wasm;
|
|
758
849
|
if (computePool.shouldParallelize(a.length)) {
|
|
759
850
|
const r = await computePool.applyKernel(a, "(x) => Math.expm1(x)");
|
|
760
851
|
return r.result;
|
|
@@ -920,6 +1011,8 @@ var sinh = mathTyped("sinh", {
|
|
|
920
1011
|
BigNumber: (a) => a.sinh(),
|
|
921
1012
|
// Parallel array sinh
|
|
922
1013
|
Float64Array: async (a) => {
|
|
1014
|
+
const wasm = elementwiseUnaryDispatch("sinh", a);
|
|
1015
|
+
if (wasm) return wasm;
|
|
923
1016
|
if (computePool.shouldParallelize(a.length)) {
|
|
924
1017
|
const r = await computePool.applyKernel(a, "(x) => Math.sinh(x)");
|
|
925
1018
|
return r.result;
|
|
@@ -950,6 +1043,8 @@ var tanh = mathTyped("tanh", {
|
|
|
950
1043
|
BigNumber: (a) => a.tanh(),
|
|
951
1044
|
// Parallel array tanh
|
|
952
1045
|
Float64Array: async (a) => {
|
|
1046
|
+
const wasm = elementwiseUnaryDispatch("tanh", a);
|
|
1047
|
+
if (wasm) return wasm;
|
|
953
1048
|
if (computePool.shouldParallelize(a.length)) {
|
|
954
1049
|
const r = await computePool.applyKernel(a, "(x) => Math.tanh(x)");
|
|
955
1050
|
return r.result;
|
|
@@ -1214,6 +1309,8 @@ var sin = mathTyped2("sin", {
|
|
|
1214
1309
|
BigNumber: (a) => a.sin(),
|
|
1215
1310
|
// Parallel Float64Array sin
|
|
1216
1311
|
Float64Array: async (a) => {
|
|
1312
|
+
const wasm = elementwiseUnaryDispatch("sin", a);
|
|
1313
|
+
if (wasm) return wasm;
|
|
1217
1314
|
const result = await computePool2.sin(a);
|
|
1218
1315
|
return result.result;
|
|
1219
1316
|
}
|
|
@@ -1224,6 +1321,8 @@ var cos = mathTyped2("cos", {
|
|
|
1224
1321
|
BigNumber: (a) => a.cos(),
|
|
1225
1322
|
// Parallel Float64Array cos
|
|
1226
1323
|
Float64Array: async (a) => {
|
|
1324
|
+
const wasm = elementwiseUnaryDispatch("cos", a);
|
|
1325
|
+
if (wasm) return wasm;
|
|
1227
1326
|
const result = await computePool2.cos(a);
|
|
1228
1327
|
return result.result;
|
|
1229
1328
|
}
|
|
@@ -1234,6 +1333,8 @@ var tan = mathTyped2("tan", {
|
|
|
1234
1333
|
BigNumber: (a) => a.tan(),
|
|
1235
1334
|
// Parallel Float64Array tan
|
|
1236
1335
|
Float64Array: async (a) => {
|
|
1336
|
+
const wasm = elementwiseUnaryDispatch("tan", a);
|
|
1337
|
+
if (wasm) return wasm;
|
|
1237
1338
|
const result = await computePool2.tan(a);
|
|
1238
1339
|
return result.result;
|
|
1239
1340
|
}
|
|
@@ -1244,6 +1345,8 @@ var csc = mathTyped2("csc", {
|
|
|
1244
1345
|
BigNumber: (a) => BigNumber2.fromNumber(1).divide(a.sin()),
|
|
1245
1346
|
// Parallel array csc
|
|
1246
1347
|
Float64Array: async (a) => {
|
|
1348
|
+
const wasm = elementwiseUnaryDispatch("csc", a);
|
|
1349
|
+
if (wasm) return wasm;
|
|
1247
1350
|
if (computePool2.shouldParallelize(a.length)) {
|
|
1248
1351
|
const r = await computePool2.applyKernel(a, "(x) => 1 / Math.sin(x)");
|
|
1249
1352
|
return r.result;
|
|
@@ -1259,6 +1362,8 @@ var sec = mathTyped2("sec", {
|
|
|
1259
1362
|
BigNumber: (a) => BigNumber2.fromNumber(1).divide(a.cos()),
|
|
1260
1363
|
// Parallel array sec
|
|
1261
1364
|
Float64Array: async (a) => {
|
|
1365
|
+
const wasm = elementwiseUnaryDispatch("sec", a);
|
|
1366
|
+
if (wasm) return wasm;
|
|
1262
1367
|
if (computePool2.shouldParallelize(a.length)) {
|
|
1263
1368
|
const r = await computePool2.applyKernel(a, "(x) => 1 / Math.cos(x)");
|
|
1264
1369
|
return r.result;
|
|
@@ -1274,6 +1379,8 @@ var cot = mathTyped2("cot", {
|
|
|
1274
1379
|
BigNumber: (a) => BigNumber2.fromNumber(1).divide(a.tan()),
|
|
1275
1380
|
// Parallel array cot
|
|
1276
1381
|
Float64Array: async (a) => {
|
|
1382
|
+
const wasm = elementwiseUnaryDispatch("cot", a);
|
|
1383
|
+
if (wasm) return wasm;
|
|
1277
1384
|
if (computePool2.shouldParallelize(a.length)) {
|
|
1278
1385
|
const r = await computePool2.applyKernel(a, "(x) => 1 / Math.tan(x)");
|
|
1279
1386
|
return r.result;
|
|
@@ -1329,6 +1436,8 @@ var atan = mathTyped2("atan", {
|
|
|
1329
1436
|
BigNumber: (a) => a.atan(),
|
|
1330
1437
|
// Parallel array atan
|
|
1331
1438
|
Float64Array: async (a) => {
|
|
1439
|
+
const wasm = elementwiseUnaryDispatch("atan", a);
|
|
1440
|
+
if (wasm) return wasm;
|
|
1332
1441
|
if (computePool2.shouldParallelize(a.length)) {
|
|
1333
1442
|
const r = await computePool2.applyKernel(a, "(x) => Math.atan(x)");
|
|
1334
1443
|
return r.result;
|
|
@@ -1389,6 +1498,8 @@ var atanh = mathTyped2("atanh", {
|
|
|
1389
1498
|
BigNumber: (a) => a.atanh(),
|
|
1390
1499
|
// Parallel array atanh (values outside (-1, 1) produce NaN or ±Infinity, matching Math.atanh behavior)
|
|
1391
1500
|
Float64Array: async (a) => {
|
|
1501
|
+
const wasm = elementwiseUnaryDispatch("atanh", a);
|
|
1502
|
+
if (wasm) return wasm;
|
|
1392
1503
|
if (computePool2.shouldParallelize(a.length)) {
|
|
1393
1504
|
const r = await computePool2.applyKernel(a, "(x) => Math.atanh(x)");
|
|
1394
1505
|
return r.result;
|
|
@@ -1974,7 +2085,7 @@ import { computePool as computePool4 } from "@danielsimonjr/mathts-parallel";
|
|
|
1974
2085
|
|
|
1975
2086
|
// src/wasm/signal/wasm-bridge.ts
|
|
1976
2087
|
var WASM_SIGNAL_THRESHOLD = 4096;
|
|
1977
|
-
function
|
|
2088
|
+
function getWasm2() {
|
|
1978
2089
|
try {
|
|
1979
2090
|
return wasmLoader.getModule();
|
|
1980
2091
|
} catch {
|
|
@@ -2184,7 +2295,7 @@ function chirpZTransformJS(samples, m, phiStartRe, phiStartIm, phiStepRe, phiSte
|
|
|
2184
2295
|
}
|
|
2185
2296
|
function applyWindowDispatch(samples, windowName) {
|
|
2186
2297
|
const wt = windowTypeCode(windowName);
|
|
2187
|
-
const wasm =
|
|
2298
|
+
const wasm = getWasm2();
|
|
2188
2299
|
if (wasm) {
|
|
2189
2300
|
const rustFn = wasm["apply_window_f64"];
|
|
2190
2301
|
if (typeof rustFn === "function") {
|
|
@@ -2215,7 +2326,7 @@ function welchPSDDispatch(samples, frameLength, overlap, windowName) {
|
|
|
2215
2326
|
const n = samples.length;
|
|
2216
2327
|
const wt = windowTypeCode(windowName);
|
|
2217
2328
|
if (n >= WASM_SIGNAL_THRESHOLD && n >= frameLength) {
|
|
2218
|
-
const wasm =
|
|
2329
|
+
const wasm = getWasm2();
|
|
2219
2330
|
if (wasm) {
|
|
2220
2331
|
const rustFn = wasm["welch_psd_f64"];
|
|
2221
2332
|
if (typeof rustFn === "function") {
|
|
@@ -2254,7 +2365,7 @@ function welchPSDDispatch(samples, frameLength, overlap, windowName) {
|
|
|
2254
2365
|
function bartlettPSDDispatch(samples, frameLength) {
|
|
2255
2366
|
const n = samples.length;
|
|
2256
2367
|
if (n >= WASM_SIGNAL_THRESHOLD && n >= frameLength) {
|
|
2257
|
-
const wasm =
|
|
2368
|
+
const wasm = getWasm2();
|
|
2258
2369
|
if (wasm) {
|
|
2259
2370
|
const rustFn = wasm["bartlett_psd_f64"];
|
|
2260
2371
|
if (typeof rustFn === "function") {
|
|
@@ -2288,7 +2399,7 @@ function bartlettPSDDispatch(samples, frameLength) {
|
|
|
2288
2399
|
function goertzelDispatch(samples, targetFreq, sampleRate) {
|
|
2289
2400
|
const n = samples.length;
|
|
2290
2401
|
if (n >= WASM_SIGNAL_THRESHOLD) {
|
|
2291
|
-
const wasm =
|
|
2402
|
+
const wasm = getWasm2();
|
|
2292
2403
|
if (wasm) {
|
|
2293
2404
|
const rustFn = wasm["goertzel_f64"];
|
|
2294
2405
|
if (typeof rustFn === "function") {
|
|
@@ -2320,7 +2431,7 @@ function goertzelDispatch(samples, targetFreq, sampleRate) {
|
|
|
2320
2431
|
function chirpZTransformDispatch(samples, m, phiStartRe, phiStartIm, phiStepRe, phiStepIm) {
|
|
2321
2432
|
const n = samples.length;
|
|
2322
2433
|
if (Math.max(n, m) >= WASM_SIGNAL_THRESHOLD) {
|
|
2323
|
-
const wasm =
|
|
2434
|
+
const wasm = getWasm2();
|
|
2324
2435
|
if (wasm) {
|
|
2325
2436
|
const rustFn = wasm["chirp_z_transform_f64"];
|
|
2326
2437
|
if (typeof rustFn === "function") {
|
|
@@ -3409,7 +3520,7 @@ var BINARY_OPS = {
|
|
|
3409
3520
|
var UNARY_OPS = {
|
|
3410
3521
|
bitNot: { rust: "bitNotArray", as: "bitNot_i32_array" }
|
|
3411
3522
|
};
|
|
3412
|
-
function
|
|
3523
|
+
function getWasm3() {
|
|
3413
3524
|
try {
|
|
3414
3525
|
return wasmLoader.getModule();
|
|
3415
3526
|
} catch {
|
|
@@ -3417,7 +3528,7 @@ function getWasm2() {
|
|
|
3417
3528
|
}
|
|
3418
3529
|
}
|
|
3419
3530
|
function getBinaryKernel(op) {
|
|
3420
|
-
const wasm =
|
|
3531
|
+
const wasm = getWasm3();
|
|
3421
3532
|
if (!wasm) return null;
|
|
3422
3533
|
const names = BINARY_OPS[op];
|
|
3423
3534
|
const rust = wasm[names.rust];
|
|
@@ -3431,7 +3542,7 @@ function getBinaryKernel(op) {
|
|
|
3431
3542
|
return null;
|
|
3432
3543
|
}
|
|
3433
3544
|
function getUnaryKernel(op) {
|
|
3434
|
-
const wasm =
|
|
3545
|
+
const wasm = getWasm3();
|
|
3435
3546
|
if (!wasm) return null;
|
|
3436
3547
|
const names = UNARY_OPS[op];
|
|
3437
3548
|
const rust = wasm[names.rust];
|
|
@@ -4120,7 +4231,7 @@ import { computePool as computePool6 } from "@danielsimonjr/mathts-parallel";
|
|
|
4120
4231
|
|
|
4121
4232
|
// src/wasm/special/wasm-bridge.ts
|
|
4122
4233
|
var WASM_SPECIAL_THRESHOLD = 1024;
|
|
4123
|
-
function
|
|
4234
|
+
function getWasm4() {
|
|
4124
4235
|
try {
|
|
4125
4236
|
return wasmLoader.getModule();
|
|
4126
4237
|
} catch {
|
|
@@ -4186,7 +4297,7 @@ function airyBiJS(xs) {
|
|
|
4186
4297
|
function besselJ0Dispatch(xs) {
|
|
4187
4298
|
const n = xs.length;
|
|
4188
4299
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4189
|
-
const wasm =
|
|
4300
|
+
const wasm = getWasm4();
|
|
4190
4301
|
if (wasm) {
|
|
4191
4302
|
try {
|
|
4192
4303
|
const rustFn = wasm["bessel_j0_f64"];
|
|
@@ -4217,7 +4328,7 @@ function besselJ0Dispatch(xs) {
|
|
|
4217
4328
|
function besselJ1Dispatch(xs) {
|
|
4218
4329
|
const n = xs.length;
|
|
4219
4330
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4220
|
-
const wasm =
|
|
4331
|
+
const wasm = getWasm4();
|
|
4221
4332
|
if (wasm) {
|
|
4222
4333
|
try {
|
|
4223
4334
|
const rustFn = wasm["bessel_j1_f64"];
|
|
@@ -4250,7 +4361,7 @@ function besselJDispatch(order, xs) {
|
|
|
4250
4361
|
if (order === 1) return besselJ1Dispatch(xs);
|
|
4251
4362
|
const n = xs.length;
|
|
4252
4363
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4253
|
-
const wasm =
|
|
4364
|
+
const wasm = getWasm4();
|
|
4254
4365
|
if (wasm) {
|
|
4255
4366
|
try {
|
|
4256
4367
|
const rustFn = wasm["bessel_j_f64"];
|
|
@@ -4281,7 +4392,7 @@ function besselJDispatch(order, xs) {
|
|
|
4281
4392
|
function besselY0Dispatch(xs) {
|
|
4282
4393
|
const n = xs.length;
|
|
4283
4394
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4284
|
-
const wasm =
|
|
4395
|
+
const wasm = getWasm4();
|
|
4285
4396
|
if (wasm) {
|
|
4286
4397
|
try {
|
|
4287
4398
|
const rustFn = wasm["bessel_y0_f64"];
|
|
@@ -4312,7 +4423,7 @@ function besselY0Dispatch(xs) {
|
|
|
4312
4423
|
function besselY1Dispatch(xs) {
|
|
4313
4424
|
const n = xs.length;
|
|
4314
4425
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4315
|
-
const wasm =
|
|
4426
|
+
const wasm = getWasm4();
|
|
4316
4427
|
if (wasm) {
|
|
4317
4428
|
try {
|
|
4318
4429
|
const rustFn = wasm["bessel_y1_f64"];
|
|
@@ -4345,7 +4456,7 @@ function besselYDispatch(order, xs) {
|
|
|
4345
4456
|
if (order === 1) return besselY1Dispatch(xs);
|
|
4346
4457
|
const n = xs.length;
|
|
4347
4458
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4348
|
-
const wasm =
|
|
4459
|
+
const wasm = getWasm4();
|
|
4349
4460
|
if (wasm) {
|
|
4350
4461
|
try {
|
|
4351
4462
|
const rustFn = wasm["bessel_y_f64"];
|
|
@@ -4376,7 +4487,7 @@ function besselYDispatch(order, xs) {
|
|
|
4376
4487
|
function airyAiDispatch(xs) {
|
|
4377
4488
|
const n = xs.length;
|
|
4378
4489
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4379
|
-
const wasm =
|
|
4490
|
+
const wasm = getWasm4();
|
|
4380
4491
|
if (wasm) {
|
|
4381
4492
|
try {
|
|
4382
4493
|
const rustFn = wasm["airy_ai_f64"];
|
|
@@ -4409,7 +4520,7 @@ function airyAiDispatch(xs) {
|
|
|
4409
4520
|
function airyBiDispatch(xs) {
|
|
4410
4521
|
const n = xs.length;
|
|
4411
4522
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4412
|
-
const wasm =
|
|
4523
|
+
const wasm = getWasm4();
|
|
4413
4524
|
if (wasm) {
|
|
4414
4525
|
try {
|
|
4415
4526
|
const rustFn = wasm["airy_bi_f64"];
|
|
@@ -4472,7 +4583,7 @@ function lgammaJS(xs) {
|
|
|
4472
4583
|
function lgammaDispatch(xs) {
|
|
4473
4584
|
const n = xs.length;
|
|
4474
4585
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4475
|
-
const wasm =
|
|
4586
|
+
const wasm = getWasm4();
|
|
4476
4587
|
if (wasm) {
|
|
4477
4588
|
try {
|
|
4478
4589
|
const rustFn = wasm["lgamma_f64"];
|
|
@@ -4709,7 +4820,7 @@ function ellipticPiIncompleteScalar(n, phi, m) {
|
|
|
4709
4820
|
function carlsonRCDispatch(xs, ys) {
|
|
4710
4821
|
const n = xs.length;
|
|
4711
4822
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4712
|
-
const wasm =
|
|
4823
|
+
const wasm = getWasm4();
|
|
4713
4824
|
if (wasm) {
|
|
4714
4825
|
try {
|
|
4715
4826
|
const rustFn = wasm["carlson_rc_f64"];
|
|
@@ -4740,7 +4851,7 @@ function carlsonRCDispatch(xs, ys) {
|
|
|
4740
4851
|
function carlsonRFDispatch(xs, ys, zs) {
|
|
4741
4852
|
const n = xs.length;
|
|
4742
4853
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4743
|
-
const wasm =
|
|
4854
|
+
const wasm = getWasm4();
|
|
4744
4855
|
if (wasm) {
|
|
4745
4856
|
try {
|
|
4746
4857
|
const rustFn = wasm["carlson_rf_f64"];
|
|
@@ -4773,7 +4884,7 @@ function carlsonRFDispatch(xs, ys, zs) {
|
|
|
4773
4884
|
function carlsonRDDispatch(xs, ys, zs) {
|
|
4774
4885
|
const n = xs.length;
|
|
4775
4886
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4776
|
-
const wasm =
|
|
4887
|
+
const wasm = getWasm4();
|
|
4777
4888
|
if (wasm) {
|
|
4778
4889
|
try {
|
|
4779
4890
|
const rustFn = wasm["carlson_rd_f64"];
|
|
@@ -4806,7 +4917,7 @@ function carlsonRDDispatch(xs, ys, zs) {
|
|
|
4806
4917
|
function carlsonRJDispatch(xs, ys, zs, ps) {
|
|
4807
4918
|
const n = xs.length;
|
|
4808
4919
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4809
|
-
const wasm =
|
|
4920
|
+
const wasm = getWasm4();
|
|
4810
4921
|
if (wasm) {
|
|
4811
4922
|
try {
|
|
4812
4923
|
const rustFn = wasm["carlson_rj_f64"];
|
|
@@ -4841,7 +4952,7 @@ function carlsonRJDispatch(xs, ys, zs, ps) {
|
|
|
4841
4952
|
function ellipticFIncompleteDispatch(phis, ms) {
|
|
4842
4953
|
const n = phis.length;
|
|
4843
4954
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4844
|
-
const wasm =
|
|
4955
|
+
const wasm = getWasm4();
|
|
4845
4956
|
if (wasm) {
|
|
4846
4957
|
try {
|
|
4847
4958
|
const rustFn = wasm["elliptic_f_incomplete_f64"];
|
|
@@ -4872,7 +4983,7 @@ function ellipticFIncompleteDispatch(phis, ms) {
|
|
|
4872
4983
|
function ellipticEIncompleteDispatch(phis, ms) {
|
|
4873
4984
|
const n = phis.length;
|
|
4874
4985
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4875
|
-
const wasm =
|
|
4986
|
+
const wasm = getWasm4();
|
|
4876
4987
|
if (wasm) {
|
|
4877
4988
|
try {
|
|
4878
4989
|
const rustFn = wasm["elliptic_e_incomplete_f64"];
|
|
@@ -4903,7 +5014,7 @@ function ellipticEIncompleteDispatch(phis, ms) {
|
|
|
4903
5014
|
function ellipticPiIncompleteDispatch(ns, phis, ms) {
|
|
4904
5015
|
const n = ns.length;
|
|
4905
5016
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4906
|
-
const wasm =
|
|
5017
|
+
const wasm = getWasm4();
|
|
4907
5018
|
if (wasm) {
|
|
4908
5019
|
try {
|
|
4909
5020
|
const rustFn = wasm["elliptic_pi_incomplete_f64"];
|
|
@@ -4994,7 +5105,7 @@ function ellipticEJS(ms) {
|
|
|
4994
5105
|
function ellipticKDispatch(ms) {
|
|
4995
5106
|
const n = ms.length;
|
|
4996
5107
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
4997
|
-
const wasm =
|
|
5108
|
+
const wasm = getWasm4();
|
|
4998
5109
|
if (wasm) {
|
|
4999
5110
|
try {
|
|
5000
5111
|
const rustFn = wasm["elliptic_k_f64"];
|
|
@@ -5027,7 +5138,7 @@ function ellipticKDispatch(ms) {
|
|
|
5027
5138
|
function ellipticEDispatch(ms) {
|
|
5028
5139
|
const n = ms.length;
|
|
5029
5140
|
if (n >= WASM_SPECIAL_THRESHOLD) {
|
|
5030
|
-
const wasm =
|
|
5141
|
+
const wasm = getWasm4();
|
|
5031
5142
|
if (wasm) {
|
|
5032
5143
|
try {
|
|
5033
5144
|
const rustFn = wasm["elliptic_e_f64"];
|
|
@@ -6075,7 +6186,11 @@ async function mapArray(x, scalar, buildKernel) {
|
|
|
6075
6186
|
}
|
|
6076
6187
|
var erfc = mathTyped9("erfc", {
|
|
6077
6188
|
number: erfcScalar,
|
|
6078
|
-
Float64Array: (x) =>
|
|
6189
|
+
Float64Array: (x) => {
|
|
6190
|
+
const wasm = elementwiseUnaryDispatch("erfc", x);
|
|
6191
|
+
if (wasm) return Promise.resolve(wasm);
|
|
6192
|
+
return mapArray(x, erfcScalar, () => kernelSource([_erfSeries, _erfcCF, erfcScalar], "(x) => erfcScalar(x)"));
|
|
6193
|
+
}
|
|
6079
6194
|
});
|
|
6080
6195
|
var erfi = mathTyped9("erfi", {
|
|
6081
6196
|
number: erfiScalar,
|
|
@@ -6440,6 +6555,38 @@ var typedSpecial = {
|
|
|
6440
6555
|
ellipticPi
|
|
6441
6556
|
};
|
|
6442
6557
|
|
|
6558
|
+
// src/typed/fused.ts
|
|
6559
|
+
var SCALAR = {
|
|
6560
|
+
abs: Math.abs,
|
|
6561
|
+
sin: Math.sin,
|
|
6562
|
+
cos: Math.cos,
|
|
6563
|
+
tan: Math.tan,
|
|
6564
|
+
exp: Math.exp,
|
|
6565
|
+
log: Math.log,
|
|
6566
|
+
atan: Math.atan,
|
|
6567
|
+
sinh: Math.sinh,
|
|
6568
|
+
tanh: Math.tanh,
|
|
6569
|
+
atanh: Math.atanh,
|
|
6570
|
+
expm1: Math.expm1,
|
|
6571
|
+
log1p: Math.log1p,
|
|
6572
|
+
log2: Math.log2,
|
|
6573
|
+
log10: Math.log10,
|
|
6574
|
+
sec: (x) => 1 / Math.cos(x),
|
|
6575
|
+
csc: (x) => 1 / Math.sin(x),
|
|
6576
|
+
cot: (x) => 1 / Math.tan(x),
|
|
6577
|
+
erfc: erfcScalar
|
|
6578
|
+
};
|
|
6579
|
+
function fuseUnaryChain(ops, xs) {
|
|
6580
|
+
const wasm = elementwiseChainDispatch(ops, xs);
|
|
6581
|
+
if (wasm) return wasm;
|
|
6582
|
+
const out = Float64Array.from(xs);
|
|
6583
|
+
for (const op of ops) {
|
|
6584
|
+
const f = SCALAR[op];
|
|
6585
|
+
for (let i = 0; i < out.length; i++) out[i] = f(out[i]);
|
|
6586
|
+
}
|
|
6587
|
+
return out;
|
|
6588
|
+
}
|
|
6589
|
+
|
|
6443
6590
|
// src/typed/distributions.ts
|
|
6444
6591
|
import { mathTyped as mathTyped10 } from "@danielsimonjr/mathts-core";
|
|
6445
6592
|
import { computePool as computePool7 } from "@danielsimonjr/mathts-parallel";
|
|
@@ -7529,7 +7676,7 @@ async function distanceMatrix(points) {
|
|
|
7529
7676
|
|
|
7530
7677
|
// src/wasm/poly/wasm-bridge.ts
|
|
7531
7678
|
var WASM_POLY_THRESHOLD = 256;
|
|
7532
|
-
function
|
|
7679
|
+
function getWasm5() {
|
|
7533
7680
|
try {
|
|
7534
7681
|
return wasmLoader.getModule();
|
|
7535
7682
|
} catch {
|
|
@@ -7574,7 +7721,7 @@ function polyDivModJS(num, den) {
|
|
|
7574
7721
|
function polyMulDispatch(a, b) {
|
|
7575
7722
|
const bigEnough = a.length >= WASM_POLY_THRESHOLD || b.length >= WASM_POLY_THRESHOLD;
|
|
7576
7723
|
if (bigEnough) {
|
|
7577
|
-
const wasm =
|
|
7724
|
+
const wasm = getWasm5();
|
|
7578
7725
|
if (wasm) {
|
|
7579
7726
|
try {
|
|
7580
7727
|
const rustFn = wasm["poly_mul_f64"];
|
|
@@ -7606,7 +7753,7 @@ function polyDivModDispatch(num, den) {
|
|
|
7606
7753
|
if (den.length === 0) throw new Error("Division by zero polynomial");
|
|
7607
7754
|
const bigEnough = num.length >= WASM_POLY_THRESHOLD;
|
|
7608
7755
|
if (bigEnough) {
|
|
7609
|
-
const wasm =
|
|
7756
|
+
const wasm = getWasm5();
|
|
7610
7757
|
if (wasm) {
|
|
7611
7758
|
try {
|
|
7612
7759
|
const rustFn = wasm["poly_div_mod_f64"];
|
|
@@ -7734,7 +7881,7 @@ function discriminantJS(p) {
|
|
|
7734
7881
|
function resultantDispatch(p, q) {
|
|
7735
7882
|
const bigEnough = p.length >= WASM_POLY_THRESHOLD || q.length >= WASM_POLY_THRESHOLD;
|
|
7736
7883
|
if (bigEnough) {
|
|
7737
|
-
const wasm =
|
|
7884
|
+
const wasm = getWasm5();
|
|
7738
7885
|
if (wasm) {
|
|
7739
7886
|
try {
|
|
7740
7887
|
const rustFn = wasm["poly_resultant_f64"];
|
|
@@ -7761,7 +7908,7 @@ function resultantDispatch(p, q) {
|
|
|
7761
7908
|
function discriminantDispatch(p) {
|
|
7762
7909
|
const bigEnough = p.length >= WASM_POLY_THRESHOLD;
|
|
7763
7910
|
if (bigEnough) {
|
|
7764
|
-
const wasm =
|
|
7911
|
+
const wasm = getWasm5();
|
|
7765
7912
|
if (wasm) {
|
|
7766
7913
|
try {
|
|
7767
7914
|
const rustFn = wasm["poly_discriminant_f64"];
|
|
@@ -7882,7 +8029,7 @@ function fitDispatch(xs, ys, degree2, rustName, asName, jsFallback) {
|
|
|
7882
8029
|
if (xs.length !== ys.length) throw new Error("xs and ys must have the same length");
|
|
7883
8030
|
const bigEnough = xs.length >= WASM_POLY_FIT_THRESHOLD;
|
|
7884
8031
|
if (bigEnough) {
|
|
7885
|
-
const wasm =
|
|
8032
|
+
const wasm = getWasm5();
|
|
7886
8033
|
if (wasm) {
|
|
7887
8034
|
try {
|
|
7888
8035
|
const rustFn = wasm[rustName];
|
|
@@ -8881,7 +9028,7 @@ async function romberg(f, a, b, tol = 1e-12, options = {}) {
|
|
|
8881
9028
|
// src/wasm/interpolation/wasm-bridge.ts
|
|
8882
9029
|
var WASM_TRIDIAG_THRESHOLD = 1024;
|
|
8883
9030
|
var WASM_INTERP_THRESHOLD = 256;
|
|
8884
|
-
function
|
|
9031
|
+
function getWasm6() {
|
|
8885
9032
|
try {
|
|
8886
9033
|
return wasmLoader.getModule();
|
|
8887
9034
|
} catch {
|
|
@@ -8917,7 +9064,7 @@ function tridiagSolveJS(diag2, lower, upper, rhs) {
|
|
|
8917
9064
|
function tridiagSolveDispatch(diag2, lower, upper, rhs) {
|
|
8918
9065
|
const n = diag2.length;
|
|
8919
9066
|
if (n >= WASM_TRIDIAG_THRESHOLD) {
|
|
8920
|
-
const wasm =
|
|
9067
|
+
const wasm = getWasm6();
|
|
8921
9068
|
if (wasm) {
|
|
8922
9069
|
try {
|
|
8923
9070
|
const rustFn = wasm["tridiag_solve_f64"];
|
|
@@ -8978,7 +9125,7 @@ function dividedDifferenceJS(xs, ys) {
|
|
|
8978
9125
|
function dividedDifferenceDispatch(xs, ys) {
|
|
8979
9126
|
const n = xs.length;
|
|
8980
9127
|
if (n >= WASM_INTERP_THRESHOLD) {
|
|
8981
|
-
const wasm =
|
|
9128
|
+
const wasm = getWasm6();
|
|
8982
9129
|
if (wasm) {
|
|
8983
9130
|
try {
|
|
8984
9131
|
const rustFn = wasm["divided_difference_f64"];
|
|
@@ -45773,6 +45920,7 @@ export {
|
|
|
45773
45920
|
equalText,
|
|
45774
45921
|
erf,
|
|
45775
45922
|
erfc,
|
|
45923
|
+
erfcScalar,
|
|
45776
45924
|
erfi,
|
|
45777
45925
|
eulerPhi,
|
|
45778
45926
|
evaluate,
|
|
@@ -45877,6 +46025,7 @@ export {
|
|
|
45877
46025
|
fresnelS,
|
|
45878
46026
|
fullSimplify,
|
|
45879
46027
|
functionExpand,
|
|
46028
|
+
fuseUnaryChain,
|
|
45880
46029
|
gamma,
|
|
45881
46030
|
gammaDist,
|
|
45882
46031
|
gammaPDF,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arithmetic.d.ts","sourceRoot":"","sources":["../../src/typed/arithmetic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAe,WAAW,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"arithmetic.d.ts","sourceRoot":"","sources":["../../src/typed/arithmetic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAe,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAU1E,4BAA4B;AAC5B,KAAK,GAAG,GAAG,MAAM,CAAC;AASlB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,GAAG,wCAwCd,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,QAAQ,wCAyBnB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,QAAQ,wCAgDnB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,MAAM,wCAyBjB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,UAAU,wCAYrB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,SAAS,wCAO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G;AACH,wBAAsB,KAAK,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAGnF;AAMD;;GAEG;AACH,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpD;AAED;;GAEG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAEnD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,GAAG,GAAG,OAAO,CAE5D;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAMD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+E3B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Op-fusion public API (Tier 3 of the WASM pairing gap plan).
|
|
3
|
+
*
|
|
4
|
+
* Applies a *chain* of unary elementwise ops with the array resident in WASM
|
|
5
|
+
* memory across the whole chain, so the JS↔wasm transfer is paid **once**, not
|
|
6
|
+
* once per op. This is the structural lever the per-op benchmarks pointed to:
|
|
7
|
+
* a single op barely beats (or loses to) JS once the copy is counted, but a
|
|
8
|
+
* chain of K ops amortizes that one copy over K kernels.
|
|
9
|
+
*
|
|
10
|
+
* fuseUnaryChain(['sin', 'exp'], xs) // = exp(sin(x)), one copy in + one out
|
|
11
|
+
*
|
|
12
|
+
* Falls back to a sequential JS scalar pass when WASM is unavailable or the
|
|
13
|
+
* array is below threshold, so the result is always correct.
|
|
14
|
+
*/
|
|
15
|
+
import { type WasmElementwiseOp } from '../wasm/elementwise/wasm-bridge.js';
|
|
16
|
+
/**
|
|
17
|
+
* Apply `ops` left-to-right over `xs` (i.e. `ops[last](…ops[0](x))`), fused in
|
|
18
|
+
* WASM when possible. Returns a new `Float64Array`; never mutates `xs`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function fuseUnaryChain(ops: WasmElementwiseOp[], xs: Float64Array): Float64Array;
|
|
21
|
+
//# sourceMappingURL=fused.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fused.d.ts","sourceRoot":"","sources":["../../src/typed/fused.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,oCAAoC,CAAC;AAyB5C;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,iBAAiB,EAAE,EAAE,EAAE,EAAE,YAAY,GAAG,YAAY,CASvF"}
|
package/dist/typed/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export { typedComplex } from './complex.js';
|
|
|
29
29
|
export * from './set.js';
|
|
30
30
|
export { typedSet } from './set.js';
|
|
31
31
|
export * from './special.js';
|
|
32
|
+
export * from './fused.js';
|
|
32
33
|
export { typedSpecial } from './special.js';
|
|
33
34
|
export * from './distributions.js';
|
|
34
35
|
export { typedDistributions } from './distributions.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/typed/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,cAAc,cAAc,CA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,mBAAmB,CAAC;AAGlC,cAAc,iBAAiB,CAAC;AAWhC,cAAc,iBAAiB,CAAC;AAGhC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAGvC,cAAc,UAAU,CAAC;AAIzB,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGlD,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGpD,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAsCtC;;;;;;GAMG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8B1B,CAAC"}
|
package/dist/typed/special.d.ts
CHANGED
|
@@ -12,6 +12,10 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @packageDocumentation
|
|
14
14
|
*/
|
|
15
|
+
/** 64-bit float (default for decimals) */
|
|
16
|
+
type f64 = number;
|
|
17
|
+
/** Complementary error function erfc(x) = 1 - erf(x). */
|
|
18
|
+
export declare function erfcScalar(x: f64): f64;
|
|
15
19
|
/**
|
|
16
20
|
* Complementary error function: erfc(x) = 1 - erf(x).
|
|
17
21
|
*
|
|
@@ -466,4 +470,5 @@ export declare const typedSpecial: {
|
|
|
466
470
|
ellipticEIncomplete: import("typed-function").TypedFunction;
|
|
467
471
|
ellipticPi: import("typed-function").TypedFunction;
|
|
468
472
|
};
|
|
473
|
+
export {};
|
|
469
474
|
//# sourceMappingURL=special.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"special.d.ts","sourceRoot":"","sources":["../../src/typed/special.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"special.d.ts","sourceRoot":"","sources":["../../src/typed/special.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AA6CH,0CAA0C;AAC1C,KAAK,GAAG,GAAG,MAAM,CAAC;AAmGlB,yDAAyD;AACzD,wBAAgB,UAAU,CAAC,CAAC,EAAE,GAAG,GAAG,GAAG,CAKtC;AAw5BD;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,wCAOf,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,IAAI,wCAIf,CAAC;AAMH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,MAAM,wCAQjB,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,IAAI,wCAQf,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,wCAQnB,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,wCASpB,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,wCAQlB,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,OAAO,wCAIlB,CAAC;AAMH;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,wCAUnB,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,wCAUnB,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,wCAUnB,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,wCAUnB,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,wCAgBlB,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,O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wCAMpB,CAAC;AAYH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,wCAMpB,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,wCAM9B,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,UAAU,wCAMrB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigonometry.d.ts","sourceRoot":"","sources":["../../src/typed/trigonometry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"trigonometry.d.ts","sourceRoot":"","sources":["../../src/typed/trigonometry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAkBH;;GAEG;AACH,eAAO,MAAM,GAAG,wCAYd,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,GAAG,wCAYd,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,GAAG,wCAYd,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,GAAG,wCAiBd,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,GAAG,wCAiBd,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,GAAG,wCAiBd,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,IAAI,wCAqBf,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,IAAI,wCAoBf,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,IAAI,wCAiBf,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,KAAK,wCAEhB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,IAAI,wCAGf,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,IAAI,wCAGf,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,IAAI,wCAGf,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,KAAK,wCAehB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,KAAK,wCAehB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,KAAK,wCAiBhB,CAAC;AAMH;;GAEG;AACH,eAAO,MAAM,SAAS,wCAEpB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,SAAS,wCAEpB,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,KAAK,wCAKhB,CAAC;AAMH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;CA2B7B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** Element-count threshold above which the WASM kernel beats JS. */
|
|
2
|
+
export declare const WASM_ELEMENTWISE_THRESHOLD = 1024;
|
|
3
|
+
/**
|
|
4
|
+
* Unary ops with a Rust `simd_<op>_array` kernel that is benchmark-confirmed
|
|
5
|
+
* net-faster than JS (see tools/benchmark/wasm/{elementwise,transcendental}.bench.mjs).
|
|
6
|
+
* Excluded after measuring (JS wins): sqrt, cbrt, asin, acos, cosh, asinh, acosh.
|
|
7
|
+
*/
|
|
8
|
+
export declare const WASM_ELEMENTWISE_OPS: readonly ["abs", "sin", "cos", "tan", "exp", "log", "atan", "sinh", "tanh", "atanh", "expm1", "log1p", "log2", "log10", "sec", "csc", "cot", "erfc"];
|
|
9
|
+
export type WasmElementwiseOp = (typeof WASM_ELEMENTWISE_OPS)[number];
|
|
10
|
+
/**
|
|
11
|
+
* Apply a unary elementwise op over `xs` via the Rust `simd_<op>_array` kernel.
|
|
12
|
+
* Returns the result, or `null` (below threshold, wasm unavailable, kernel
|
|
13
|
+
* missing, or any failure) — in which case the caller uses its JS/parallel path.
|
|
14
|
+
* Never throws.
|
|
15
|
+
*/
|
|
16
|
+
export declare function elementwiseUnaryDispatch(op: WasmElementwiseOp, xs: Float64Array): Float64Array | null;
|
|
17
|
+
/**
|
|
18
|
+
* Op-fusion (Tier 3): apply a *chain* of unary ops with the data resident in
|
|
19
|
+
* wasm memory the whole time — one copy-in, one copy-out, regardless of chain
|
|
20
|
+
* length. `fuseUnaryChain([sin, exp])` computes `exp(sin(x))` paying the JS↔wasm
|
|
21
|
+
* transfer once instead of once per op. Ping-pongs between two scratch buffers
|
|
22
|
+
* (the simd kernels are out-of-place). Returns null (caller applies the chain in
|
|
23
|
+
* JS) below threshold, when wasm is unavailable, or any kernel is missing.
|
|
24
|
+
* Never throws.
|
|
25
|
+
*/
|
|
26
|
+
export declare function elementwiseChainDispatch(ops: WasmElementwiseOp[], xs: Float64Array): Float64Array | null;
|
|
27
|
+
//# sourceMappingURL=wasm-bridge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wasm-bridge.d.ts","sourceRoot":"","sources":["../../../src/wasm/elementwise/wasm-bridge.ts"],"names":[],"mappings":"AAoBA,oEAAoE;AACpE,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,sJAOvB,CAAC;AACX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAyBtE;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,YAAY,GAAG,YAAY,GAAG,IAAI,CA0BrG;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,iBAAiB,EAAE,EAAE,EAAE,EAAE,YAAY,GAAG,YAAY,GAAG,IAAI,CAqCxG"}
|
package/dist/wasm/mathts.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielsimonjr/mathts-functions",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
|
|
5
5
|
"author": "Daniel Simon Jr.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"build": "tsup src/index.ts --format esm --clean && tsc -p tsconfig.dts.json && node scripts/copy-wasm.mjs",
|
|
23
23
|
"dev": "tsup src/index.ts --format esm --dts --watch",
|
|
24
24
|
"test": "vitest run",
|
|
25
|
-
"test:diff": "node tests/diff-special.test.mjs",
|
|
25
|
+
"test:diff": "node tests/diff-special.test.mjs && node tests/diff-elementwise.test.mjs && node tests/diff-fusion.test.mjs",
|
|
26
26
|
"golden:gen": "python -X utf8 tests/golden/gen_special_goldens.py",
|
|
27
27
|
"test:watch": "vitest",
|
|
28
28
|
"test:coverage": "vitest run --coverage",
|