Repository navigation
Conversation
…/cauchy/cdf` `0.5 + atan(z)/pi` cancels below the median: `cdf( -1e16, 0, 1 )` returned 0 (about 3.18e-17) and `cdf( -1e8, 0, 1 )` had 8 correct digits. Below `z = -1` use the equivalent `atan2( gamma, x0-x )/pi`; nearer the median the sum doesn't cancel and stays as it was. Fixtures are now evaluated in 2048-bit BigFloat (the Float64 references were up to 12,729 ULP off), with a new far-left-tail fixture.
|
Hello! Thank you for your contribution to stdlib. We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:
This acknowledgment confirms that you've read the guidelines, which include:
We can't review or accept contributions without this acknowledgment. Thank you for your understanding and cooperation. We look forward to reviewing your contribution! |
1 similar comment
|
Hello! Thank you for your contribution to stdlib. We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:
This acknowledgment confirms that you've read the guidelines, which include:
We can't review or accept contributions without this acknowledgment. Thank you for your understanding and cooperation. We look forward to reviewing your contribution! |
Coverage Report
The above coverage report was generated for the changes in this PR. |
Description
This pull request:
stats/base/dists/cauchy/cdfwithout cancellation (JS, factory and C).0.5 + atan(z)/picancels below the median, so the CDF loses digits steadily and reaches0from aboutx = x0 - 1e16*gamma:Below
z = -1it uses the identity0.5 + atan(z)/pi = atan2( gamma, x0-x )/pi, which has no subtraction. Above that the sum doesn't cancel. I first applied the identity everywhere left of the median, but near the median it's less accurate than the sum (atan2is close topi/2there and picks up the rounding of1/pi), so it's gated atz = -1.Fixtures. They came from Distributions.jl's
Float64cdf, which uses the same formula. Against the regenerated 2048-bitBigFloatreference,developis up to 12,729 ULP off on the existing fixtures and this PR is within 3. Point by point, this PR is closer to the exact value on 1,867 of the 2,000negative_medianandpositive_medianpoints, and further on 37, by at most an ULP.gennow evaluates inBigFloat(as in #15772 and #15966); all three fixtures were regenerated, plus a newleft_tail.json. Tolerances are unchanged, and the new blocks use 2 ULP.test.cdf.js/test.factory.js/test.native.jspass 4,014 / 4,018 / 4,014.Same fix as #15966 for
cauchy/logcdf.Related Issues
None. Related to #15966 (
cauchy/logcdf).Questions