(z: number)
| 44 | |
| 45 | const GAMMA_OVERFLOW_THRESHOLD = 171.6243769563027; |
| 46 | |
| 47 | function gammaLanczos(z: number): number { |
| 48 | z -= 1; |
| 49 | let x = lanczos_7_c[0]; |
| 50 | for (let i = 1; i < gammaG + 2; i++) x += lanczos_7_c[i] / (z + i); |
| 51 | |
| 52 | const t = z + gammaG + 0.5; |
| 53 | return Math.sqrt(2 * Math.PI) * Math.pow(t, z + 0.5) * Math.exp(-t) * x; |
| 54 | } |
| 55 | |
| 56 | function gammaBalancedProduct(start: number, count: number): number { |
| 57 | if (count <= 0) return 1; |
| 58 | if (count === 1) return start; |
| 59 | |
| 60 | const leftCount = count >>> 1; |
no test coverage detected