* Complete the factorization of an odd `n ≥ 1` into `result`, using * Miller–Rabin to recognize prime cofactors and Pollard rho to split * composite ones. Callers strip the small factors first (rho is only * economical past the trial-division range).
(n: bigint, result: Map<bigint, number>)
| 284 | for (let c = 1n; ; c++) { |
| 285 | let x = 2n; |
| 286 | let y = 2n; |
| 287 | let ys = 2n; |
| 288 | let q = 1n; |
| 289 | let g = 1n; |
| 290 | let r = 1n; |
| 291 | while (g === 1n) { |
| 292 | x = y; |
| 293 | for (let i = 0n; i < r; i++) { |
| 294 | y = (y * y + c) % n; |
| 295 | guard(); |
| 296 | } |
| 297 | for (let k = 0n; k < r && g === 1n; k += m) { |
| 298 | ys = y; |
| 299 | const lim = r - k < m ? r - k : m; |
| 300 | for (let i = 0n; i < lim; i++) { |
no test coverage detected