Skip to content

armgit / janas

Public Imported from GitHub
0

37 tok/s from Qwen3-Next-80B (48 GB) on a 32 GB laptop, 24 without drafts vs 2.8 for llama.cpp; reading 62 vs 16 tok/s. Faster than llama.cpp on all 13 models compared in Q4_K_M. LLMs bigger than your RAM, pure C, CPU or GPU.

Release 2026-10-17 (2): test_jmath gives far angles' sines a margin - Windows's C library reduces them with fewer digits of pi, and the Windows package was not built

camauri7b126921f745
diff --git a/tests/test_jmath.c b/tests/test_jmath.c
index 2c5126e..3a5e3a9 100644
--- a/tests/test_jmath.c
+++ b/tests/test_jmath.c
@@ -113,10 +113,16 @@ int main(void)
x = -x;
float s, c;
janas_sincosf(x, &s, &c);
- CHECK(close_enough(s, sin((double)x)), "sin(%.9g) = %.9g, want %.9g", x,
- s, sin((double)x));
- CHECK(close_enough(c, cos((double)x)), "cos(%.9g) = %.9g, want %.9g", x,
- c, cos((double)x));
+ /* far angles: the reference may be off itself - Windows's C library
+ reduces them with fewer digits of pi, 1.2e-12 off at 9.4e8 where
+ ours agrees with the exact value - so a margin of |x| 2^-68 */
+ double far = fabs((double)x) * 0x1p-68;
+ CHECK(close_enough(s, sin((double)x)) ||
+ fabs((double)s - sin((double)x)) <= far,
+ "sin(%.9g) = %.9g, want %.9g", x, s, sin((double)x));
+ CHECK(close_enough(c, cos((double)x)) ||
+ fabs((double)c - cos((double)x)) <= far,
+ "cos(%.9g) = %.9g, want %.9g", x, c, cos((double)x));
}
for (int i = -60000; i <= 60000; i++) {
float x = (float)i * 5e-4f;