Commit c9ff360
authored
Expand the minimax Temme series in 1/a rather than z (#534)
* Expand the minimax Temme series in 1/a, not z
gamma_inc_minimax evaluates the |1 - x/a| <= 1e-3 branch of
T(a,lambda) = sum_k c_k(z) a^-k
with @evalpoly(z, c0, ..., d80). The outer sum is in a^-k, as the
function's own docstring states and as the other three code paths
built from the same d tables already do: the rational branch ten lines
below uses @evalpoly(1.0/a, ...), gamma_inc_temme uses @evalpoly(1.0/a, ...)
and gamma_inc_temme_1 uses @evalpoly(u, ...) with u = 1.0/a.
In the affected band |z| is 2-5% of 1/a, so every correction term past
c0 is weighted 20-40x too small. Over 300 points with a in [25, 1.2e6]
the worst relative error drops from 1.16e-5 to 8.2e-14; afterwards it
sits at or below the 1-ulp conditioning limit of x. No point regresses,
and every other branch is bit-identical.
The band was covered by exactly one existing assertion, gamma_inc(1e7,
1e7 + 1), where |z| and 1/a happen to coincide to 1e-7 and the defect
cancels. The new testset pins 16 points across the band against mpmath.
* Bump version to 2.8.11 parent 02a51af commit c9ff360
3 files changed
Lines changed: 29 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
582 | | - | |
| 582 | + | |
583 | 583 | | |
584 | 584 | | |
585 | 585 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
60 | 87 | | |
61 | 88 | | |
62 | 89 | | |
| |||
0 commit comments