zenno: format & lint fixes

This commit is contained in:
2026-05-24 18:06:51 -04:00
parent 0f14ece4da
commit bae79a5320
6 changed files with 433 additions and 326 deletions
+6 -6
View File
@@ -1,9 +1,9 @@
import * as math from "mathjs";
import * as math from 'mathjs';
export function binomPMF(p: number, n: number, k: number): number {
// Operate in log domain for precision.
const lc = math.lgamma(n+1) - math.lgamma(k+1) - math.lgamma(n-k+1);
const lpk = k * math.log(p);
const lr = (n - k) * math.log(1 - p);
return math.exp(lc + lpk + lr);
// Operate in log domain for precision.
const lc = math.lgamma(n + 1) - math.lgamma(k + 1) - math.lgamma(n - k + 1);
const lpk = k * math.log(p);
const lr = (n - k) * math.log(1 - p);
return math.exp(lc + lpk + lr);
}