* Applies the family-generation rule documented on `PellResult`: every class * rep times unit^t for `t` in `[-tRange, tRange]`, plus the global negation, * filtered down to the `|x|,|y| ≤ bound` box (to match a bounded * `bruteForcePell` oracle).
( classes: [bigint, bigint][], unit: [bigint, bigint], D: bigint, tRange: bigint, bound: bigint )
| 404 | * `bruteForcePell` oracle). |
| 405 | */ |
| 406 | function pellFamilyMembersInBox( |
| 407 | classes: [bigint, bigint][], |
| 408 | unit: [bigint, bigint], |
| 409 | D: bigint, |
| 410 | tRange: bigint, |
| 411 | bound: bigint |
| 412 | ): [bigint, bigint][] { |
| 413 | const invUnit: [bigint, bigint] = [unit[0], -unit[1]]; |
| 414 | const all: [bigint, bigint][] = []; |
| 415 | for (const cls of classes) { |
| 416 | all.push(cls); |
| 417 | let pos = cls; |
| 418 | for (let t = 1n; t <= tRange; t++) { |
| 419 | pos = pellMul(pos, unit, D); |
| 420 | all.push(pos); |
| 421 | } |
| 422 | let neg = cls; |
| 423 | for (let t = 1n; t <= tRange; t++) { |
| 424 | neg = pellMul(neg, invUnit, D); |
| 425 | all.push(neg); |
| 426 | } |
| 427 | } |
| 428 | const withNegation = all.concat(all.map(([x, y]) => [-x, -y] as [bigint, bigint])); |
| 429 | return dedupePairsLocal(withNegation).filter( |
| 430 | ([x, y]) => x <= bound && x >= -bound && y <= bound && y >= -bound |
| 431 | ); |
| 432 | } |
| 433 | |
| 434 | /** |
| 435 | * Cross-checks a `'family'` `solvePell` result against the independent |
no test coverage detected