ENH: Add CDF and SF of the cosine distribution to XSF#198
Conversation
| // ts = mpmath.taylor(f, -mpmath.pi, 20) | ||
| // p, q = mpmath.pade(ts, 9, 10) | ||
| // | ||
| // (A python script with that code is in special/_precompute/cosine_cdf.py.) |
There was a problem hiding this comment.
Can we include this here as well?
There was a problem hiding this comment.
Scripts for generating reference values belong in xsref
There was a problem hiding this comment.
My impression was that xsref is for test cases. This little script is for generating coefficients that are used in the code. I don't think xsf has a place yet for storing code-generation code.
There was a problem hiding this comment.
Beyond test cases it also has test case generation scripts. I also wanted to add things like workflows to get minimax polynomials with remez exchange to what is now xsref. Beyond just test cases and test case generation I think it could be a home for the "meta-code" that goes into xsf. xsref is due for a namechange though and probably xsf too since I hope to expand the scope beyond special functions
There was a problem hiding this comment.
My impression was that xsref is for test cases. This little script is for generating coefficients that are used in the code. I don't think xsf has a place yet for storing code-generation code.
This is what I had in mind too and this is why I kept it from the original Cython file. @steppi what are you suggesting here? should we wait before moving those comments over to xsref or we do it now?
There was a problem hiding this comment.
Sorry for the noise. I thought you were all talking about adding the Python script to the xsf repo, not the comment. I'm on leave and don't have much availability now and trust you all to figure out what's best to do here
There was a problem hiding this comment.
Heh, well, I was thinking about adding the Python script that generates the coefficients to the xsf repo. That's where it makes the most sense to me (as opposed to xsref, which I have been seeing as a repo related to test data, including code that generates reference values for unit tests) . But as long as the code is somewhere--even in a comment--then it can be used again by future devs, and they don't have to wonder how the rational approximation was derived.
There was a problem hiding this comment.
I agree with @WarrenWeckesser here. The script that contains the generation of the coefficients belongs in the repo that contains the implementation. Can we agree on adding it here for the time being and potentially move it to xsfref once that is more mature? Otherwise, this PR is mergeable.
Reference issue
#170
Same pattern as #171
What does this implement/fix?
Additional information
AI Generation Disclosure
I used Codex to draft a first translation version.