Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Special functions and amos #1466

Merged
merged 10 commits into from
Nov 1, 2012
Merged

RFC: Special functions and amos #1466

merged 10 commits into from
Nov 1, 2012

Conversation

ViralBShah
Copy link
Member

This moves special functions to base/math.jl. It also removes the amos library from the julia sources, and instead uses it from openlibm.

Remove amos library and update the amos license.
Move extras/specfun.jl into base/math.jl, and move the location
of the documentation as well.
@johnmyleswhite
Copy link
Member

+1

This raises an issue I sometimes wonder about: how encompassing should base/math.jl become? And should there be a companion like extras/math2.jl?

As I'm revising [https://github.com/johnmyleswhite/julia/commit/897ba33f2b189ea7ad9f6e7804d4a1d5b3c8db8d] the Distributions module, I've needed to pull in the psigamma, digamma and trigamma functions, which are derivatives of the gamma function that is included in Viral's patch. Where would functions like that belong?

Having a central place for them seems very valuable, but having that place be base/math.jl seems less desirable.

@ViralBShah
Copy link
Member Author

That's a good question. Why would base/math.jl be less desirable? If there are a few more such functions, they can certainly go to base/math.jl.

@johnmyleswhite
Copy link
Member

My concern is that I just don't know how many more special functions are left. I only need about 7 more, which is totally reasonable. But would 100 more be ok?

@StefanKarpinski
Copy link
Member

I think that's a bridge we can cross when we get there. I suspect there aren't all that many more. Another approach would be to split them into smaller logical groups, but that could get annoying.

@ViralBShah
Copy link
Member Author

Let's start with the 7. We'll worry about the refactoring when more surface. :-)

@johnmyleswhite
Copy link
Member

Ok. Should I give you code for adding them now? Or I should wait until this gets merged and then look through what's missing to create an additional pull request?

@ViralBShah
Copy link
Member Author

I think it would be simplest for you to checkout the vs/amos branch, and commit your changes in there. It will show up in this pull request, and we can merge it when ready. It will also help test out the amos build related changes.

@johnmyleswhite
Copy link
Member

I've made changes to pull in the three missing gamma-related functions from Rmath. Unfortunately I didn't see how to get this to work without making it an essential library.

I'm pushing what I've done mostly for feedback. I have no idea if I'll have power tomorrow, so I don't response to comments, that's why.

@ViralBShah
Copy link
Member Author

I didn't realize that the functions you wanted are from Rmath. I am going to mull over this for a bit.

@JeffBezanson
Copy link
Member

Let's try to find other implementations from netlib. There is a lot of code there, such as http://www.netlib.org/slatec/fnlib/

@johnmyleswhite
Copy link
Member

Ok. I'll search through and try to find another implementation.

@johnmyleswhite
Copy link
Member

Jeff is right that Netlib has what we need in the cpsi.f function. Should I translate it over to Julia?

@ViralBShah
Copy link
Member Author

If it is not too much effort, it would be a good idea to translate to julia. Otherwise, I can add it to the build as part of openlibm.

@johnmyleswhite
Copy link
Member

Sorry for the delay. I've now implemented a simpler version of the digamma function in pure Julia. We'll eventually want to upgrade to the broader algorithm used by Rmath which includes the trigamma function and other derivatives of the gamma function, but it will take me a while to work through the Fortran code for that broader algorithm. This version is simple enough that I am confident in its correctness.

Resolve FC conflict for building openlibm.

Conflicts:
	deps/Makefile
@ViralBShah
Copy link
Member Author

@johnmyleswhite I am merging this in, and we can start a new pull request for trigamma and other derivatives of the gamma function. We also need tests for these.

ViralBShah added a commit that referenced this pull request Nov 1, 2012
RFC: Special functions and amos
@ViralBShah ViralBShah merged commit c4fe43e into master Nov 1, 2012
@johnmyleswhite
Copy link
Member

I've added tests for the digamma function. I will try to work on the other derivatives of the gamma function over the weekend.

vchuravy pushed a commit to JuliaPackaging/LazyArtifacts.jl that referenced this pull request Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants