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

math functions to move to SpecialFunctions.jl #27459

Closed
StefanKarpinski opened this issue Jun 6, 2018 · 17 comments · Fixed by #27473
Closed

math functions to move to SpecialFunctions.jl #27459

StefanKarpinski opened this issue Jun 6, 2018 · 17 comments · Fixed by #27473
Labels
excision Removal of code from Base or the repository

Comments

@StefanKarpinski
Copy link
Sponsor Member

  • lgamma
  • gamma
  • lfact
  • beta
  • lbeta
@ViralBShah
Copy link
Member

Sounds good. Where should they go?

@StefanKarpinski StefanKarpinski changed the title math functions kick out of base math functions to kick out of base Jun 6, 2018
@JeffBezanson
Copy link
Sponsor Member

SpecialFunctions.jl?

@JeffBezanson JeffBezanson added the excision Removal of code from Base or the repository label Jun 6, 2018
@StefanKarpinski
Copy link
Sponsor Member Author

[l]gamma and [l]beta should likely go in https://github.com/JuliaMath/SpecialFunctions.jl with the rest of the *gamma functions. lfact should probably be called lfactorial and live there as well, largely because it's implemented in terms of the lgamma function.

@StefanKarpinski StefanKarpinski changed the title math functions to kick out of base math functions to move to SpecialFunctions.jl Jun 6, 2018
@StefanKarpinski StefanKarpinski added the triage This should be discussed on a triage call label Jun 6, 2018
@dpsanders
Copy link
Contributor

Or better loggamma, logfactorial etc.

@StefanKarpinski
Copy link
Sponsor Member Author

The lfunction convention is pretty standard but sure. We could also do log(gamma)(x)... not entirely sure if :trollface:ing or not...

@dpsanders
Copy link
Contributor

log(gamma) is a neat idea.

@alanedelman
Copy link
Contributor

+1 on log(gamma)

@freeboson
Copy link
Contributor

FWIW, they're called lbeta, lgamma in R and Tensorflow

@StefanKarpinski
Copy link
Sponsor Member Author

I do think that lbeta, lgamma, lfactorial and lbinomial are fine names.

@ararslan
Copy link
Member

ararslan commented Jun 7, 2018

log(gamma) is a fun idea in theory but you then lose the ability to sensibly overload lgamma, since log(gamma) would then return an anonymous function.

@andreasnoack
Copy link
Member

It doesn't have to be anonymous. You could have Base.log(::typeof(gamma)) = lgamma

@ararslan
Copy link
Member

ararslan commented Jun 7, 2018

Then what's the point of having log(gamma) if you still have lgamma...

@andreasnoack
Copy link
Member

It looks better and lgamma doesn't need to be exported.

@martinholters
Copy link
Member

(log∘gamma) would be more sensible than log(gamma), but having this overload of would also be a very-hard-to-discover feature...

@StefanKarpinski
Copy link
Sponsor Member Author

Let's just stick with the more traditional names, i.e. lgamma, etc.

@pkofod
Copy link
Contributor

pkofod commented Jun 7, 2018

Speaking of lgamma, I have a port of openlibm's lgamma that can be used in SpecialFunctions.jl.

@simonbyrne
Copy link
Contributor

lgamma etc. are pretty much standard, and tend to be more useful then their non-log counterparts (since they're harder to overflow) so should have convenient names. In fact, the gamma in C originally gave the log version, which is why C has a tgamma ("true gamma") function

@JeffBezanson JeffBezanson removed the triage This should be discussed on a triage call label Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
excision Removal of code from Base or the repository
Projects
None yet
Development

Successfully merging a pull request may close this issue.