Repository navigation
Commit f633765
erfc far out on the right returns at once, and keeps its real part on the imaginary axis (#1609)
Number.Erfc worked out one working precision for both of its branches, with Re(z^2)/ln 10
digits over for the cancellation in 1 - erf(z). Only the series branch forms that difference.
Past the series' reach erfc is its asymptotic series, which cancels nothing, and the digits
still grew as Re(z^2): 4343 at 100, and 43430, the cap, at 1000. erfc(70) took 5.3 s,
erfc(100) over 20 s, and erfc(1000) did not return. Each is below what the default precision
represents, and answers 0.
The asymptotic branch now works at the guard digits alone, as the method's documentation
already said it did. erfc(70) takes 9 ms, erfc(100) 3 ms, erfc(1000) 3 ms.
No value changes. Fourteen arguments in the asymptotic branch, evaluated to 100 digits with
downcasting off, are identical to master's to the last digit. Three new rows agree with mpmath
at 200 digits to 40 digits, and mpmath gives the same values at 400. The new termination test
fails on master for erfc(1000) and erfc(1000 + i).
erfc(i y) is 1 - i erfi(y) exactly. Past the series' reach the asymptotic series gave erfc
directly, and it leaves the 1 out, below its precision beside erfi(y): erfc(20 i) came back with
a real part of 0. On the axis erfc is 1 - erf(z) instead, as erf already reads erf(i y) as
i erfi(y), and Cancelled adds nothing there.
Found comparing a double-precision erfc against the kernel for #1607. ErrorFunctionTest gains
erfc(20 i), against mpmath at 200 digits. It fails without this with "expected 1, got 0E-199".
Closes #1606.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 429ace7 commit f633765
2 files changed
Lines changed: 30 additions & 3 deletions
File tree
- Sources
- AngouriMath/Core/Entity/Continuous/Number
- Tests/UnitTests/Convenience
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | 82 | | |
84 | | - | |
85 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
86 | 91 | | |
87 | 92 | | |
| 93 | + | |
88 | 94 | | |
89 | 95 | | |
90 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
80 | 84 | | |
81 | 85 | | |
82 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
83 | 104 | | |
84 | 105 | | |
85 | 106 | | |
| |||
0 commit comments