spear-kernels 1.6.0 → 1.8.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.
Files changed (4) hide show
  1. package/README.md +2 -2
  2. package/index.cjs +169 -123
  3. package/index.js +169 -123
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -42,5 +42,5 @@ instance.exports.spear(2); // same protected-division semantics as the JS backen
42
42
  ```
43
43
 
44
44
  Division is **protected** exactly like the engine: denominators floored at
45
- ±1e-4 (sign-preserving), results clamped to ±1e4. Discovered formulas rely on
46
- these rails — do not swap in bare `/`.
45
+ ±1e-4 (sign-preserving), results clamped to ±1e4. Discovered formulas rely on
46
+ these rails do not swap in bare `/`.
package/index.cjs CHANGED
@@ -1,46 +1,53 @@
1
- // Auto-generated by scripts/gen-kernels-package.ts — DO NOT EDIT.
1
+ // Auto-generated by scripts/gen-kernels-package.ts DO NOT EDIT.
2
2
  'use strict';
3
3
  const kernels = {
4
4
  "silu": {
5
5
  id: "silu",
6
6
  precise: {
7
- js: "((x) => ((0.997587 * (x * (0.501 + (0.587 * Math.min(1e4, Math.max(-1e4, (x) / (((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) < 1e-4 && ((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) > -1e-4 ? (((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) >= 0 ? 1e-4 : -1e-4) : ((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x))))))))))))) + -0.005749))",
8
- eval: ((x) => ((0.997587 * (x * (0.501 + (0.587 * Math.min(1e4, Math.max(-1e4, (x) / (((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) < 1e-4 && ((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) > -1e-4 ? (((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) >= 0 ? 1e-4 : -1e-4) : ((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x))))))))))))) + -0.005749)),
9
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((0.997587f * (x * (0.501f + (0.587f * fminf(fmaxf((x / copysignf(fmaxf(fabsf((0.815f + sqrtf(fabsf((0.909361f + powf(x, 2.0f)))))), 1.0e-4f), (0.815f + sqrtf(fabsf((0.909361f + powf(x, 2.0f))))))), -1.0e4f), 1.0e4f))))) + -0.005749f);\n}",
10
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((0.997587 * (x * (0.501 + (0.587 * (x / (abs((0.815 + torch.sqrt(torch.abs((0.909361 + (x * x)))))) < 1e-4 ? 1e-4 : (0.815 + torch.sqrt(torch.abs((0.909361 + (x * x))))))))))) + -0.005749)",
11
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACokBAYYBAESmRX2SO+zvPyAARNV46SYxCOA/RGIQWDm0yOI/IABEFK5H4XoU6j9EW0BoPXwZ7T8gACAAoqCZn6CZRC1DHOviNho/pUQUrkfhehTqP0RbQGg9fBntPyAAIACioJmfoKajRAAAAAAAiMPApUQAAAAAAIjDQKSioKKiRPtYwW9DjHe/oAs=",
7
+ js: "((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) < 1e-4 && ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) > -1e-4 ? (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.exp(Math.max(-50, Math.min(50, (-x))))))))))",
8
+ eval: ((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) < 1e-4 && ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) > -1e-4 ? (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))))))),
9
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((x / copysignf(fmaxf(fabsf((1f + expf(fmaxf(-50.0f, fminf(50.0f, (-x)))))), 1.0e-4f), (1f + expf(fmaxf(-50.0f, fminf(50.0f, (-x))))))), -1.0e4f), 1.0e4f);\n}",
10
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x / (abs((1 + torch.exp(torch.clamp((-x), -50.0, 50.0)))) < 1e-4 ? 1e-4 : (1 + torch.exp(torch.clamp((-x), -50.0, 50.0)))))",
11
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNleHAAAQMCAQAHCQEFc3BlYXIAAQptAWsAIABEAAAAAAAA8D8gAJpEAAAAAAAAScClRAAAAAAAAElApBAAoJlELUMc6+I2Gj+lRAAAAAAAAPA/IACaRAAAAAAAAEnApUQAAAAAAABJQKQQAKCmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
12
+ },
13
+ fast: {
14
+ js: "((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) < 1e-4 && ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) > -1e-4 ? (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.exp(Math.max(-50, Math.min(50, (-x))))))))))",
15
+ eval: ((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) < 1e-4 && ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) > -1e-4 ? (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))))))),
16
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((x / copysignf(fmaxf(fabsf((1f + expf(fmaxf(-50.0f, fminf(50.0f, (-x)))))), 1.0e-4f), (1f + expf(fmaxf(-50.0f, fminf(50.0f, (-x))))))), -1.0e4f), 1.0e4f);\n}",
17
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x / (abs((1 + torch.exp(torch.clamp((-x), -50.0, 50.0)))) < 1e-4 ? 1e-4 : (1 + torch.exp(torch.clamp((-x), -50.0, 50.0)))))",
18
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNleHAAAQMCAQAHCQEFc3BlYXIAAQptAWsAIABEAAAAAAAA8D8gAJpEAAAAAAAAScClRAAAAAAAAElApBAAoJlELUMc6+I2Gj+lRAAAAAAAAPA/IACaRAAAAAAAAEnApUQAAAAAAABJQKQQAKCmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
12
19
  },
13
20
  meta: {
14
- metric: 0.0007795906249592223,
15
- level: 2,
16
- formulaCost: 14,
21
+ metric: 0,
22
+ level: 5,
23
+ formulaCost: 7,
17
24
  exactCost: 34,
18
- speedupVsExact: 2.4285714285714284,
25
+ speedupVsExact: 4.857142857142857,
19
26
  vsIterative: null,
20
27
  },
21
28
  },
22
29
  "gelu": {
23
30
  id: "gelu",
24
31
  precise: {
25
- js: "((x) => ((0.997729 * (x * Math.min(1.002, Math.max(0, ((0.306923 * x) + 0.501))))) + -0.004004))",
26
- eval: ((x) => ((0.997729 * (x * Math.min(1.002, Math.max(0, ((0.306923 * x) + 0.501))))) + -0.004004)),
27
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((0.997729f * (x * fminf(1.002f, fmaxf(0.0f, ((0.306923f * x) + 0.501f))))) + -0.004004f);\n}",
28
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((0.997729 * (x * torch.minimum(1.002, torch.relu(((0.306923 * x) + 0.501))))) + -0.004004)",
29
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACkUBQwBEQ6ooXmXt7z8gAETVeOkmMQjwP0Qr+dhdoKTTPyAAokTVeOkmMQjgP6BEAAAAAAAAAAClpKKiRHfX2ZB/ZnC/oAs=",
32
+ js: "((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return ((0.5 * x) * (1 + __erf((x * 0.7071067811865475)))); })",
33
+ eval: ((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return ((0.5 * x) * (1 + __erf((x * 0.7071067811865475)))); }),
34
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((0.5f * x) * (1f + erff((x * 0.707107f))));\n}",
35
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((0.5 * x) * (1 + torch.erf((x * 0.707107))))",
36
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNlcmYAAQMCAQAHCQEFc3BlYXIAAQopAScARAAAAAAAAOA/IACiRAAAAAAAAPA/IABEzDt/Zp6g5j+iEACgogs=",
30
37
  },
31
38
  fast: {
32
- js: "((x) => (x * Math.min(1, Math.max(0, ((0.295845 * x) + 0.5)))))",
33
- eval: ((x) => (x * Math.min(1, Math.max(0, ((0.295845 * x) + 0.5))))),
34
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (x * fminf(1f, fmaxf(0.0f, ((0.295845f * x) + 0.5f))));\n}",
35
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x * torch.minimum(1, torch.relu(((0.295845 * x) + 0.5))))",
36
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACjEBLwAgAEQAAAAAAADwP0QC2evdH+/SPyAAokQAAAAAAADgP6BEAAAAAAAAAAClpKIL",
39
+ js: "((x) => Math.max(0, x))",
40
+ eval: ((x) => Math.max(0, x)),
41
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fmaxf(0.0f, x);\n}",
42
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.relu(x)",
43
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAAChABDgAgAEQAAAAAAAAAAKUL",
37
44
  },
38
45
  meta: {
39
- metric: 0.0005322566020140329,
40
- level: 2,
41
- formulaCost: 7,
46
+ metric: 1.5455587803707568e-34,
47
+ level: 5,
48
+ formulaCost: 5,
42
49
  exactCost: 46,
43
- speedupVsExact: 6.571428571428571,
50
+ speedupVsExact: 9.2,
44
51
  vsIterative: null,
45
52
  },
46
53
  },
@@ -54,11 +61,11 @@ const kernels = {
54
61
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNleHAAAQMCAQAHCQEFc3BlYXIAAQp9AXsARAAAAAAAAPA/RAAAAAAAAPA/IABEAAAAAAAAScClRAAAAAAAAElApBAAoJlELUMc6+I2Gj+lRAAAAAAAAPA/IABEAAAAAAAAScClRAAAAAAAAElApBAAoKajRAAAAAAAiMPApUQAAAAAAIjDQKSaRAAAAAAAAPA/oAs=",
55
62
  },
56
63
  fast: {
57
- js: "((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.abs(x))) < 1e-4 && ((1 + Math.abs(x))) > -1e-4 ? (((1 + Math.abs(x))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.abs(x)))))))",
58
- eval: ((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.abs(x))) < 1e-4 && ((1 + Math.abs(x))) > -1e-4 ? (((1 + Math.abs(x))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.abs(x))))))),
59
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((x / copysignf(fmaxf(fabsf((1f + fabsf(x))), 1.0e-4f), (1f + fabsf(x)))), -1.0e4f), 1.0e4f);\n}",
60
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x / (abs((1 + torch.abs(x))) < 1e-4 ? 1e-4 : (1 + torch.abs(x))))",
61
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACkEBPwAgAEQAAAAAAADwPyAAmaCZRC1DHOviNho/pUQAAAAAAADwPyAAmaCmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
64
+ js: "((x) => Math.atan(x))",
65
+ eval: ((x) => Math.atan(x)),
66
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return atanf(x);\n}",
67
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.atan(x)",
68
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhdGFuAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
62
69
  },
63
70
  meta: {
64
71
  metric: 4.790511494175498e-33,
@@ -154,11 +161,11 @@ const kernels = {
154
161
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhdGFuAAEDAgEABwkBBXNwZWFyAAEKOgE4AETOGyeFeY/cP0RsI57sZkbuPyAARBBYObTIdgHApaJEpTLFHARdAECkEACiREPFOH8TCuA/oAs=",
155
162
  },
156
163
  fast: {
157
- js: "((x) => ((0.543518 * Math.min(1e4, Math.max(-1e4, (x) / ((Math.max(1.559472, (0.337459 + Math.abs(x)))) < 1e-4 && (Math.max(1.559472, (0.337459 + Math.abs(x)))) > -1e-4 ? ((Math.max(1.559472, (0.337459 + Math.abs(x)))) >= 0 ? 1e-4 : -1e-4) : (Math.max(1.559472, (0.337459 + Math.abs(x)))))))) + 0.5))",
158
- eval: ((x) => ((0.543518 * Math.min(1e4, Math.max(-1e4, (x) / ((Math.max(1.559472, (0.337459 + Math.abs(x)))) < 1e-4 && (Math.max(1.559472, (0.337459 + Math.abs(x)))) > -1e-4 ? ((Math.max(1.559472, (0.337459 + Math.abs(x)))) >= 0 ? 1e-4 : -1e-4) : (Math.max(1.559472, (0.337459 + Math.abs(x)))))))) + 0.5)),
159
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((0.543518f * fminf(fmaxf((x / copysignf(fmaxf(fabsf(fmaxf(1.559472f, (0.337459f + fabsf(x)))), 1.0e-4f), fmaxf(1.559472f, (0.337459f + fabsf(x))))), -1.0e4f), 1.0e4f)) + 0.5f);\n}",
160
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((0.543518 * (x / (abs(torch.maximum(1.559472, (0.337459 + torch.abs(x)))) < 1e-4 ? 1e-4 : torch.maximum(1.559472, (0.337459 + torch.abs(x)))))) + 0.5)",
161
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACmkBZwBEyjFZ3H9k4T8gAESCcXDpmPP4P0RRai+i7ZjVPyAAmaClmUQtQxzr4jYaP6VEgnFw6Zjz+D9EUWovou2Y1T8gAJmgpaajRAAAAAAAiMPApUQAAAAAAIjDQKSiRAAAAAAAAOA/oAs=",
164
+ js: "((x) => Math.tanh(x))",
165
+ eval: ((x) => Math.tanh(x)),
166
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return tanhf(x);\n}",
167
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.tanh(x)",
168
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgR0YW5oAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
162
169
  },
163
170
  meta: {
164
171
  metric: 0.000016407954856661242,
@@ -254,11 +261,11 @@ const kernels = {
254
261
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AiADA2VudgNleHAAAQNlbnYEYXRhbgABA2VudgNsb2cAAQMCAQAHCQEFc3BlYXIAAwpIAUYARFrhtkDMt/a/RHWuKCUE6wFAIABEAAAAAAAAScClRAAAAAAAAElApBAAEAFEoMLr/ktItDmlEAKhokTf3Weg90IMQKAL",
255
262
  },
256
263
  fast: {
257
- js: "((t) => (((6.643258 - t)) * ((6.643258 - t)) * ((6.643258 - t))) * (((6.643258 - t)) * ((6.643258 - t)) * ((6.643258 - t))))",
258
- eval: ((t) => (((6.643258 - t)) * ((6.643258 - t)) * ((6.643258 - t))) * (((6.643258 - t)) * ((6.643258 - t)) * ((6.643258 - t)))),
259
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return powf(powf((6.643258f - t), 3.0f), 2.0f);\n}",
260
- py: "import torch\n\ndef spear_fn(t):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (((6.643258 - t) ** 3) * ((6.643258 - t) ** 3))",
261
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAAClEBTwBEvY+jObKSGkAgAKFEvY+jObKSGkAgAKFEvY+jObKSGkAgAKGiokS9j6M5spIaQCAAoUS9j6M5spIaQCAAoUS9j6M5spIaQCAAoaKiogs=",
264
+ js: "((t) => Math.exp(Math.max(-50, Math.min(50, (-t)))))",
265
+ eval: ((t) => Math.exp(Math.max(-50, Math.min(50, (-t))))),
266
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return expf(fmaxf(-50.0f, fminf(50.0f, (-t))));\n}",
267
+ py: "import torch\n\ndef spear_fn(t):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.exp(torch.clamp((-t), -50.0, 50.0))",
268
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNleHAAAQMCAQAHCQEFc3BlYXIAAQodARsAIACaRAAAAAAAAEnApUQAAAAAAABJQKQQAAs=",
262
269
  },
263
270
  meta: {
264
271
  metric: 0.00007258403509477666,
@@ -378,6 +385,13 @@ const kernels = {
378
385
  py: "import torch\n\ndef spear_fn(b, a):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (b - a)",
379
386
  wasmBase64: "AGFzbQEAAAABDAJgAnx8AXxgAXwBfAMCAQAHCQEFc3BlYXIAAAoJAQcAIAAgAaEL",
380
387
  },
388
+ fast: {
389
+ js: "((a, b) => (a - b))",
390
+ eval: ((a, b) => (a - b)),
391
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (a - b);\n}",
392
+ py: "import torch\n\ndef spear_fn(a, b):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (a - b)",
393
+ wasmBase64: "AGFzbQEAAAABDAJgAnx8AXxgAXwBfAMCAQAHCQEFc3BlYXIAAAoJAQcAIAAgAaEL",
394
+ },
381
395
  meta: {
382
396
  metric: 0,
383
397
  level: 5,
@@ -676,11 +690,11 @@ const kernels = {
676
690
  wasmBase64: "AGFzbQEAAAABDQJgA3x8fAF8YAF8AXwDAgEABwkBBXNwZWFyAAAK+AEB9QEARJNWfEPhM/0/RGZmZmZmZv4/RAMkmkARyxTARCO6Z12j5eo/IAAgAKIgACAAoqJEje21oPfGsD6ioUTUtfY+VSUDQESscTYdAdzbvyAARILlCBnIs/g/oiAAIAGiRLix2ZHqO8s/oqCloCACmUQtQxzr4jYaP6UgAqajRAAAAAAAiMPApUQAAAAAAIjDQKRE1LX2PlUlA0BErHE2HQHc278gAESC5QgZyLP4P6IgACABokS4sdmR6jvLP6KgpaAgAplELUMc6+I2Gj+lIAKmo0QAAAAAAIjDwKVEAAAAAACIw0CkoqGlpKJEShr5fwEe3z+gCw==",
677
691
  },
678
692
  fast: {
679
- js: "((v, dv, s) => ((1.1414205468162575 * ((1.22047 * Math.min(1.9, Math.max(-7.31, ((1 - (((v) * (v)) * ((v) * (v)) * 0.000001)) - (Math.min(1e4, Math.max(-1e4, ((3.45 + Math.max(-0.05, ((v * 1.45) + ((v * dv) * 0.212766))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))) * (Math.min(1e4, Math.max(-1e4, ((3.45 + Math.max(-0.05, ((v * 1.45) + ((v * dv) * 0.212766))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))))))) + 0.215661)) + 0.024217427345017313))",
680
- eval: ((v, dv, s) => ((1.1414205468162575 * ((1.22047 * Math.min(1.9, Math.max(-7.31, ((1 - (((v) * (v)) * ((v) * (v)) * 0.000001)) - (Math.min(1e4, Math.max(-1e4, ((3.45 + Math.max(-0.05, ((v * 1.45) + ((v * dv) * 0.212766))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))) * (Math.min(1e4, Math.max(-1e4, ((3.45 + Math.max(-0.05, ((v * 1.45) + ((v * dv) * 0.212766))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))))))) + 0.215661)) + 0.024217427345017313)),
681
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((1.141421f * ((1.22047f * fminf(1.9f, fmaxf(-7.31f, ((1f - (powf(powf(v, 2.0f), 2.0f) * 0.000001f)) - powf(fminf(fmaxf(((3.45f + fmaxf(-0.05f, ((v * 1.45f) + ((v * dv) * 0.212766f)))) / copysignf(fmaxf(fabsf(s), 1.0e-4f), s)), -1.0e4f), 1.0e4f), 2.0f))))) + 0.215661f)) + 0.024217f);\n}",
682
- py: "import torch\n\ndef spear_fn(v, dv, s):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((1.141421 * ((1.22047 * torch.minimum(1.9, torch.maximum(-7.31, ((1 - (((v * v) * (v * v)) * 0.000001)) - (((3.45 + torch.maximum(-0.05, ((v * 1.45) + ((v * dv) * 0.212766)))) / (abs(s) < 1e-4 ? 1e-4 : s)) * ((3.45 + torch.maximum(-0.05, ((v * 1.45) + ((v * dv) * 0.212766)))) / (abs(s) < 1e-4 ? 1e-4 : s))))))) + 0.215661)) + 0.024217)",
683
- wasmBase64: "AGFzbQEAAAABDQJgA3x8fAF8YAF8AXwDAgEABwkBBXNwZWFyAAAKjAIBiQIARKXu+DBCQ/I/RGX8+4wLh/M/RGZmZmZmZv4/RD0K16NwPR3ARAAAAAAAAPA/IAAgAKIgACAAoqJEje21oPfGsD6ioUSamZmZmZkLQESamZmZmZmpvyAARDMzMzMzM/c/oiAAIAGiRLix2ZHqO8s/oqCloCACmUQtQxzr4jYaP6UgAqajRAAAAAAAiMPApUQAAAAAAIjDQKREmpmZmZmZC0BEmpmZmZmZqb8gAEQzMzMzMzP3P6IgACABokS4sdmR6jvLP6KgpaAgAplELUMc6+I2Gj+lIAKmo0QAAAAAAIjDwKVEAAAAAACIw0CkoqGlpKJEZOYCl8eayz+gokQCq8IJdMyYP6AL",
693
+ js: "((v, dv, s) => Math.min(1.743715, Math.max(-8.6, ((1 - (((v) * (v)) * ((v) * (v)) * 0.0000010828124103295972)) - (Math.min(1e4, Math.max(-1e4, ((2.3 + Math.max(0, ((v * 1.45) + ((v * dv) * 0.2127659574468085))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))) * (Math.min(1e4, Math.max(-1e4, ((2.3 + Math.max(0, ((v * 1.45) + ((v * dv) * 0.2127659574468085))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s)))))))))",
694
+ eval: ((v, dv, s) => Math.min(1.743715, Math.max(-8.6, ((1 - (((v) * (v)) * ((v) * (v)) * 0.0000010828124103295972)) - (Math.min(1e4, Math.max(-1e4, ((2.3 + Math.max(0, ((v * 1.45) + ((v * dv) * 0.2127659574468085))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))) * (Math.min(1e4, Math.max(-1e4, ((2.3 + Math.max(0, ((v * 1.45) + ((v * dv) * 0.2127659574468085))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))))))),
695
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(1.743715f, fmaxf(-8.6f, ((1f - (powf(powf(v, 2.0f), 2.0f) * 0.000001f)) - powf(fminf(fmaxf(((2.3f + fmaxf(0f, ((v * 1.45f) + ((v * dv) * 0.212766f)))) / copysignf(fmaxf(fabsf(s), 1.0e-4f), s)), -1.0e4f), 1.0e4f), 2.0f))));\n}",
696
+ py: "import torch\n\ndef spear_fn(v, dv, s):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.minimum(1.743715, torch.maximum(-8.6, ((1 - (((v * v) * (v * v)) * 0.000001)) - (((2.3 + torch.maximum(0, ((v * 1.45) + ((v * dv) * 0.212766)))) / (abs(s) < 1e-4 ? 1e-4 : s)) * ((2.3 + torch.maximum(0, ((v * 1.45) + ((v * dv) * 0.212766)))) / (abs(s) < 1e-4 ? 1e-4 : s))))))",
697
+ wasmBase64: "AGFzbQEAAAABDQJgA3x8fAF8YAF8AXwDAgEABwkBBXNwZWFyAAAK5AEB4QEARNi2KLNB5vs/RDMzMzMzMyHARAAAAAAAAPA/IAAgAKIgACAAoqJEp8L61aQqsj6ioURmZmZmZmYCQEQAAAAAAAAAACAARDMzMzMzM/c/oiAAIAGiRG3UdzbqO8s/oqCloCACmUQtQxzr4jYaP6UgAqajRAAAAAAAiMPApUQAAAAAAIjDQKREZmZmZmZmAkBEAAAAAAAAAAAgAEQzMzMzMzP3P6IgACABokRt1Hc26jvLP6KgpaAgAplELUMc6+I2Gj+lIAKmo0QAAAAAAIjDwKVEAAAAAACIw0CkoqGlpAs=",
684
698
  },
685
699
  meta: {
686
700
  metric: 0.002938652617546022,
@@ -701,11 +715,11 @@ const kernels = {
701
715
  wasmBase64: "AGFzbQEAAAABDgJgBHx8fHwBfGABfAF8AwIBAAcJAQVzcGVhcgAACn8BfQBEP5EnSddM4D8gAES8dJMYBFbqP6IgAUQQWDm0yHbeP6KhIAJEmpmZmZmZ8T+iIANEzosTX+0o07+ioKAgAEQ9CtejcD3qP6IgAUQUrkfhehTeP6KhIAJEoYDtYMR+8T+iIANE3BFOC1700b+ioKCgokQAgG/7jCPVPqAL",
702
716
  },
703
717
  fast: {
704
- js: "((x0, x1, x2, x3) => (((x0 * 0.82) - (x1 * 0.470006)) + ((x2 * 1.1) + (x3 * -0.290238))))",
705
- eval: ((x0, x1, x2, x3) => (((x0 * 0.82) - (x1 * 0.470006)) + ((x2 * 1.1) + (x3 * -0.290238)))),
706
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (((x0 * 0.82f) - (x1 * 0.470006f)) + ((x2 * 1.1f) + (x3 * -0.290238f)));\n}",
707
- py: "import torch\n\ndef spear_fn(x0, x1, x2, x3):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (((x0 * 0.82) - (x1 * 0.470006)) + ((x2 * 1.1) + (x3 * -0.290238)))",
708
- wasmBase64: "AGFzbQEAAAABDgJgBHx8fHwBfGABfAF8AwIBAAcJAQVzcGVhcgAACjcBNQAgAEQ9CtejcD3qP6IgAUQlH7sLlBTeP6KhIAJEmpmZmZmZ8T+iIANE2JyDZ0KT0r+ioKAL",
718
+ js: "((x0, x1, x2) => (((x0 * 0.82) - (x1 * 0.47)) + ((x2 * 1.1) + 0.82)))",
719
+ eval: ((x0, x1, x2) => (((x0 * 0.82) - (x1 * 0.47)) + ((x2 * 1.1) + 0.82))),
720
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (((x0 * 0.82f) - (x1 * 0.47f)) + ((x2 * 1.1f) + 0.82f));\n}",
721
+ py: "import torch\n\ndef spear_fn(x0, x1, x2):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (((x0 * 0.82) - (x1 * 0.47)) + ((x2 * 1.1) + 0.82))",
722
+ wasmBase64: "AGFzbQEAAAABDQJgA3x8fAF8YAF8AXwDAgEABwkBBXNwZWFyAAAKNAEyACAARD0K16NwPeo/oiABRBSuR+F6FN4/oqEgAkSamZmZmZnxP6JEPQrXo3A96j+goAs=",
709
723
  },
710
724
  meta: {
711
725
  metric: 1.6074532951505583e-7,
@@ -830,25 +844,25 @@ const kernels = {
830
844
  "tanh_sat": {
831
845
  id: "tanh_sat",
832
846
  precise: {
833
- js: "((x) => (0.900021 * Math.min(1e4, Math.max(-1e4, ((x + (0.053639 * (x) * (x) * (x)))) / (((0.90122 + (0.343141 * (x) * (x)))) < 1e-4 && ((0.90122 + (0.343141 * (x) * (x)))) > -1e-4 ? (((0.90122 + (0.343141 * (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((0.90122 + (0.343141 * (x) * (x)))))))))",
834
- eval: ((x) => (0.900021 * Math.min(1e4, Math.max(-1e4, ((x + (0.053639 * (x) * (x) * (x)))) / (((0.90122 + (0.343141 * (x) * (x)))) < 1e-4 && ((0.90122 + (0.343141 * (x) * (x)))) > -1e-4 ? (((0.90122 + (0.343141 * (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((0.90122 + (0.343141 * (x) * (x))))))))),
835
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (0.900021f * fminf(fmaxf(((x + (0.053639f * powf(x, 3.0f))) / copysignf(fmaxf(fabsf((0.90122f + (0.343141f * powf(x, 2.0f)))), 1.0e-4f), (0.90122f + (0.343141f * powf(x, 2.0f))))), -1.0e4f), 1.0e4f));\n}",
836
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (0.900021 * ((x + (0.053639 * (x ** 3))) / (abs((0.90122 + (0.343141 * (x * x)))) < 1e-4 ? 1e-4 : (0.90122 + (0.343141 * (x * x))))))",
837
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACnYBdABEqtIW1/jM7D8gAETBjZQtknarPyAAIAAgAKKioqBELQlQU8vW7D9Ezas6qwX21T8gACAAoqKgmUQtQxzr4jYaP6VELQlQU8vW7D9Ezas6qwX21T8gACAAoqKgpqNEAAAAAACIw8ClRAAAAAAAiMNApKIL",
847
+ js: "((x) => Math.tanh(x))",
848
+ eval: ((x) => Math.tanh(x)),
849
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return tanhf(x);\n}",
850
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.tanh(x)",
851
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgR0YW5oAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
838
852
  },
839
853
  fast: {
840
- js: "((x) => Math.min(1e4, Math.max(-1e4, (x) / (((2.598194 * (4.397731 + (x) * (x)))) < 1e-4 && ((2.598194 * (4.397731 + (x) * (x)))) > -1e-4 ? (((2.598194 * (4.397731 + (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((2.598194 * (4.397731 + (x) * (x))))))))",
841
- eval: ((x) => Math.min(1e4, Math.max(-1e4, (x) / (((2.598194 * (4.397731 + (x) * (x)))) < 1e-4 && ((2.598194 * (4.397731 + (x) * (x)))) > -1e-4 ? (((2.598194 * (4.397731 + (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((2.598194 * (4.397731 + (x) * (x)))))))),
842
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((x / copysignf(fmaxf(fabsf((2.598194f * (4.397731f + powf(x, 2.0f)))), 1.0e-4f), (2.598194f * (4.397731f + powf(x, 2.0f))))), -1.0e4f), 1.0e4f);\n}",
843
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x / (abs((2.598194 * (4.397731 + (x * x)))) < 1e-4 ? 1e-4 : (2.598194 * (4.397731 + (x * x)))))",
844
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAAClkBVwAgAESxTpXvGckEQEToa5bLRpcRQCAAIACioKKZRC1DHOviNho/pUSxTpXvGckEQEToa5bLRpcRQCAAIACioKKmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
854
+ js: "((x) => Math.tanh(x))",
855
+ eval: ((x) => Math.tanh(x)),
856
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return tanhf(x);\n}",
857
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.tanh(x)",
858
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgR0YW5oAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
845
859
  },
846
860
  meta: {
847
- metric: 0.0000046412770528300585,
848
- level: 4,
849
- formulaCost: 12,
861
+ metric: 0,
862
+ level: 5,
863
+ formulaCost: 1,
850
864
  exactCost: 20,
851
- speedupVsExact: 1.6666666666666667,
865
+ speedupVsExact: 20,
852
866
  vsIterative: null,
853
867
  },
854
868
  },
@@ -905,25 +919,25 @@ const kernels = {
905
919
  "erf_prob": {
906
920
  id: "erf_prob",
907
921
  precise: {
908
- js: "((x) => (1.106774 * Math.min(1e4, Math.max(-1e4, ((x + (0.034298 * (x) * (x) * (x)))) / (((0.995 + (0.378089 * (x) * (x)))) < 1e-4 && ((0.995 + (0.378089 * (x) * (x)))) > -1e-4 ? (((0.995 + (0.378089 * (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((0.995 + (0.378089 * (x) * (x)))))))))",
909
- eval: ((x) => (1.106774 * Math.min(1e4, Math.max(-1e4, ((x + (0.034298 * (x) * (x) * (x)))) / (((0.995 + (0.378089 * (x) * (x)))) < 1e-4 && ((0.995 + (0.378089 * (x) * (x)))) > -1e-4 ? (((0.995 + (0.378089 * (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((0.995 + (0.378089 * (x) * (x))))))))),
910
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (1.106774f * fminf(fmaxf(((x + (0.034298f * powf(x, 3.0f))) / copysignf(fmaxf(fabsf((0.995f + (0.378089f * powf(x, 2.0f)))), 1.0e-4f), (0.995f + (0.378089f * powf(x, 2.0f))))), -1.0e4f), 1.0e4f));\n}",
911
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (1.106774 * ((x + (0.034298 * (x ** 3))) / (abs((0.995 + (0.378089 * (x * x)))) < 1e-4 ? 1e-4 : (0.995 + (0.378089 * (x * x))))))",
912
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACnYBdABEeQJhp1i18T8gAEQp7KLogY+hPyAAIAAgAKKioqBE16NwPQrX7z9Ezox+NJwy2D8gACAAoqKgmUQtQxzr4jYaP6VE16NwPQrX7z9Ezox+NJwy2D8gACAAoqKgpqNEAAAAAACIw8ClRAAAAAAAiMNApKIL",
922
+ js: "((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return __erf(x); })",
923
+ eval: ((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return __erf(x); }),
924
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return erff(x);\n}",
925
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.erf(x)",
926
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNlcmYAAQMCAQAHCQEFc3BlYXIAAQoIAQYAIAAQAAs=",
913
927
  },
914
928
  fast: {
915
- js: "((x) => Math.sin(Math.sin(Math.atan(x))))",
916
- eval: ((x) => Math.sin(Math.sin(Math.atan(x)))),
917
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return sinf(sinf(atanf(x)));\n}",
918
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.sin(torch.sin(torch.atan(x)))",
919
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AhYCA2VudgNzaW4AAQNlbnYEYXRhbgABAwIBAAcJAQVzcGVhcgACCgwBCgAgABABEAAQAAs=",
929
+ js: "((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return __erf(x); })",
930
+ eval: ((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return __erf(x); }),
931
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return erff(x);\n}",
932
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.erf(x)",
933
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNlcmYAAQMCAQAHCQEFc3BlYXIAAQoIAQYAIAAQAAs=",
920
934
  },
921
935
  meta: {
922
- metric: 0.00004650870031371604,
923
- level: 3,
924
- formulaCost: 12,
936
+ metric: 0,
937
+ level: 5,
938
+ formulaCost: 1,
925
939
  exactCost: 26,
926
- speedupVsExact: 2.1666666666666665,
940
+ speedupVsExact: 26,
927
941
  vsIterative: null,
928
942
  },
929
943
  },
@@ -937,11 +951,11 @@ const kernels = {
937
951
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACoABAX4ARJrWYT4kC/C/RDvD1JY6CPI/IAAgAKJExZCcTNwqxL+hoUQ64i18lwLwPyAAmaVEH9YbtcL07z+gmUQtQxzr4jYaP6VEOuItfJcC8D8gAJmlRB/WG7XC9O8/oKajRAAAAAAAiMPApUQAAAAAAIjDQKSiRFTKGPauGd8/oAs=",
938
952
  },
939
953
  fast: {
940
- js: "((x) => Math.min(1e4, Math.max(-1e4, ((x) * (x)) / (((Math.abs(x) + 0.989)) < 1e-4 && ((Math.abs(x) + 0.989)) > -1e-4 ? (((Math.abs(x) + 0.989)) >= 0 ? 1e-4 : -1e-4) : ((Math.abs(x) + 0.989))))))",
941
- eval: ((x) => Math.min(1e4, Math.max(-1e4, ((x) * (x)) / (((Math.abs(x) + 0.989)) < 1e-4 && ((Math.abs(x) + 0.989)) > -1e-4 ? (((Math.abs(x) + 0.989)) >= 0 ? 1e-4 : -1e-4) : ((Math.abs(x) + 0.989)))))),
942
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((powf(x, 2.0f) / copysignf(fmaxf(fabsf((fabsf(x) + 0.989f)), 1.0e-4f), (fabsf(x) + 0.989f))), -1.0e4f), 1.0e4f);\n}",
943
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((x * x) / (abs((torch.abs(x) + 0.989)) < 1e-4 ? 1e-4 : (torch.abs(x) + 0.989)))",
944
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACkQBQgAgACAAoiAAmUTZzvdT46XvP6CZRC1DHOviNho/pSAAmUTZzvdT46XvP6Cmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
954
+ js: "((x) => Math.max(((x) * (x) * 0.098068), ((Math.abs(x) * 0.72) - 0.381094)))",
955
+ eval: ((x) => Math.max(((x) * (x) * 0.098068), ((Math.abs(x) * 0.72) - 0.381094))),
956
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fmaxf((powf(x, 2.0f) * 0.098068f), ((fabsf(x) * 0.72f) - 0.381094f));\n}",
957
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.maximum(((x * x) * 0.098068), ((torch.abs(x) * 0.72) - 0.381094))",
958
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACisBKQAgACAAokSdvMgE/Bq5P6IgAJlECtejcD0K5z+iRK/qrBbYY9g/oaUL",
945
959
  },
946
960
  meta: {
947
961
  metric: 2.992203818088443e-7,
@@ -1237,11 +1251,11 @@ const kernels = {
1237
1251
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNsb2cAAQMCAQAHCQEFc3BlYXIAAQpLAUkAIABEAAAAAAAA8D8gAKGZRC1DHOviNho/pUQAAAAAAADwPyAAoaajRAAAAAAAiMPApUQAAAAAAIjDQKREoMLr/ktItDmlEAAL",
1238
1252
  },
1239
1253
  fast: {
1240
- js: "((x) => Math.log(Math.max(1e-30, Math.min(1e4, Math.max(-1e4, (x) / (((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) < 1e-4 && ((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) > -1e-4 ? (((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) >= 0 ? 1e-4 : -1e-4) : ((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x))))))))",
1241
- eval: ((x) => Math.log(Math.max(1e-30, Math.min(1e4, Math.max(-1e4, (x) / (((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) < 1e-4 && ((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) > -1e-4 ? (((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) >= 0 ? 1e-4 : -1e-4) : ((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)))))))),
1242
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return logf(fmaxf(1.0e-30f, fminf(fmaxf((x / copysignf(fmaxf(fabsf((fminf(fmaxf((x / copysignf(fmaxf(fabsf(x), 1.0e-4f), x)), -1.0e4f), 1.0e4f) - x)), 1.0e-4f), (fminf(fmaxf((x / copysignf(fmaxf(fabsf(x), 1.0e-4f), x)), -1.0e4f), 1.0e4f) - x))), -1.0e4f), 1.0e4f)));\n}",
1243
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.log(torch.clamp((x / (abs(((x / (abs(x) < 1e-4 ? 1e-4 : x)) - x)) < 1e-4 ? 1e-4 : ((x / (abs(x) < 1e-4 ? 1e-4 : x)) - x))), min=1e-30))",
1244
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNsb2cAAQMCAQAHCQEFc3BlYXIAAQqIAQGFAQAgACAAIACZRC1DHOviNho/pSAApqNEAAAAAACIw8ClRAAAAAAAiMNApCAAoZlELUMc6+I2Gj+lIAAgAJlELUMc6+I2Gj+lIACmo0QAAAAAAIjDwKVEAAAAAACIw0CkIAChpqNEAAAAAACIw8ClRAAAAAAAiMNApESgwuv+S0i0OaUQAAs=",
1254
+ js: "((x) => Math.log(Math.max(1e-30, Math.min(1e4, Math.max(-1e4, (x) / (((1 - x)) < 1e-4 && ((1 - x)) > -1e-4 ? (((1 - x)) >= 0 ? 1e-4 : -1e-4) : ((1 - x))))))))",
1255
+ eval: ((x) => Math.log(Math.max(1e-30, Math.min(1e4, Math.max(-1e4, (x) / (((1 - x)) < 1e-4 && ((1 - x)) > -1e-4 ? (((1 - x)) >= 0 ? 1e-4 : -1e-4) : ((1 - x)))))))),
1256
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return logf(fmaxf(1.0e-30f, fminf(fmaxf((x / copysignf(fmaxf(fabsf((1f - x)), 1.0e-4f), (1f - x))), -1.0e4f), 1.0e4f)));\n}",
1257
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.log(torch.clamp((x / (abs((1 - x)) < 1e-4 ? 1e-4 : (1 - x))), min=1e-30))",
1258
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNsb2cAAQMCAQAHCQEFc3BlYXIAAQpLAUkAIABEAAAAAAAA8D8gAKGZRC1DHOviNho/pUQAAAAAAADwPyAAoaajRAAAAAAAiMPApUQAAAAAAIjDQKREoMLr/ktItDmlEAAL",
1245
1259
  },
1246
1260
  meta: {
1247
1261
  metric: 0,
@@ -1330,11 +1344,11 @@ const kernels = {
1330
1344
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACqcBAaQBAER4zU3WKLkUQCAARAtGJXUC81LAoCAARFILJZNT+w/AoZlELUMc6+I2Gj+lIABEUgslk1P7D8ChpqNEAAAAAACIw8ClRAAAAAAAiMNApEQfTfVk/rEEwCAAIABE2/y/6shxD8ChpZlELUMc6+I2Gj+lIAAgAETb/L/qyHEPwKGlpqNEAAAAAACIw8ClRAAAAAAAiMNApKGiRFK25bNttFdAoAs=",
1331
1345
  },
1332
1346
  fast: {
1333
- js: "((s) => (Math.min(1e4, Math.max(-1e4, (-79.794743) / (((s - -3.997718)) < 1e-4 && ((s - -3.997718)) > -1e-4 ? (((s - -3.997718)) >= 0 ? 1e-4 : -1e-4) : ((s - -3.997718))))) - Math.min(1e4, Math.max(-1e4, (-2.586911) / ((Math.max(-79.794743, (s - -3.930559))) < 1e-4 && (Math.max(-79.794743, (s - -3.930559))) > -1e-4 ? ((Math.max(-79.794743, (s - -3.930559))) >= 0 ? 1e-4 : -1e-4) : (Math.max(-79.794743, (s - -3.930559))))))))",
1334
- eval: ((s) => (Math.min(1e4, Math.max(-1e4, (-79.794743) / (((s - -3.997718)) < 1e-4 && ((s - -3.997718)) > -1e-4 ? (((s - -3.997718)) >= 0 ? 1e-4 : -1e-4) : ((s - -3.997718))))) - Math.min(1e4, Math.max(-1e4, (-2.586911) / ((Math.max(-79.794743, (s - -3.930559))) < 1e-4 && (Math.max(-79.794743, (s - -3.930559))) > -1e-4 ? ((Math.max(-79.794743, (s - -3.930559))) >= 0 ? 1e-4 : -1e-4) : (Math.max(-79.794743, (s - -3.930559)))))))),
1335
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (fminf(fmaxf((-79.794743f / copysignf(fmaxf(fabsf((s - -3.997718f)), 1.0e-4f), (s - -3.997718f))), -1.0e4f), 1.0e4f) - fminf(fmaxf((-2.586911f / copysignf(fmaxf(fabsf(fmaxf(-79.794743f, (s - -3.930559f))), 1.0e-4f), fmaxf(-79.794743f, (s - -3.930559f)))), -1.0e4f), 1.0e4f));\n}",
1336
- py: "import torch\n\ndef spear_fn(s):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((-79.794743 / (abs((s - -3.997718)) < 1e-4 ? 1e-4 : (s - -3.997718))) - (-2.586911 / (abs(torch.maximum(-79.794743, (s - -3.930559))) < 1e-4 ? 1e-4 : torch.maximum(-79.794743, (s - -3.930559)))))",
1337
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACp4BAZsBAERlbr4R3fJTwCAARFILJZNT+w/AoZlELUMc6+I2Gj+lIABEUgslk1P7D8ChpqNEAAAAAACIw8ClRAAAAAAAiMNApEQfTfVk/rEEwERlbr4R3fJTwCAARNv8v+rIcQ/AoaWZRC1DHOviNho/pURlbr4R3fJTwCAARNv8v+rIcQ/AoaWmo0QAAAAAAIjDwKVEAAAAAACIw0CkoQs=",
1347
+ js: "((s) => Math.min(1e4, Math.max(-1e4, (s) / (((2.92842 + Math.abs(s))) < 1e-4 && ((2.92842 + Math.abs(s))) > -1e-4 ? (((2.92842 + Math.abs(s))) >= 0 ? 1e-4 : -1e-4) : ((2.92842 + Math.abs(s)))))))",
1348
+ eval: ((s) => Math.min(1e4, Math.max(-1e4, (s) / (((2.92842 + Math.abs(s))) < 1e-4 && ((2.92842 + Math.abs(s))) > -1e-4 ? (((2.92842 + Math.abs(s))) >= 0 ? 1e-4 : -1e-4) : ((2.92842 + Math.abs(s))))))),
1349
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((s / copysignf(fmaxf(fabsf((2.92842f + fabsf(s))), 1.0e-4f), (2.92842f + fabsf(s)))), -1.0e4f), 1.0e4f);\n}",
1350
+ py: "import torch\n\ndef spear_fn(s):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (s / (abs((2.92842 + torch.abs(s))) < 1e-4 ? 1e-4 : (2.92842 + torch.abs(s))))",
1351
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACkEBPwAgAERangd3Z20HQCAAmaCZRC1DHOviNho/pURangd3Z20HQCAAmaCmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
1338
1352
  },
1339
1353
  meta: {
1340
1354
  metric: 6.947760597116317e-10,
@@ -1380,11 +1394,11 @@ const kernels = {
1380
1394
  wasmBase64: "AGFzbQEAAAABDAJgAnx8AXxgAXwBfAMCAQAHCQEFc3BlYXIAAApqAWgARCiSGoUP4IXAIAAgAaBEhA66hENvqT9EtU5cjtdAdUAgAKGhmUQtQxzr4jYaP6VEhA66hENvqT9EtU5cjtdAdUAgAKGhpqNEAAAAAACIw8ClRAAAAAAAiMNApKJEhErJw//fhUCgCw==",
1381
1395
  },
1382
1396
  fast: {
1383
- js: "((vs, vo) => (317.901286 + (vs + vo)))",
1384
- eval: ((vs, vo) => (317.901286 + (vs + vo))),
1385
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (317.901286f + (vs + vo));\n}",
1386
- py: "import torch\n\ndef spear_fn(vs, vo):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (317.901286 + (vs + vo))",
1387
- wasmBase64: "AGFzbQEAAAABDAJgAnx8AXxgAXwBfAMCAQAHCQEFc3BlYXIAAAoTAREARHxl3qpr3nNAIAAgAaCgCw==",
1397
+ js: "((vo, vs) => (vo + vs))",
1398
+ eval: ((vo, vs) => (vo + vs)),
1399
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (vo + vs);\n}",
1400
+ py: "import torch\n\ndef spear_fn(vo, vs):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (vo + vs)",
1401
+ wasmBase64: "AGFzbQEAAAABDAJgAnx8AXxgAXwBfAMCAQAHCQEFc3BlYXIAAAoJAQcAIAAgAaAL",
1388
1402
  },
1389
1403
  meta: {
1390
1404
  metric: 9.281797631143672e-10,
@@ -1479,6 +1493,13 @@ const kernels = {
1479
1493
  py: "import torch\n\ndef spear_fn(a, d, b, c):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (2 * torch.abs(((a * d) - (b * c))))",
1480
1494
  wasmBase64: "AGFzbQEAAAABDgJgBHx8fHwBfGABfAF8AwIBAAcJAQVzcGVhcgAAChoBGABEAAAAAAAAAEAgACABoiACIAOioZmiCw==",
1481
1495
  },
1496
+ fast: {
1497
+ js: "((a, d, b, c) => Math.abs(((a * d) - (b * c))))",
1498
+ eval: ((a, d, b, c) => Math.abs(((a * d) - (b * c)))),
1499
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fabsf(((a * d) - (b * c)));\n}",
1500
+ py: "import torch\n\ndef spear_fn(a, d, b, c):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.abs(((a * d) - (b * c)))",
1501
+ wasmBase64: "AGFzbQEAAAABDgJgBHx8fHwBfGABfAF8AwIBAAcJAQVzcGVhcgAAChABDgAgACABoiACIAOioZkL",
1502
+ },
1482
1503
  meta: {
1483
1504
  metric: 0,
1484
1505
  level: 5,
@@ -1523,11 +1544,11 @@ const kernels = {
1523
1544
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACh0BGwBEAAAAAAAA+D8gACAAoqJEAAAAAAAA4L+gCw==",
1524
1545
  },
1525
1546
  fast: {
1526
- js: "((x) => (-0.774693 * (x) * (x)))",
1527
- eval: ((x) => (-0.774693 * (x) * (x))),
1528
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (-0.774693f * powf(x, 2.0f));\n}",
1529
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (-0.774693 * (x * x))",
1530
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAAChMBEQBEhxVu+UjK6L8gACAAoqIL",
1547
+ js: "((x) => (x) * (x))",
1548
+ eval: ((x) => (x) * (x)),
1549
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return powf(x, 2.0f);\n}",
1550
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x * x)",
1551
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACgkBBwAgACAAogs=",
1531
1552
  },
1532
1553
  meta: {
1533
1554
  metric: 3.250969746125654e-33,
@@ -1573,11 +1594,11 @@ const kernels = {
1573
1594
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhc2luAAEDAgEABwkBBXNwZWFyAAEKHAEaACAARAAAAAAAAPC/pUQAAAAAAADwP6QQAAs=",
1574
1595
  },
1575
1596
  fast: {
1576
- js: "((x) => (0.529961 * ((1.930182 * x) + ((0.645691 * (x) * (x)) * (x) * (x) * (x)))))",
1577
- eval: ((x) => (0.529961 * ((1.930182 * x) + ((0.645691 * (x) * (x)) * (x) * (x) * (x))))),
1578
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (0.529961f * ((1.930182f * x) + ((0.645691f * powf(x, 2.0f)) * powf(x, 3.0f))));\n}",
1579
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (0.529961 * ((1.930182 * x) + ((0.645691 * (x * x)) * (x ** 3))))",
1580
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACjMBMQBEf/lkxXD14D9E9z5VhQbi/j8gAKJEBkoKLICp5D8gACAAoqIgACAAIACioqKgogs=",
1597
+ js: "((x) => ((-1.143333 * (Math.acos(Math.max(-1, Math.min(1, x))) + 1)) + 1.482365))",
1598
+ eval: ((x) => ((-1.143333 * (Math.acos(Math.max(-1, Math.min(1, x))) + 1)) + 1.482365)),
1599
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((-1.143333f * (acosf(fmaxf(-1.0f, fminf(1.0f, x))) + 1f)) + 1.482365f);\n}",
1600
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((-1.143333 * (torch.acos(torch.clamp(x, -1.0, 1.0)) + 1)) + 1.482365)",
1601
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhY29zAAEDAgEABwkBBXNwZWFyAAEKOgE4AERHADeLF0vyvyAARAAAAAAAAPC/pUQAAAAAAADwP6QQAEQAAAAAAADwP6CiRLnCu1zEt/c/oAs=",
1581
1602
  },
1582
1603
  meta: {
1583
1604
  metric: 0,
@@ -1673,11 +1694,11 @@ const kernels = {
1673
1694
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACl0BWwBE3+V6QIMSzr8gAERrZFdaRqoDwKBECmr4FtaN6T8gAKCZRC1DHOviNho/pUQKavgW1o3pPyAAoKajRAAAAAAAiMPApUQAAAAAAIjDQKSiRGqlYY85LNI/oAs=",
1674
1695
  },
1675
1696
  fast: {
1676
- js: "((x) => Math.min(1e4, Math.max(-1e4, (2.895344) / ((((x + (1.447672 + x)) * 0.661578)) < 1e-4 && (((x + (1.447672 + x)) * 0.661578)) > -1e-4 ? ((((x + (1.447672 + x)) * 0.661578)) >= 0 ? 1e-4 : -1e-4) : (((x + (1.447672 + x)) * 0.661578))))))",
1677
- eval: ((x) => Math.min(1e4, Math.max(-1e4, (2.895344) / ((((x + (1.447672 + x)) * 0.661578)) < 1e-4 && (((x + (1.447672 + x)) * 0.661578)) > -1e-4 ? ((((x + (1.447672 + x)) * 0.661578)) >= 0 ? 1e-4 : -1e-4) : (((x + (1.447672 + x)) * 0.661578)))))),
1678
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((2.895344f / copysignf(fmaxf(fabsf(((x + (1.447672f + x)) * 0.661578f)), 1.0e-4f), ((x + (1.447672f + x)) * 0.661578f))), -1.0e4f), 1.0e4f);\n}",
1679
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (2.895344 / (abs(((x + (1.447672 + x)) * 0.661578)) < 1e-4 ? 1e-4 : ((x + (1.447672 + x)) * 0.661578)))",
1680
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACmABXgBEzVt1HaopB0AgAETNW3Udqin3PyAAoKBETBk4oKUr5T+imUQtQxzr4jYaP6UgAETNW3Udqin3PyAAoKBETBk4oKUr5T+ipqNEAAAAAACIw8ClRAAAAAAAiMNApAs=",
1697
+ js: "((x) => Math.atan(x))",
1698
+ eval: ((x) => Math.atan(x)),
1699
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return atanf(x);\n}",
1700
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.atan(x)",
1701
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhdGFuAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
1681
1702
  },
1682
1703
  meta: {
1683
1704
  metric: 0.00003054908318748102,
@@ -1891,11 +1912,11 @@ const kernels = {
1891
1912
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACqgBAaUBAERxcqqzCTb/v0TJ42n5gYsIQCAAmUQtQxzr4jYaP6UgAKajRAAAAAAAiMPApUQAAAAAAIjDQKRET5DY7h6gt79E4IWt2co7EEAgAESIY13cRjMXwKKkoJlELUMc6+I2Gj+lRE+Q2O4eoLe/ROCFrdnKOxBAIABEiGNd3EYzF8CipKCmo0QAAAAAAIjDwKVEAAAAAACIw0CkokRIh74yt52Jv6AL",
1892
1913
  },
1893
1914
  fast: {
1894
- js: "((x) => (Math.min(1e4, Math.max(-1e4, (1.449627) / (((x) * (x)) < 1e-4 && ((x) * (x)) > -1e-4 ? (((x) * (x)) >= 0 ? 1e-4 : -1e-4) : ((x) * (x))))) * 0.237626))",
1895
- eval: ((x) => (Math.min(1e4, Math.max(-1e4, (1.449627) / (((x) * (x)) < 1e-4 && ((x) * (x)) > -1e-4 ? (((x) * (x)) >= 0 ? 1e-4 : -1e-4) : ((x) * (x))))) * 0.237626)),
1896
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (fminf(fmaxf((1.449627f / copysignf(fmaxf(fabsf(powf(x, 2.0f)), 1.0e-4f), powf(x, 2.0f))), -1.0e4f), 1.0e4f) * 0.237626f);\n}",
1897
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((1.449627 / (abs((x * x)) < 1e-4 ? 1e-4 : (x * x))) * 0.237626)",
1898
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACkIBQABEomDGFKwx9z8gACAAoplELUMc6+I2Gj+lIAAgAKKmo0QAAAAAAIjDwKVEAAAAAACIw0CkRCzzVl2Has4/ogs=",
1915
+ js: "((x) => Math.tanh(x))",
1916
+ eval: ((x) => Math.tanh(x)),
1917
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return tanhf(x);\n}",
1918
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.tanh(x)",
1919
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgR0YW5oAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
1899
1920
  },
1900
1921
  meta: {
1901
1922
  metric: 0.000013132168838441087,
@@ -1941,11 +1962,11 @@ const kernels = {
1941
1962
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACl0BWwBEBgaNf+gG2D9EaLPqc7V1C0AgAKIgAETQKjOl9bf5P6CZRC1DHOviNho/pSAARNAqM6X1t/k/oKajRAAAAAAAiMPApUQAAAAAAIjDQKSiRHtUXePcclS/oAs=",
1942
1963
  },
1943
1964
  fast: {
1944
- js: "((x) => Math.min(1e4, Math.max(-1e4, (x) / (((x + 1.032428)) < 1e-4 && ((x + 1.032428)) > -1e-4 ? (((x + 1.032428)) >= 0 ? 1e-4 : -1e-4) : ((x + 1.032428))))))",
1945
- eval: ((x) => Math.min(1e4, Math.max(-1e4, (x) / (((x + 1.032428)) < 1e-4 && ((x + 1.032428)) > -1e-4 ? (((x + 1.032428)) >= 0 ? 1e-4 : -1e-4) : ((x + 1.032428)))))),
1946
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((x / copysignf(fmaxf(fabsf((x + 1.032428f)), 1.0e-4f), (x + 1.032428f))), -1.0e4f), 1.0e4f);\n}",
1947
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x / (abs((x + 1.032428)) < 1e-4 ? 1e-4 : (x + 1.032428)))",
1948
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACj8BPQAgACAARFKY9zjThPA/oJlELUMc6+I2Gj+lIABEUpj3ONOE8D+gpqNEAAAAAACIw8ClRAAAAAAAiMNApAs=",
1965
+ js: "((x) => (Math.atan(x)) * (Math.atan(x)))",
1966
+ eval: ((x) => (Math.atan(x)) * (Math.atan(x))),
1967
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return powf(atanf(x), 2.0f);\n}",
1968
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (torch.atan(x) * torch.atan(x))",
1969
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhdGFuAAEDAgEABwkBBXNwZWFyAAEKDQELACAAEAAgABAAogs=",
1949
1970
  },
1950
1971
  meta: {
1951
1972
  metric: 9.35135840763872e-9,
@@ -1956,8 +1977,33 @@ const kernels = {
1956
1977
  vsIterative: null,
1957
1978
  },
1958
1979
  },
1980
+ "mish": {
1981
+ id: "mish",
1982
+ precise: {
1983
+ js: "((x) => (x * Math.tanh(Math.log(Math.max(1e-30, (1 + Math.exp(Math.max(-50, Math.min(50, x)))))))))",
1984
+ eval: ((x) => (x * Math.tanh(Math.log(Math.max(1e-30, (1 + Math.exp(Math.max(-50, Math.min(50, x))))))))),
1985
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (x * tanhf(logf(fmaxf(1.0e-30f, (1f + expf(fmaxf(-50.0f, fminf(50.0f, x))))))));\n}",
1986
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x * torch.tanh(torch.log(torch.clamp((1 + torch.exp(torch.clamp(x, -50.0, 50.0))), min=1e-30))))",
1987
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AiADA2VudgNleHAAAQNlbnYDbG9nAAEDZW52BHRhbmgAAQMCAQAHCQEFc3BlYXIAAwo3ATUAIABEAAAAAAAA8D8gAEQAAAAAAABJwKVEAAAAAAAASUCkEACgRKDC6/5LSLQ5pRABEAKiCw==",
1988
+ },
1989
+ fast: {
1990
+ js: "((x) => Math.max(0, x))",
1991
+ eval: ((x) => Math.max(0, x)),
1992
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fmaxf(0.0f, x);\n}",
1993
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.relu(x)",
1994
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAAChABDgAgAEQAAAAAAAAAAKUL",
1995
+ },
1996
+ meta: {
1997
+ metric: 0,
1998
+ level: 5,
1999
+ formulaCost: 5,
2000
+ exactCost: 62,
2001
+ speedupVsExact: 12.4,
2002
+ vsIterative: null,
2003
+ },
2004
+ },
1959
2005
  };
1960
2006
 
1961
- const kernelIds = ["silu","gelu","sigmoid","kv_cache","free_fall","kepler","gaussian_cdf","damped_pendulum","rl_distillation","lambert_w","rc_circuit","gaussian_kernel","diffusion_beta","bilinear_interp","european_call","temporal_grad","lorentz","hill","kerr","lennard_jones","damped_oscillation","logistic_growth","softplus","kdv_soliton","kerr_spin","pendulum_hybrid","eigen3_sym","ik_reach","idm_following","gemv4","rope_rot","gauss_shader","ema_smooth","smoothstep","srgb_gamma","tanh_sat","atan_unit","srgb_decode","erf_prob","huber_loss","cosh_curve","bessel_j0","bessel_j1","blackbody_r","aces_fit","logsumexp2","probit_quantile","pmt_finance","blackbody_g","blackbody_b","bessel_j2","logit_ml","kelly_criterion","rsi_momentum","implied_vol","michaelis_menten","temperature_softmax","doppler_effect","stefan_boltzmann","mm1_queue_wait","grover_amplitude","concurrence_pure","chsh_correlation","legendre_p2","laguerre_l2","asin_hard","qfi_dephasing","amp_damp_fid","loschmidt_rate","bessel_i0e","elliptic_k","kepler_solver","fast_exp_alu","fresnel_schlick","rayleigh_phase","smootherstep","fog_exp2","back_ease_out","light_falloff_punctual","bias_slope","uncharted2_tonemap"];
2007
+ const kernelIds = ["silu","gelu","sigmoid","kv_cache","free_fall","kepler","gaussian_cdf","damped_pendulum","rl_distillation","lambert_w","rc_circuit","gaussian_kernel","diffusion_beta","bilinear_interp","european_call","temporal_grad","lorentz","hill","kerr","lennard_jones","damped_oscillation","logistic_growth","softplus","kdv_soliton","kerr_spin","pendulum_hybrid","eigen3_sym","ik_reach","idm_following","gemv4","rope_rot","gauss_shader","ema_smooth","smoothstep","srgb_gamma","tanh_sat","atan_unit","srgb_decode","erf_prob","huber_loss","cosh_curve","bessel_j0","bessel_j1","blackbody_r","aces_fit","logsumexp2","probit_quantile","pmt_finance","blackbody_g","blackbody_b","bessel_j2","logit_ml","kelly_criterion","rsi_momentum","implied_vol","michaelis_menten","temperature_softmax","doppler_effect","stefan_boltzmann","mm1_queue_wait","grover_amplitude","concurrence_pure","chsh_correlation","legendre_p2","laguerre_l2","asin_hard","qfi_dephasing","amp_damp_fid","loschmidt_rate","bessel_i0e","elliptic_k","kepler_solver","fast_exp_alu","fresnel_schlick","rayleigh_phase","smootherstep","fog_exp2","back_ease_out","light_falloff_punctual","bias_slope","uncharted2_tonemap","mish"];
1962
2008
 
1963
2009
  module.exports = { kernels, kernelIds, default: kernels };
package/index.js CHANGED
@@ -1,46 +1,53 @@
1
- // Auto-generated by scripts/gen-kernels-package.ts — DO NOT EDIT.
1
+ // Auto-generated by scripts/gen-kernels-package.ts DO NOT EDIT.
2
2
  // Self-contained runtime: the arrow functions below ARE the kernels.
3
3
  export const kernels = {
4
4
  "silu": {
5
5
  id: "silu",
6
6
  precise: {
7
- js: "((x) => ((0.997587 * (x * (0.501 + (0.587 * Math.min(1e4, Math.max(-1e4, (x) / (((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) < 1e-4 && ((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) > -1e-4 ? (((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) >= 0 ? 1e-4 : -1e-4) : ((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x))))))))))))) + -0.005749))",
8
- eval: ((x) => ((0.997587 * (x * (0.501 + (0.587 * Math.min(1e4, Math.max(-1e4, (x) / (((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) < 1e-4 && ((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) > -1e-4 ? (((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x)))))) >= 0 ? 1e-4 : -1e-4) : ((0.815 + Math.sqrt(Math.abs((0.909361 + (x) * (x))))))))))))) + -0.005749)),
9
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((0.997587f * (x * (0.501f + (0.587f * fminf(fmaxf((x / copysignf(fmaxf(fabsf((0.815f + sqrtf(fabsf((0.909361f + powf(x, 2.0f)))))), 1.0e-4f), (0.815f + sqrtf(fabsf((0.909361f + powf(x, 2.0f))))))), -1.0e4f), 1.0e4f))))) + -0.005749f);\n}",
10
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((0.997587 * (x * (0.501 + (0.587 * (x / (abs((0.815 + torch.sqrt(torch.abs((0.909361 + (x * x)))))) < 1e-4 ? 1e-4 : (0.815 + torch.sqrt(torch.abs((0.909361 + (x * x))))))))))) + -0.005749)",
11
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACokBAYYBAESmRX2SO+zvPyAARNV46SYxCOA/RGIQWDm0yOI/IABEFK5H4XoU6j9EW0BoPXwZ7T8gACAAoqCZn6CZRC1DHOviNho/pUQUrkfhehTqP0RbQGg9fBntPyAAIACioJmfoKajRAAAAAAAiMPApUQAAAAAAIjDQKSioKKiRPtYwW9DjHe/oAs=",
7
+ js: "((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) < 1e-4 && ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) > -1e-4 ? (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.exp(Math.max(-50, Math.min(50, (-x))))))))))",
8
+ eval: ((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) < 1e-4 && ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) > -1e-4 ? (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))))))),
9
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((x / copysignf(fmaxf(fabsf((1f + expf(fmaxf(-50.0f, fminf(50.0f, (-x)))))), 1.0e-4f), (1f + expf(fmaxf(-50.0f, fminf(50.0f, (-x))))))), -1.0e4f), 1.0e4f);\n}",
10
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x / (abs((1 + torch.exp(torch.clamp((-x), -50.0, 50.0)))) < 1e-4 ? 1e-4 : (1 + torch.exp(torch.clamp((-x), -50.0, 50.0)))))",
11
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNleHAAAQMCAQAHCQEFc3BlYXIAAQptAWsAIABEAAAAAAAA8D8gAJpEAAAAAAAAScClRAAAAAAAAElApBAAoJlELUMc6+I2Gj+lRAAAAAAAAPA/IACaRAAAAAAAAEnApUQAAAAAAABJQKQQAKCmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
12
+ },
13
+ fast: {
14
+ js: "((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) < 1e-4 && ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) > -1e-4 ? (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.exp(Math.max(-50, Math.min(50, (-x))))))))))",
15
+ eval: ((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) < 1e-4 && ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) > -1e-4 ? (((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.exp(Math.max(-50, Math.min(50, (-x)))))))))),
16
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((x / copysignf(fmaxf(fabsf((1f + expf(fmaxf(-50.0f, fminf(50.0f, (-x)))))), 1.0e-4f), (1f + expf(fmaxf(-50.0f, fminf(50.0f, (-x))))))), -1.0e4f), 1.0e4f);\n}",
17
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x / (abs((1 + torch.exp(torch.clamp((-x), -50.0, 50.0)))) < 1e-4 ? 1e-4 : (1 + torch.exp(torch.clamp((-x), -50.0, 50.0)))))",
18
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNleHAAAQMCAQAHCQEFc3BlYXIAAQptAWsAIABEAAAAAAAA8D8gAJpEAAAAAAAAScClRAAAAAAAAElApBAAoJlELUMc6+I2Gj+lRAAAAAAAAPA/IACaRAAAAAAAAEnApUQAAAAAAABJQKQQAKCmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
12
19
  },
13
20
  meta: {
14
- metric: 0.0007795906249592223,
15
- level: 2,
16
- formulaCost: 14,
21
+ metric: 0,
22
+ level: 5,
23
+ formulaCost: 7,
17
24
  exactCost: 34,
18
- speedupVsExact: 2.4285714285714284,
25
+ speedupVsExact: 4.857142857142857,
19
26
  vsIterative: null,
20
27
  },
21
28
  },
22
29
  "gelu": {
23
30
  id: "gelu",
24
31
  precise: {
25
- js: "((x) => ((0.997729 * (x * Math.min(1.002, Math.max(0, ((0.306923 * x) + 0.501))))) + -0.004004))",
26
- eval: ((x) => ((0.997729 * (x * Math.min(1.002, Math.max(0, ((0.306923 * x) + 0.501))))) + -0.004004)),
27
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((0.997729f * (x * fminf(1.002f, fmaxf(0.0f, ((0.306923f * x) + 0.501f))))) + -0.004004f);\n}",
28
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((0.997729 * (x * torch.minimum(1.002, torch.relu(((0.306923 * x) + 0.501))))) + -0.004004)",
29
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACkUBQwBEQ6ooXmXt7z8gAETVeOkmMQjwP0Qr+dhdoKTTPyAAokTVeOkmMQjgP6BEAAAAAAAAAAClpKKiRHfX2ZB/ZnC/oAs=",
32
+ js: "((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return ((0.5 * x) * (1 + __erf((x * 0.7071067811865475)))); })",
33
+ eval: ((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return ((0.5 * x) * (1 + __erf((x * 0.7071067811865475)))); }),
34
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((0.5f * x) * (1f + erff((x * 0.707107f))));\n}",
35
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((0.5 * x) * (1 + torch.erf((x * 0.707107))))",
36
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNlcmYAAQMCAQAHCQEFc3BlYXIAAQopAScARAAAAAAAAOA/IACiRAAAAAAAAPA/IABEzDt/Zp6g5j+iEACgogs=",
30
37
  },
31
38
  fast: {
32
- js: "((x) => (x * Math.min(1, Math.max(0, ((0.295845 * x) + 0.5)))))",
33
- eval: ((x) => (x * Math.min(1, Math.max(0, ((0.295845 * x) + 0.5))))),
34
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (x * fminf(1f, fmaxf(0.0f, ((0.295845f * x) + 0.5f))));\n}",
35
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x * torch.minimum(1, torch.relu(((0.295845 * x) + 0.5))))",
36
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACjEBLwAgAEQAAAAAAADwP0QC2evdH+/SPyAAokQAAAAAAADgP6BEAAAAAAAAAAClpKIL",
39
+ js: "((x) => Math.max(0, x))",
40
+ eval: ((x) => Math.max(0, x)),
41
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fmaxf(0.0f, x);\n}",
42
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.relu(x)",
43
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAAChABDgAgAEQAAAAAAAAAAKUL",
37
44
  },
38
45
  meta: {
39
- metric: 0.0005322566020140329,
40
- level: 2,
41
- formulaCost: 7,
46
+ metric: 1.5455587803707568e-34,
47
+ level: 5,
48
+ formulaCost: 5,
42
49
  exactCost: 46,
43
- speedupVsExact: 6.571428571428571,
50
+ speedupVsExact: 9.2,
44
51
  vsIterative: null,
45
52
  },
46
53
  },
@@ -54,11 +61,11 @@ export const kernels = {
54
61
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNleHAAAQMCAQAHCQEFc3BlYXIAAQp9AXsARAAAAAAAAPA/RAAAAAAAAPA/IABEAAAAAAAAScClRAAAAAAAAElApBAAoJlELUMc6+I2Gj+lRAAAAAAAAPA/IABEAAAAAAAAScClRAAAAAAAAElApBAAoKajRAAAAAAAiMPApUQAAAAAAIjDQKSaRAAAAAAAAPA/oAs=",
55
62
  },
56
63
  fast: {
57
- js: "((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.abs(x))) < 1e-4 && ((1 + Math.abs(x))) > -1e-4 ? (((1 + Math.abs(x))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.abs(x)))))))",
58
- eval: ((x) => Math.min(1e4, Math.max(-1e4, (x) / (((1 + Math.abs(x))) < 1e-4 && ((1 + Math.abs(x))) > -1e-4 ? (((1 + Math.abs(x))) >= 0 ? 1e-4 : -1e-4) : ((1 + Math.abs(x))))))),
59
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((x / copysignf(fmaxf(fabsf((1f + fabsf(x))), 1.0e-4f), (1f + fabsf(x)))), -1.0e4f), 1.0e4f);\n}",
60
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x / (abs((1 + torch.abs(x))) < 1e-4 ? 1e-4 : (1 + torch.abs(x))))",
61
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACkEBPwAgAEQAAAAAAADwPyAAmaCZRC1DHOviNho/pUQAAAAAAADwPyAAmaCmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
64
+ js: "((x) => Math.atan(x))",
65
+ eval: ((x) => Math.atan(x)),
66
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return atanf(x);\n}",
67
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.atan(x)",
68
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhdGFuAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
62
69
  },
63
70
  meta: {
64
71
  metric: 4.790511494175498e-33,
@@ -154,11 +161,11 @@ export const kernels = {
154
161
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhdGFuAAEDAgEABwkBBXNwZWFyAAEKOgE4AETOGyeFeY/cP0RsI57sZkbuPyAARBBYObTIdgHApaJEpTLFHARdAECkEACiREPFOH8TCuA/oAs=",
155
162
  },
156
163
  fast: {
157
- js: "((x) => ((0.543518 * Math.min(1e4, Math.max(-1e4, (x) / ((Math.max(1.559472, (0.337459 + Math.abs(x)))) < 1e-4 && (Math.max(1.559472, (0.337459 + Math.abs(x)))) > -1e-4 ? ((Math.max(1.559472, (0.337459 + Math.abs(x)))) >= 0 ? 1e-4 : -1e-4) : (Math.max(1.559472, (0.337459 + Math.abs(x)))))))) + 0.5))",
158
- eval: ((x) => ((0.543518 * Math.min(1e4, Math.max(-1e4, (x) / ((Math.max(1.559472, (0.337459 + Math.abs(x)))) < 1e-4 && (Math.max(1.559472, (0.337459 + Math.abs(x)))) > -1e-4 ? ((Math.max(1.559472, (0.337459 + Math.abs(x)))) >= 0 ? 1e-4 : -1e-4) : (Math.max(1.559472, (0.337459 + Math.abs(x)))))))) + 0.5)),
159
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((0.543518f * fminf(fmaxf((x / copysignf(fmaxf(fabsf(fmaxf(1.559472f, (0.337459f + fabsf(x)))), 1.0e-4f), fmaxf(1.559472f, (0.337459f + fabsf(x))))), -1.0e4f), 1.0e4f)) + 0.5f);\n}",
160
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((0.543518 * (x / (abs(torch.maximum(1.559472, (0.337459 + torch.abs(x)))) < 1e-4 ? 1e-4 : torch.maximum(1.559472, (0.337459 + torch.abs(x)))))) + 0.5)",
161
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACmkBZwBEyjFZ3H9k4T8gAESCcXDpmPP4P0RRai+i7ZjVPyAAmaClmUQtQxzr4jYaP6VEgnFw6Zjz+D9EUWovou2Y1T8gAJmgpaajRAAAAAAAiMPApUQAAAAAAIjDQKSiRAAAAAAAAOA/oAs=",
164
+ js: "((x) => Math.tanh(x))",
165
+ eval: ((x) => Math.tanh(x)),
166
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return tanhf(x);\n}",
167
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.tanh(x)",
168
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgR0YW5oAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
162
169
  },
163
170
  meta: {
164
171
  metric: 0.000016407954856661242,
@@ -254,11 +261,11 @@ export const kernels = {
254
261
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AiADA2VudgNleHAAAQNlbnYEYXRhbgABA2VudgNsb2cAAQMCAQAHCQEFc3BlYXIAAwpIAUYARFrhtkDMt/a/RHWuKCUE6wFAIABEAAAAAAAAScClRAAAAAAAAElApBAAEAFEoMLr/ktItDmlEAKhokTf3Weg90IMQKAL",
255
262
  },
256
263
  fast: {
257
- js: "((t) => (((6.643258 - t)) * ((6.643258 - t)) * ((6.643258 - t))) * (((6.643258 - t)) * ((6.643258 - t)) * ((6.643258 - t))))",
258
- eval: ((t) => (((6.643258 - t)) * ((6.643258 - t)) * ((6.643258 - t))) * (((6.643258 - t)) * ((6.643258 - t)) * ((6.643258 - t)))),
259
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return powf(powf((6.643258f - t), 3.0f), 2.0f);\n}",
260
- py: "import torch\n\ndef spear_fn(t):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (((6.643258 - t) ** 3) * ((6.643258 - t) ** 3))",
261
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAAClEBTwBEvY+jObKSGkAgAKFEvY+jObKSGkAgAKFEvY+jObKSGkAgAKGiokS9j6M5spIaQCAAoUS9j6M5spIaQCAAoUS9j6M5spIaQCAAoaKiogs=",
264
+ js: "((t) => Math.exp(Math.max(-50, Math.min(50, (-t)))))",
265
+ eval: ((t) => Math.exp(Math.max(-50, Math.min(50, (-t))))),
266
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return expf(fmaxf(-50.0f, fminf(50.0f, (-t))));\n}",
267
+ py: "import torch\n\ndef spear_fn(t):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.exp(torch.clamp((-t), -50.0, 50.0))",
268
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNleHAAAQMCAQAHCQEFc3BlYXIAAQodARsAIACaRAAAAAAAAEnApUQAAAAAAABJQKQQAAs=",
262
269
  },
263
270
  meta: {
264
271
  metric: 0.00007258403509477666,
@@ -378,6 +385,13 @@ export const kernels = {
378
385
  py: "import torch\n\ndef spear_fn(b, a):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (b - a)",
379
386
  wasmBase64: "AGFzbQEAAAABDAJgAnx8AXxgAXwBfAMCAQAHCQEFc3BlYXIAAAoJAQcAIAAgAaEL",
380
387
  },
388
+ fast: {
389
+ js: "((a, b) => (a - b))",
390
+ eval: ((a, b) => (a - b)),
391
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (a - b);\n}",
392
+ py: "import torch\n\ndef spear_fn(a, b):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (a - b)",
393
+ wasmBase64: "AGFzbQEAAAABDAJgAnx8AXxgAXwBfAMCAQAHCQEFc3BlYXIAAAoJAQcAIAAgAaEL",
394
+ },
381
395
  meta: {
382
396
  metric: 0,
383
397
  level: 5,
@@ -676,11 +690,11 @@ export const kernels = {
676
690
  wasmBase64: "AGFzbQEAAAABDQJgA3x8fAF8YAF8AXwDAgEABwkBBXNwZWFyAAAK+AEB9QEARJNWfEPhM/0/RGZmZmZmZv4/RAMkmkARyxTARCO6Z12j5eo/IAAgAKIgACAAoqJEje21oPfGsD6ioUTUtfY+VSUDQESscTYdAdzbvyAARILlCBnIs/g/oiAAIAGiRLix2ZHqO8s/oqCloCACmUQtQxzr4jYaP6UgAqajRAAAAAAAiMPApUQAAAAAAIjDQKRE1LX2PlUlA0BErHE2HQHc278gAESC5QgZyLP4P6IgACABokS4sdmR6jvLP6KgpaAgAplELUMc6+I2Gj+lIAKmo0QAAAAAAIjDwKVEAAAAAACIw0CkoqGlpKJEShr5fwEe3z+gCw==",
677
691
  },
678
692
  fast: {
679
- js: "((v, dv, s) => ((1.1414205468162575 * ((1.22047 * Math.min(1.9, Math.max(-7.31, ((1 - (((v) * (v)) * ((v) * (v)) * 0.000001)) - (Math.min(1e4, Math.max(-1e4, ((3.45 + Math.max(-0.05, ((v * 1.45) + ((v * dv) * 0.212766))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))) * (Math.min(1e4, Math.max(-1e4, ((3.45 + Math.max(-0.05, ((v * 1.45) + ((v * dv) * 0.212766))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))))))) + 0.215661)) + 0.024217427345017313))",
680
- eval: ((v, dv, s) => ((1.1414205468162575 * ((1.22047 * Math.min(1.9, Math.max(-7.31, ((1 - (((v) * (v)) * ((v) * (v)) * 0.000001)) - (Math.min(1e4, Math.max(-1e4, ((3.45 + Math.max(-0.05, ((v * 1.45) + ((v * dv) * 0.212766))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))) * (Math.min(1e4, Math.max(-1e4, ((3.45 + Math.max(-0.05, ((v * 1.45) + ((v * dv) * 0.212766))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))))))) + 0.215661)) + 0.024217427345017313)),
681
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((1.141421f * ((1.22047f * fminf(1.9f, fmaxf(-7.31f, ((1f - (powf(powf(v, 2.0f), 2.0f) * 0.000001f)) - powf(fminf(fmaxf(((3.45f + fmaxf(-0.05f, ((v * 1.45f) + ((v * dv) * 0.212766f)))) / copysignf(fmaxf(fabsf(s), 1.0e-4f), s)), -1.0e4f), 1.0e4f), 2.0f))))) + 0.215661f)) + 0.024217f);\n}",
682
- py: "import torch\n\ndef spear_fn(v, dv, s):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((1.141421 * ((1.22047 * torch.minimum(1.9, torch.maximum(-7.31, ((1 - (((v * v) * (v * v)) * 0.000001)) - (((3.45 + torch.maximum(-0.05, ((v * 1.45) + ((v * dv) * 0.212766)))) / (abs(s) < 1e-4 ? 1e-4 : s)) * ((3.45 + torch.maximum(-0.05, ((v * 1.45) + ((v * dv) * 0.212766)))) / (abs(s) < 1e-4 ? 1e-4 : s))))))) + 0.215661)) + 0.024217)",
683
- wasmBase64: "AGFzbQEAAAABDQJgA3x8fAF8YAF8AXwDAgEABwkBBXNwZWFyAAAKjAIBiQIARKXu+DBCQ/I/RGX8+4wLh/M/RGZmZmZmZv4/RD0K16NwPR3ARAAAAAAAAPA/IAAgAKIgACAAoqJEje21oPfGsD6ioUSamZmZmZkLQESamZmZmZmpvyAARDMzMzMzM/c/oiAAIAGiRLix2ZHqO8s/oqCloCACmUQtQxzr4jYaP6UgAqajRAAAAAAAiMPApUQAAAAAAIjDQKREmpmZmZmZC0BEmpmZmZmZqb8gAEQzMzMzMzP3P6IgACABokS4sdmR6jvLP6KgpaAgAplELUMc6+I2Gj+lIAKmo0QAAAAAAIjDwKVEAAAAAACIw0CkoqGlpKJEZOYCl8eayz+gokQCq8IJdMyYP6AL",
693
+ js: "((v, dv, s) => Math.min(1.743715, Math.max(-8.6, ((1 - (((v) * (v)) * ((v) * (v)) * 0.0000010828124103295972)) - (Math.min(1e4, Math.max(-1e4, ((2.3 + Math.max(0, ((v * 1.45) + ((v * dv) * 0.2127659574468085))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))) * (Math.min(1e4, Math.max(-1e4, ((2.3 + Math.max(0, ((v * 1.45) + ((v * dv) * 0.2127659574468085))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s)))))))))",
694
+ eval: ((v, dv, s) => Math.min(1.743715, Math.max(-8.6, ((1 - (((v) * (v)) * ((v) * (v)) * 0.0000010828124103295972)) - (Math.min(1e4, Math.max(-1e4, ((2.3 + Math.max(0, ((v * 1.45) + ((v * dv) * 0.2127659574468085))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))) * (Math.min(1e4, Math.max(-1e4, ((2.3 + Math.max(0, ((v * 1.45) + ((v * dv) * 0.2127659574468085))))) / ((s) < 1e-4 && (s) > -1e-4 ? ((s) >= 0 ? 1e-4 : -1e-4) : (s))))))))),
695
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(1.743715f, fmaxf(-8.6f, ((1f - (powf(powf(v, 2.0f), 2.0f) * 0.000001f)) - powf(fminf(fmaxf(((2.3f + fmaxf(0f, ((v * 1.45f) + ((v * dv) * 0.212766f)))) / copysignf(fmaxf(fabsf(s), 1.0e-4f), s)), -1.0e4f), 1.0e4f), 2.0f))));\n}",
696
+ py: "import torch\n\ndef spear_fn(v, dv, s):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.minimum(1.743715, torch.maximum(-8.6, ((1 - (((v * v) * (v * v)) * 0.000001)) - (((2.3 + torch.maximum(0, ((v * 1.45) + ((v * dv) * 0.212766)))) / (abs(s) < 1e-4 ? 1e-4 : s)) * ((2.3 + torch.maximum(0, ((v * 1.45) + ((v * dv) * 0.212766)))) / (abs(s) < 1e-4 ? 1e-4 : s))))))",
697
+ wasmBase64: "AGFzbQEAAAABDQJgA3x8fAF8YAF8AXwDAgEABwkBBXNwZWFyAAAK5AEB4QEARNi2KLNB5vs/RDMzMzMzMyHARAAAAAAAAPA/IAAgAKIgACAAoqJEp8L61aQqsj6ioURmZmZmZmYCQEQAAAAAAAAAACAARDMzMzMzM/c/oiAAIAGiRG3UdzbqO8s/oqCloCACmUQtQxzr4jYaP6UgAqajRAAAAAAAiMPApUQAAAAAAIjDQKREZmZmZmZmAkBEAAAAAAAAAAAgAEQzMzMzMzP3P6IgACABokRt1Hc26jvLP6KgpaAgAplELUMc6+I2Gj+lIAKmo0QAAAAAAIjDwKVEAAAAAACIw0CkoqGlpAs=",
684
698
  },
685
699
  meta: {
686
700
  metric: 0.002938652617546022,
@@ -701,11 +715,11 @@ export const kernels = {
701
715
  wasmBase64: "AGFzbQEAAAABDgJgBHx8fHwBfGABfAF8AwIBAAcJAQVzcGVhcgAACn8BfQBEP5EnSddM4D8gAES8dJMYBFbqP6IgAUQQWDm0yHbeP6KhIAJEmpmZmZmZ8T+iIANEzosTX+0o07+ioKAgAEQ9CtejcD3qP6IgAUQUrkfhehTeP6KhIAJEoYDtYMR+8T+iIANE3BFOC1700b+ioKCgokQAgG/7jCPVPqAL",
702
716
  },
703
717
  fast: {
704
- js: "((x0, x1, x2, x3) => (((x0 * 0.82) - (x1 * 0.470006)) + ((x2 * 1.1) + (x3 * -0.290238))))",
705
- eval: ((x0, x1, x2, x3) => (((x0 * 0.82) - (x1 * 0.470006)) + ((x2 * 1.1) + (x3 * -0.290238)))),
706
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (((x0 * 0.82f) - (x1 * 0.470006f)) + ((x2 * 1.1f) + (x3 * -0.290238f)));\n}",
707
- py: "import torch\n\ndef spear_fn(x0, x1, x2, x3):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (((x0 * 0.82) - (x1 * 0.470006)) + ((x2 * 1.1) + (x3 * -0.290238)))",
708
- wasmBase64: "AGFzbQEAAAABDgJgBHx8fHwBfGABfAF8AwIBAAcJAQVzcGVhcgAACjcBNQAgAEQ9CtejcD3qP6IgAUQlH7sLlBTeP6KhIAJEmpmZmZmZ8T+iIANE2JyDZ0KT0r+ioKAL",
718
+ js: "((x0, x1, x2) => (((x0 * 0.82) - (x1 * 0.47)) + ((x2 * 1.1) + 0.82)))",
719
+ eval: ((x0, x1, x2) => (((x0 * 0.82) - (x1 * 0.47)) + ((x2 * 1.1) + 0.82))),
720
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (((x0 * 0.82f) - (x1 * 0.47f)) + ((x2 * 1.1f) + 0.82f));\n}",
721
+ py: "import torch\n\ndef spear_fn(x0, x1, x2):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (((x0 * 0.82) - (x1 * 0.47)) + ((x2 * 1.1) + 0.82))",
722
+ wasmBase64: "AGFzbQEAAAABDQJgA3x8fAF8YAF8AXwDAgEABwkBBXNwZWFyAAAKNAEyACAARD0K16NwPeo/oiABRBSuR+F6FN4/oqEgAkSamZmZmZnxP6JEPQrXo3A96j+goAs=",
709
723
  },
710
724
  meta: {
711
725
  metric: 1.6074532951505583e-7,
@@ -830,25 +844,25 @@ export const kernels = {
830
844
  "tanh_sat": {
831
845
  id: "tanh_sat",
832
846
  precise: {
833
- js: "((x) => (0.900021 * Math.min(1e4, Math.max(-1e4, ((x + (0.053639 * (x) * (x) * (x)))) / (((0.90122 + (0.343141 * (x) * (x)))) < 1e-4 && ((0.90122 + (0.343141 * (x) * (x)))) > -1e-4 ? (((0.90122 + (0.343141 * (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((0.90122 + (0.343141 * (x) * (x)))))))))",
834
- eval: ((x) => (0.900021 * Math.min(1e4, Math.max(-1e4, ((x + (0.053639 * (x) * (x) * (x)))) / (((0.90122 + (0.343141 * (x) * (x)))) < 1e-4 && ((0.90122 + (0.343141 * (x) * (x)))) > -1e-4 ? (((0.90122 + (0.343141 * (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((0.90122 + (0.343141 * (x) * (x))))))))),
835
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (0.900021f * fminf(fmaxf(((x + (0.053639f * powf(x, 3.0f))) / copysignf(fmaxf(fabsf((0.90122f + (0.343141f * powf(x, 2.0f)))), 1.0e-4f), (0.90122f + (0.343141f * powf(x, 2.0f))))), -1.0e4f), 1.0e4f));\n}",
836
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (0.900021 * ((x + (0.053639 * (x ** 3))) / (abs((0.90122 + (0.343141 * (x * x)))) < 1e-4 ? 1e-4 : (0.90122 + (0.343141 * (x * x))))))",
837
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACnYBdABEqtIW1/jM7D8gAETBjZQtknarPyAAIAAgAKKioqBELQlQU8vW7D9Ezas6qwX21T8gACAAoqKgmUQtQxzr4jYaP6VELQlQU8vW7D9Ezas6qwX21T8gACAAoqKgpqNEAAAAAACIw8ClRAAAAAAAiMNApKIL",
847
+ js: "((x) => Math.tanh(x))",
848
+ eval: ((x) => Math.tanh(x)),
849
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return tanhf(x);\n}",
850
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.tanh(x)",
851
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgR0YW5oAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
838
852
  },
839
853
  fast: {
840
- js: "((x) => Math.min(1e4, Math.max(-1e4, (x) / (((2.598194 * (4.397731 + (x) * (x)))) < 1e-4 && ((2.598194 * (4.397731 + (x) * (x)))) > -1e-4 ? (((2.598194 * (4.397731 + (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((2.598194 * (4.397731 + (x) * (x))))))))",
841
- eval: ((x) => Math.min(1e4, Math.max(-1e4, (x) / (((2.598194 * (4.397731 + (x) * (x)))) < 1e-4 && ((2.598194 * (4.397731 + (x) * (x)))) > -1e-4 ? (((2.598194 * (4.397731 + (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((2.598194 * (4.397731 + (x) * (x)))))))),
842
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((x / copysignf(fmaxf(fabsf((2.598194f * (4.397731f + powf(x, 2.0f)))), 1.0e-4f), (2.598194f * (4.397731f + powf(x, 2.0f))))), -1.0e4f), 1.0e4f);\n}",
843
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x / (abs((2.598194 * (4.397731 + (x * x)))) < 1e-4 ? 1e-4 : (2.598194 * (4.397731 + (x * x)))))",
844
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAAClkBVwAgAESxTpXvGckEQEToa5bLRpcRQCAAIACioKKZRC1DHOviNho/pUSxTpXvGckEQEToa5bLRpcRQCAAIACioKKmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
854
+ js: "((x) => Math.tanh(x))",
855
+ eval: ((x) => Math.tanh(x)),
856
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return tanhf(x);\n}",
857
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.tanh(x)",
858
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgR0YW5oAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
845
859
  },
846
860
  meta: {
847
- metric: 0.0000046412770528300585,
848
- level: 4,
849
- formulaCost: 12,
861
+ metric: 0,
862
+ level: 5,
863
+ formulaCost: 1,
850
864
  exactCost: 20,
851
- speedupVsExact: 1.6666666666666667,
865
+ speedupVsExact: 20,
852
866
  vsIterative: null,
853
867
  },
854
868
  },
@@ -905,25 +919,25 @@ export const kernels = {
905
919
  "erf_prob": {
906
920
  id: "erf_prob",
907
921
  precise: {
908
- js: "((x) => (1.106774 * Math.min(1e4, Math.max(-1e4, ((x + (0.034298 * (x) * (x) * (x)))) / (((0.995 + (0.378089 * (x) * (x)))) < 1e-4 && ((0.995 + (0.378089 * (x) * (x)))) > -1e-4 ? (((0.995 + (0.378089 * (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((0.995 + (0.378089 * (x) * (x)))))))))",
909
- eval: ((x) => (1.106774 * Math.min(1e4, Math.max(-1e4, ((x + (0.034298 * (x) * (x) * (x)))) / (((0.995 + (0.378089 * (x) * (x)))) < 1e-4 && ((0.995 + (0.378089 * (x) * (x)))) > -1e-4 ? (((0.995 + (0.378089 * (x) * (x)))) >= 0 ? 1e-4 : -1e-4) : ((0.995 + (0.378089 * (x) * (x))))))))),
910
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (1.106774f * fminf(fmaxf(((x + (0.034298f * powf(x, 3.0f))) / copysignf(fmaxf(fabsf((0.995f + (0.378089f * powf(x, 2.0f)))), 1.0e-4f), (0.995f + (0.378089f * powf(x, 2.0f))))), -1.0e4f), 1.0e4f));\n}",
911
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (1.106774 * ((x + (0.034298 * (x ** 3))) / (abs((0.995 + (0.378089 * (x * x)))) < 1e-4 ? 1e-4 : (0.995 + (0.378089 * (x * x))))))",
912
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACnYBdABEeQJhp1i18T8gAEQp7KLogY+hPyAAIAAgAKKioqBE16NwPQrX7z9Ezox+NJwy2D8gACAAoqKgmUQtQxzr4jYaP6VE16NwPQrX7z9Ezox+NJwy2D8gACAAoqKgpqNEAAAAAACIw8ClRAAAAAAAiMNApKIL",
922
+ js: "((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return __erf(x); })",
923
+ eval: ((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return __erf(x); }),
924
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return erff(x);\n}",
925
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.erf(x)",
926
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNlcmYAAQMCAQAHCQEFc3BlYXIAAQoIAQYAIAAQAAs=",
913
927
  },
914
928
  fast: {
915
- js: "((x) => Math.sin(Math.sin(Math.atan(x))))",
916
- eval: ((x) => Math.sin(Math.sin(Math.atan(x)))),
917
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return sinf(sinf(atanf(x)));\n}",
918
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.sin(torch.sin(torch.atan(x)))",
919
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AhYCA2VudgNzaW4AAQNlbnYEYXRhbgABAwIBAAcJAQVzcGVhcgACCgwBCgAgABABEAAQAAs=",
929
+ js: "((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return __erf(x); })",
930
+ eval: ((x) => { const __erf = (x) => { const s = x < 0 ? -1 : 1; const ax = Math.abs(x); const t = 1 / (1 + 0.3275911 * ax); return s * (1 - ((((1.061405429 * t - 1.453152027) * t + 1.421413741) * t - 0.284496736) * t + 0.254829592) * t * Math.exp(-ax * ax)); }; return __erf(x); }),
931
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return erff(x);\n}",
932
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.erf(x)",
933
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNlcmYAAQMCAQAHCQEFc3BlYXIAAQoIAQYAIAAQAAs=",
920
934
  },
921
935
  meta: {
922
- metric: 0.00004650870031371604,
923
- level: 3,
924
- formulaCost: 12,
936
+ metric: 0,
937
+ level: 5,
938
+ formulaCost: 1,
925
939
  exactCost: 26,
926
- speedupVsExact: 2.1666666666666665,
940
+ speedupVsExact: 26,
927
941
  vsIterative: null,
928
942
  },
929
943
  },
@@ -937,11 +951,11 @@ export const kernels = {
937
951
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACoABAX4ARJrWYT4kC/C/RDvD1JY6CPI/IAAgAKJExZCcTNwqxL+hoUQ64i18lwLwPyAAmaVEH9YbtcL07z+gmUQtQxzr4jYaP6VEOuItfJcC8D8gAJmlRB/WG7XC9O8/oKajRAAAAAAAiMPApUQAAAAAAIjDQKSiRFTKGPauGd8/oAs=",
938
952
  },
939
953
  fast: {
940
- js: "((x) => Math.min(1e4, Math.max(-1e4, ((x) * (x)) / (((Math.abs(x) + 0.989)) < 1e-4 && ((Math.abs(x) + 0.989)) > -1e-4 ? (((Math.abs(x) + 0.989)) >= 0 ? 1e-4 : -1e-4) : ((Math.abs(x) + 0.989))))))",
941
- eval: ((x) => Math.min(1e4, Math.max(-1e4, ((x) * (x)) / (((Math.abs(x) + 0.989)) < 1e-4 && ((Math.abs(x) + 0.989)) > -1e-4 ? (((Math.abs(x) + 0.989)) >= 0 ? 1e-4 : -1e-4) : ((Math.abs(x) + 0.989)))))),
942
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((powf(x, 2.0f) / copysignf(fmaxf(fabsf((fabsf(x) + 0.989f)), 1.0e-4f), (fabsf(x) + 0.989f))), -1.0e4f), 1.0e4f);\n}",
943
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((x * x) / (abs((torch.abs(x) + 0.989)) < 1e-4 ? 1e-4 : (torch.abs(x) + 0.989)))",
944
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACkQBQgAgACAAoiAAmUTZzvdT46XvP6CZRC1DHOviNho/pSAAmUTZzvdT46XvP6Cmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
954
+ js: "((x) => Math.max(((x) * (x) * 0.098068), ((Math.abs(x) * 0.72) - 0.381094)))",
955
+ eval: ((x) => Math.max(((x) * (x) * 0.098068), ((Math.abs(x) * 0.72) - 0.381094))),
956
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fmaxf((powf(x, 2.0f) * 0.098068f), ((fabsf(x) * 0.72f) - 0.381094f));\n}",
957
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.maximum(((x * x) * 0.098068), ((torch.abs(x) * 0.72) - 0.381094))",
958
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACisBKQAgACAAokSdvMgE/Bq5P6IgAJlECtejcD0K5z+iRK/qrBbYY9g/oaUL",
945
959
  },
946
960
  meta: {
947
961
  metric: 2.992203818088443e-7,
@@ -1237,11 +1251,11 @@ export const kernels = {
1237
1251
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNsb2cAAQMCAQAHCQEFc3BlYXIAAQpLAUkAIABEAAAAAAAA8D8gAKGZRC1DHOviNho/pUQAAAAAAADwPyAAoaajRAAAAAAAiMPApUQAAAAAAIjDQKREoMLr/ktItDmlEAAL",
1238
1252
  },
1239
1253
  fast: {
1240
- js: "((x) => Math.log(Math.max(1e-30, Math.min(1e4, Math.max(-1e4, (x) / (((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) < 1e-4 && ((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) > -1e-4 ? (((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) >= 0 ? 1e-4 : -1e-4) : ((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x))))))))",
1241
- eval: ((x) => Math.log(Math.max(1e-30, Math.min(1e4, Math.max(-1e4, (x) / (((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) < 1e-4 && ((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) > -1e-4 ? (((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)) >= 0 ? 1e-4 : -1e-4) : ((Math.min(1e4, Math.max(-1e4, (x) / ((x) < 1e-4 && (x) > -1e-4 ? ((x) >= 0 ? 1e-4 : -1e-4) : (x)))) - x)))))))),
1242
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return logf(fmaxf(1.0e-30f, fminf(fmaxf((x / copysignf(fmaxf(fabsf((fminf(fmaxf((x / copysignf(fmaxf(fabsf(x), 1.0e-4f), x)), -1.0e4f), 1.0e4f) - x)), 1.0e-4f), (fminf(fmaxf((x / copysignf(fmaxf(fabsf(x), 1.0e-4f), x)), -1.0e4f), 1.0e4f) - x))), -1.0e4f), 1.0e4f)));\n}",
1243
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.log(torch.clamp((x / (abs(((x / (abs(x) < 1e-4 ? 1e-4 : x)) - x)) < 1e-4 ? 1e-4 : ((x / (abs(x) < 1e-4 ? 1e-4 : x)) - x))), min=1e-30))",
1244
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNsb2cAAQMCAQAHCQEFc3BlYXIAAQqIAQGFAQAgACAAIACZRC1DHOviNho/pSAApqNEAAAAAACIw8ClRAAAAAAAiMNApCAAoZlELUMc6+I2Gj+lIAAgAJlELUMc6+I2Gj+lIACmo0QAAAAAAIjDwKVEAAAAAACIw0CkIAChpqNEAAAAAACIw8ClRAAAAAAAiMNApESgwuv+S0i0OaUQAAs=",
1254
+ js: "((x) => Math.log(Math.max(1e-30, Math.min(1e4, Math.max(-1e4, (x) / (((1 - x)) < 1e-4 && ((1 - x)) > -1e-4 ? (((1 - x)) >= 0 ? 1e-4 : -1e-4) : ((1 - x))))))))",
1255
+ eval: ((x) => Math.log(Math.max(1e-30, Math.min(1e4, Math.max(-1e4, (x) / (((1 - x)) < 1e-4 && ((1 - x)) > -1e-4 ? (((1 - x)) >= 0 ? 1e-4 : -1e-4) : ((1 - x)))))))),
1256
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return logf(fmaxf(1.0e-30f, fminf(fmaxf((x / copysignf(fmaxf(fabsf((1f - x)), 1.0e-4f), (1f - x))), -1.0e4f), 1.0e4f)));\n}",
1257
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.log(torch.clamp((x / (abs((1 - x)) < 1e-4 ? 1e-4 : (1 - x))), min=1e-30))",
1258
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgsBA2VudgNsb2cAAQMCAQAHCQEFc3BlYXIAAQpLAUkAIABEAAAAAAAA8D8gAKGZRC1DHOviNho/pUQAAAAAAADwPyAAoaajRAAAAAAAiMPApUQAAAAAAIjDQKREoMLr/ktItDmlEAAL",
1245
1259
  },
1246
1260
  meta: {
1247
1261
  metric: 0,
@@ -1330,11 +1344,11 @@ export const kernels = {
1330
1344
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACqcBAaQBAER4zU3WKLkUQCAARAtGJXUC81LAoCAARFILJZNT+w/AoZlELUMc6+I2Gj+lIABEUgslk1P7D8ChpqNEAAAAAACIw8ClRAAAAAAAiMNApEQfTfVk/rEEwCAAIABE2/y/6shxD8ChpZlELUMc6+I2Gj+lIAAgAETb/L/qyHEPwKGlpqNEAAAAAACIw8ClRAAAAAAAiMNApKGiRFK25bNttFdAoAs=",
1331
1345
  },
1332
1346
  fast: {
1333
- js: "((s) => (Math.min(1e4, Math.max(-1e4, (-79.794743) / (((s - -3.997718)) < 1e-4 && ((s - -3.997718)) > -1e-4 ? (((s - -3.997718)) >= 0 ? 1e-4 : -1e-4) : ((s - -3.997718))))) - Math.min(1e4, Math.max(-1e4, (-2.586911) / ((Math.max(-79.794743, (s - -3.930559))) < 1e-4 && (Math.max(-79.794743, (s - -3.930559))) > -1e-4 ? ((Math.max(-79.794743, (s - -3.930559))) >= 0 ? 1e-4 : -1e-4) : (Math.max(-79.794743, (s - -3.930559))))))))",
1334
- eval: ((s) => (Math.min(1e4, Math.max(-1e4, (-79.794743) / (((s - -3.997718)) < 1e-4 && ((s - -3.997718)) > -1e-4 ? (((s - -3.997718)) >= 0 ? 1e-4 : -1e-4) : ((s - -3.997718))))) - Math.min(1e4, Math.max(-1e4, (-2.586911) / ((Math.max(-79.794743, (s - -3.930559))) < 1e-4 && (Math.max(-79.794743, (s - -3.930559))) > -1e-4 ? ((Math.max(-79.794743, (s - -3.930559))) >= 0 ? 1e-4 : -1e-4) : (Math.max(-79.794743, (s - -3.930559)))))))),
1335
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (fminf(fmaxf((-79.794743f / copysignf(fmaxf(fabsf((s - -3.997718f)), 1.0e-4f), (s - -3.997718f))), -1.0e4f), 1.0e4f) - fminf(fmaxf((-2.586911f / copysignf(fmaxf(fabsf(fmaxf(-79.794743f, (s - -3.930559f))), 1.0e-4f), fmaxf(-79.794743f, (s - -3.930559f)))), -1.0e4f), 1.0e4f));\n}",
1336
- py: "import torch\n\ndef spear_fn(s):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((-79.794743 / (abs((s - -3.997718)) < 1e-4 ? 1e-4 : (s - -3.997718))) - (-2.586911 / (abs(torch.maximum(-79.794743, (s - -3.930559))) < 1e-4 ? 1e-4 : torch.maximum(-79.794743, (s - -3.930559)))))",
1337
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACp4BAZsBAERlbr4R3fJTwCAARFILJZNT+w/AoZlELUMc6+I2Gj+lIABEUgslk1P7D8ChpqNEAAAAAACIw8ClRAAAAAAAiMNApEQfTfVk/rEEwERlbr4R3fJTwCAARNv8v+rIcQ/AoaWZRC1DHOviNho/pURlbr4R3fJTwCAARNv8v+rIcQ/AoaWmo0QAAAAAAIjDwKVEAAAAAACIw0CkoQs=",
1347
+ js: "((s) => Math.min(1e4, Math.max(-1e4, (s) / (((2.92842 + Math.abs(s))) < 1e-4 && ((2.92842 + Math.abs(s))) > -1e-4 ? (((2.92842 + Math.abs(s))) >= 0 ? 1e-4 : -1e-4) : ((2.92842 + Math.abs(s)))))))",
1348
+ eval: ((s) => Math.min(1e4, Math.max(-1e4, (s) / (((2.92842 + Math.abs(s))) < 1e-4 && ((2.92842 + Math.abs(s))) > -1e-4 ? (((2.92842 + Math.abs(s))) >= 0 ? 1e-4 : -1e-4) : ((2.92842 + Math.abs(s))))))),
1349
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((s / copysignf(fmaxf(fabsf((2.92842f + fabsf(s))), 1.0e-4f), (2.92842f + fabsf(s)))), -1.0e4f), 1.0e4f);\n}",
1350
+ py: "import torch\n\ndef spear_fn(s):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (s / (abs((2.92842 + torch.abs(s))) < 1e-4 ? 1e-4 : (2.92842 + torch.abs(s))))",
1351
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACkEBPwAgAERangd3Z20HQCAAmaCZRC1DHOviNho/pURangd3Z20HQCAAmaCmo0QAAAAAAIjDwKVEAAAAAACIw0CkCw==",
1338
1352
  },
1339
1353
  meta: {
1340
1354
  metric: 6.947760597116317e-10,
@@ -1380,11 +1394,11 @@ export const kernels = {
1380
1394
  wasmBase64: "AGFzbQEAAAABDAJgAnx8AXxgAXwBfAMCAQAHCQEFc3BlYXIAAApqAWgARCiSGoUP4IXAIAAgAaBEhA66hENvqT9EtU5cjtdAdUAgAKGhmUQtQxzr4jYaP6VEhA66hENvqT9EtU5cjtdAdUAgAKGhpqNEAAAAAACIw8ClRAAAAAAAiMNApKJEhErJw//fhUCgCw==",
1381
1395
  },
1382
1396
  fast: {
1383
- js: "((vs, vo) => (317.901286 + (vs + vo)))",
1384
- eval: ((vs, vo) => (317.901286 + (vs + vo))),
1385
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (317.901286f + (vs + vo));\n}",
1386
- py: "import torch\n\ndef spear_fn(vs, vo):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (317.901286 + (vs + vo))",
1387
- wasmBase64: "AGFzbQEAAAABDAJgAnx8AXxgAXwBfAMCAQAHCQEFc3BlYXIAAAoTAREARHxl3qpr3nNAIAAgAaCgCw==",
1397
+ js: "((vo, vs) => (vo + vs))",
1398
+ eval: ((vo, vs) => (vo + vs)),
1399
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (vo + vs);\n}",
1400
+ py: "import torch\n\ndef spear_fn(vo, vs):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (vo + vs)",
1401
+ wasmBase64: "AGFzbQEAAAABDAJgAnx8AXxgAXwBfAMCAQAHCQEFc3BlYXIAAAoJAQcAIAAgAaAL",
1388
1402
  },
1389
1403
  meta: {
1390
1404
  metric: 9.281797631143672e-10,
@@ -1479,6 +1493,13 @@ export const kernels = {
1479
1493
  py: "import torch\n\ndef spear_fn(a, d, b, c):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (2 * torch.abs(((a * d) - (b * c))))",
1480
1494
  wasmBase64: "AGFzbQEAAAABDgJgBHx8fHwBfGABfAF8AwIBAAcJAQVzcGVhcgAAChoBGABEAAAAAAAAAEAgACABoiACIAOioZmiCw==",
1481
1495
  },
1496
+ fast: {
1497
+ js: "((a, d, b, c) => Math.abs(((a * d) - (b * c))))",
1498
+ eval: ((a, d, b, c) => Math.abs(((a * d) - (b * c)))),
1499
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fabsf(((a * d) - (b * c)));\n}",
1500
+ py: "import torch\n\ndef spear_fn(a, d, b, c):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.abs(((a * d) - (b * c)))",
1501
+ wasmBase64: "AGFzbQEAAAABDgJgBHx8fHwBfGABfAF8AwIBAAcJAQVzcGVhcgAAChABDgAgACABoiACIAOioZkL",
1502
+ },
1482
1503
  meta: {
1483
1504
  metric: 0,
1484
1505
  level: 5,
@@ -1523,11 +1544,11 @@ export const kernels = {
1523
1544
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACh0BGwBEAAAAAAAA+D8gACAAoqJEAAAAAAAA4L+gCw==",
1524
1545
  },
1525
1546
  fast: {
1526
- js: "((x) => (-0.774693 * (x) * (x)))",
1527
- eval: ((x) => (-0.774693 * (x) * (x))),
1528
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (-0.774693f * powf(x, 2.0f));\n}",
1529
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (-0.774693 * (x * x))",
1530
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAAChMBEQBEhxVu+UjK6L8gACAAoqIL",
1547
+ js: "((x) => (x) * (x))",
1548
+ eval: ((x) => (x) * (x)),
1549
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return powf(x, 2.0f);\n}",
1550
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x * x)",
1551
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACgkBBwAgACAAogs=",
1531
1552
  },
1532
1553
  meta: {
1533
1554
  metric: 3.250969746125654e-33,
@@ -1573,11 +1594,11 @@ export const kernels = {
1573
1594
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhc2luAAEDAgEABwkBBXNwZWFyAAEKHAEaACAARAAAAAAAAPC/pUQAAAAAAADwP6QQAAs=",
1574
1595
  },
1575
1596
  fast: {
1576
- js: "((x) => (0.529961 * ((1.930182 * x) + ((0.645691 * (x) * (x)) * (x) * (x) * (x)))))",
1577
- eval: ((x) => (0.529961 * ((1.930182 * x) + ((0.645691 * (x) * (x)) * (x) * (x) * (x))))),
1578
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (0.529961f * ((1.930182f * x) + ((0.645691f * powf(x, 2.0f)) * powf(x, 3.0f))));\n}",
1579
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (0.529961 * ((1.930182 * x) + ((0.645691 * (x * x)) * (x ** 3))))",
1580
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACjMBMQBEf/lkxXD14D9E9z5VhQbi/j8gAKJEBkoKLICp5D8gACAAoqIgACAAIACioqKgogs=",
1597
+ js: "((x) => ((-1.143333 * (Math.acos(Math.max(-1, Math.min(1, x))) + 1)) + 1.482365))",
1598
+ eval: ((x) => ((-1.143333 * (Math.acos(Math.max(-1, Math.min(1, x))) + 1)) + 1.482365)),
1599
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return ((-1.143333f * (acosf(fmaxf(-1.0f, fminf(1.0f, x))) + 1f)) + 1.482365f);\n}",
1600
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((-1.143333 * (torch.acos(torch.clamp(x, -1.0, 1.0)) + 1)) + 1.482365)",
1601
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhY29zAAEDAgEABwkBBXNwZWFyAAEKOgE4AERHADeLF0vyvyAARAAAAAAAAPC/pUQAAAAAAADwP6QQAEQAAAAAAADwP6CiRLnCu1zEt/c/oAs=",
1581
1602
  },
1582
1603
  meta: {
1583
1604
  metric: 0,
@@ -1673,11 +1694,11 @@ export const kernels = {
1673
1694
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACl0BWwBE3+V6QIMSzr8gAERrZFdaRqoDwKBECmr4FtaN6T8gAKCZRC1DHOviNho/pUQKavgW1o3pPyAAoKajRAAAAAAAiMPApUQAAAAAAIjDQKSiRGqlYY85LNI/oAs=",
1674
1695
  },
1675
1696
  fast: {
1676
- js: "((x) => Math.min(1e4, Math.max(-1e4, (2.895344) / ((((x + (1.447672 + x)) * 0.661578)) < 1e-4 && (((x + (1.447672 + x)) * 0.661578)) > -1e-4 ? ((((x + (1.447672 + x)) * 0.661578)) >= 0 ? 1e-4 : -1e-4) : (((x + (1.447672 + x)) * 0.661578))))))",
1677
- eval: ((x) => Math.min(1e4, Math.max(-1e4, (2.895344) / ((((x + (1.447672 + x)) * 0.661578)) < 1e-4 && (((x + (1.447672 + x)) * 0.661578)) > -1e-4 ? ((((x + (1.447672 + x)) * 0.661578)) >= 0 ? 1e-4 : -1e-4) : (((x + (1.447672 + x)) * 0.661578)))))),
1678
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((2.895344f / copysignf(fmaxf(fabsf(((x + (1.447672f + x)) * 0.661578f)), 1.0e-4f), ((x + (1.447672f + x)) * 0.661578f))), -1.0e4f), 1.0e4f);\n}",
1679
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (2.895344 / (abs(((x + (1.447672 + x)) * 0.661578)) < 1e-4 ? 1e-4 : ((x + (1.447672 + x)) * 0.661578)))",
1680
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACmABXgBEzVt1HaopB0AgAETNW3Udqin3PyAAoKBETBk4oKUr5T+imUQtQxzr4jYaP6UgAETNW3Udqin3PyAAoKBETBk4oKUr5T+ipqNEAAAAAACIw8ClRAAAAAAAiMNApAs=",
1697
+ js: "((x) => Math.atan(x))",
1698
+ eval: ((x) => Math.atan(x)),
1699
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return atanf(x);\n}",
1700
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.atan(x)",
1701
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhdGFuAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
1681
1702
  },
1682
1703
  meta: {
1683
1704
  metric: 0.00003054908318748102,
@@ -1891,11 +1912,11 @@ export const kernels = {
1891
1912
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACqgBAaUBAERxcqqzCTb/v0TJ42n5gYsIQCAAmUQtQxzr4jYaP6UgAKajRAAAAAAAiMPApUQAAAAAAIjDQKRET5DY7h6gt79E4IWt2co7EEAgAESIY13cRjMXwKKkoJlELUMc6+I2Gj+lRE+Q2O4eoLe/ROCFrdnKOxBAIABEiGNd3EYzF8CipKCmo0QAAAAAAIjDwKVEAAAAAACIw0CkokRIh74yt52Jv6AL",
1892
1913
  },
1893
1914
  fast: {
1894
- js: "((x) => (Math.min(1e4, Math.max(-1e4, (1.449627) / (((x) * (x)) < 1e-4 && ((x) * (x)) > -1e-4 ? (((x) * (x)) >= 0 ? 1e-4 : -1e-4) : ((x) * (x))))) * 0.237626))",
1895
- eval: ((x) => (Math.min(1e4, Math.max(-1e4, (1.449627) / (((x) * (x)) < 1e-4 && ((x) * (x)) > -1e-4 ? (((x) * (x)) >= 0 ? 1e-4 : -1e-4) : ((x) * (x))))) * 0.237626)),
1896
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (fminf(fmaxf((1.449627f / copysignf(fmaxf(fabsf(powf(x, 2.0f)), 1.0e-4f), powf(x, 2.0f))), -1.0e4f), 1.0e4f) * 0.237626f);\n}",
1897
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return ((1.449627 / (abs((x * x)) < 1e-4 ? 1e-4 : (x * x))) * 0.237626)",
1898
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACkIBQABEomDGFKwx9z8gACAAoplELUMc6+I2Gj+lIAAgAKKmo0QAAAAAAIjDwKVEAAAAAACIw0CkRCzzVl2Has4/ogs=",
1915
+ js: "((x) => Math.tanh(x))",
1916
+ eval: ((x) => Math.tanh(x)),
1917
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return tanhf(x);\n}",
1918
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.tanh(x)",
1919
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgR0YW5oAAEDAgEABwkBBXNwZWFyAAEKCAEGACAAEAAL",
1899
1920
  },
1900
1921
  meta: {
1901
1922
  metric: 0.000013132168838441087,
@@ -1941,11 +1962,11 @@ export const kernels = {
1941
1962
  wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACl0BWwBEBgaNf+gG2D9EaLPqc7V1C0AgAKIgAETQKjOl9bf5P6CZRC1DHOviNho/pSAARNAqM6X1t/k/oKajRAAAAAAAiMPApUQAAAAAAIjDQKSiRHtUXePcclS/oAs=",
1942
1963
  },
1943
1964
  fast: {
1944
- js: "((x) => Math.min(1e4, Math.max(-1e4, (x) / (((x + 1.032428)) < 1e-4 && ((x + 1.032428)) > -1e-4 ? (((x + 1.032428)) >= 0 ? 1e-4 : -1e-4) : ((x + 1.032428))))))",
1945
- eval: ((x) => Math.min(1e4, Math.max(-1e4, (x) / (((x + 1.032428)) < 1e-4 && ((x + 1.032428)) > -1e-4 ? (((x + 1.032428)) >= 0 ? 1e-4 : -1e-4) : ((x + 1.032428)))))),
1946
- c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fminf(fmaxf((x / copysignf(fmaxf(fabsf((x + 1.032428f)), 1.0e-4f), (x + 1.032428f))), -1.0e4f), 1.0e4f);\n}",
1947
- py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x / (abs((x + 1.032428)) < 1e-4 ? 1e-4 : (x + 1.032428)))",
1948
- wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAACj8BPQAgACAARFKY9zjThPA/oJlELUMc6+I2Gj+lIABEUpj3ONOE8D+gpqNEAAAAAACIw8ClRAAAAAAAiMNApAs=",
1965
+ js: "((x) => (Math.atan(x)) * (Math.atan(x)))",
1966
+ eval: ((x) => (Math.atan(x)) * (Math.atan(x))),
1967
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return powf(atanf(x), 2.0f);\n}",
1968
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (torch.atan(x) * torch.atan(x))",
1969
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AgwBA2VudgRhdGFuAAEDAgEABwkBBXNwZWFyAAEKDQELACAAEAAgABAAogs=",
1949
1970
  },
1950
1971
  meta: {
1951
1972
  metric: 9.35135840763872e-9,
@@ -1956,8 +1977,33 @@ export const kernels = {
1956
1977
  vsIterative: null,
1957
1978
  },
1958
1979
  },
1980
+ "mish": {
1981
+ id: "mish",
1982
+ precise: {
1983
+ js: "((x) => (x * Math.tanh(Math.log(Math.max(1e-30, (1 + Math.exp(Math.max(-50, Math.min(50, x)))))))))",
1984
+ eval: ((x) => (x * Math.tanh(Math.log(Math.max(1e-30, (1 + Math.exp(Math.max(-50, Math.min(50, x))))))))),
1985
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return (x * tanhf(logf(fmaxf(1.0e-30f, (1f + expf(fmaxf(-50.0f, fminf(50.0f, x))))))));\n}",
1986
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return (x * torch.tanh(torch.log(torch.clamp((1 + torch.exp(torch.clamp(x, -50.0, 50.0))), min=1e-30))))",
1987
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AiADA2VudgNleHAAAQNlbnYDbG9nAAEDZW52BHRhbmgAAQMCAQAHCQEFc3BlYXIAAwo3ATUAIABEAAAAAAAA8D8gAEQAAAAAAABJwKVEAAAAAAAASUCkEACgRKDC6/5LSLQ5pRABEAKiCw==",
1988
+ },
1989
+ fast: {
1990
+ js: "((x) => Math.max(0, x))",
1991
+ eval: ((x) => Math.max(0, x)),
1992
+ c: "// Evolved by SPEAR — algebraic only, FP16 safe\n__device__ inline float spear_fn(const float x) {\n return fmaxf(0.0f, x);\n}",
1993
+ py: "import torch\n\ndef spear_fn(x):\n # Evolved by SPEAR — zero transcendental ops (exp/erf/tanh free)\n return torch.relu(x)",
1994
+ wasmBase64: "AGFzbQEAAAABCwJgAXwBfGABfAF8AwIBAAcJAQVzcGVhcgAAChABDgAgAEQAAAAAAAAAAKUL",
1995
+ },
1996
+ meta: {
1997
+ metric: 0,
1998
+ level: 5,
1999
+ formulaCost: 5,
2000
+ exactCost: 62,
2001
+ speedupVsExact: 12.4,
2002
+ vsIterative: null,
2003
+ },
2004
+ },
1959
2005
  };
1960
2006
 
1961
- export const kernelIds = ["silu","gelu","sigmoid","kv_cache","free_fall","kepler","gaussian_cdf","damped_pendulum","rl_distillation","lambert_w","rc_circuit","gaussian_kernel","diffusion_beta","bilinear_interp","european_call","temporal_grad","lorentz","hill","kerr","lennard_jones","damped_oscillation","logistic_growth","softplus","kdv_soliton","kerr_spin","pendulum_hybrid","eigen3_sym","ik_reach","idm_following","gemv4","rope_rot","gauss_shader","ema_smooth","smoothstep","srgb_gamma","tanh_sat","atan_unit","srgb_decode","erf_prob","huber_loss","cosh_curve","bessel_j0","bessel_j1","blackbody_r","aces_fit","logsumexp2","probit_quantile","pmt_finance","blackbody_g","blackbody_b","bessel_j2","logit_ml","kelly_criterion","rsi_momentum","implied_vol","michaelis_menten","temperature_softmax","doppler_effect","stefan_boltzmann","mm1_queue_wait","grover_amplitude","concurrence_pure","chsh_correlation","legendre_p2","laguerre_l2","asin_hard","qfi_dephasing","amp_damp_fid","loschmidt_rate","bessel_i0e","elliptic_k","kepler_solver","fast_exp_alu","fresnel_schlick","rayleigh_phase","smootherstep","fog_exp2","back_ease_out","light_falloff_punctual","bias_slope","uncharted2_tonemap"];
2007
+ export const kernelIds = ["silu","gelu","sigmoid","kv_cache","free_fall","kepler","gaussian_cdf","damped_pendulum","rl_distillation","lambert_w","rc_circuit","gaussian_kernel","diffusion_beta","bilinear_interp","european_call","temporal_grad","lorentz","hill","kerr","lennard_jones","damped_oscillation","logistic_growth","softplus","kdv_soliton","kerr_spin","pendulum_hybrid","eigen3_sym","ik_reach","idm_following","gemv4","rope_rot","gauss_shader","ema_smooth","smoothstep","srgb_gamma","tanh_sat","atan_unit","srgb_decode","erf_prob","huber_loss","cosh_curve","bessel_j0","bessel_j1","blackbody_r","aces_fit","logsumexp2","probit_quantile","pmt_finance","blackbody_g","blackbody_b","bessel_j2","logit_ml","kelly_criterion","rsi_momentum","implied_vol","michaelis_menten","temperature_softmax","doppler_effect","stefan_boltzmann","mm1_queue_wait","grover_amplitude","concurrence_pure","chsh_correlation","legendre_p2","laguerre_l2","asin_hard","qfi_dephasing","amp_damp_fid","loschmidt_rate","bessel_i0e","elliptic_k","kepler_solver","fast_exp_alu","fresnel_schlick","rayleigh_phase","smootherstep","fog_exp2","back_ease_out","light_falloff_punctual","bias_slope","uncharted2_tonemap","mish"];
1962
2008
 
1963
2009
  export default kernels;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spear-kernels",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "Closed-form kernels discovered by the SPEAR symbolic regression engine, shipped as JS, CUDA C, PyTorch and WebAssembly.",
5
5
  "license": "MIT",
6
6
  "type": "module",