Repository navigation
erfc far out on the right returns at once, and keeps its real part on the imaginary axis - #1609
Merged
Merged
Conversation
…ot carried with the digits 1 - erf(z) would cancel 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). Closes #1606. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…reach 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". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
erfc(70)took 5.3 s,erfc(100)over 20 s, anderfc(1000)did not return. Each is below what the default precision represents and answers 0.Number.Erfcworked out one working precision for both of its branches. It addedRe(z^2)/ln 10digits for the cancellation in1 - erf(z), which only the series branch forms. Past the series' reach, erfc is its asymptotic series, which cancels nothing, yet it was carried with those digits too: 4343 at 100, and at 1000 the cap of 43430. That branch now works at the guard digits alone, as the method's documentation already said.The same branch lost
erfc's real part on the imaginary axis, whereerfc(i y)is exactly1 - i erfi(y). The asymptotic series leaves the 1 out, below its precision besideerfi(y), soerfc(20i)came back with a real part of 0. On the axis it is now1 - erf(z), sinceerfalready readserf(i y)asi erfi(y). This turned up while comparing a double-precisionerfcagainst the kernel for #1607.Measured
erfc(70)erfc(100)erfc(1000)erfc(1000 + i)erfc(15.6)toerfc(100 + 99.5i), on both sides of the real line. All are identical to master's to the last digit.ErrorFunctionTestgains three rows in that branch,erfc(16),erfc(16 + 3i)anderfc(14 - 9i), which agree with mpmath at 200 digits to 40 digits. mpmath gives the same values at 400. It also gainserfc(20i), whose real part of 1 fails without the second commit ("expected 1, got 0E-199").erfc(1000)anderfc(1000 + i)within 30 s. On master both fail.erfc(100)is not a row: it finishes in about 25 s, inside the budget, so it would not bind.ErrorFunctionTeston 0f19463: 44 of 44.Closes #1606.
🤖 Generated with Claude Code