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

move [l]gamma, [l]beta and lfact from base #92

Merged
merged 2 commits into from
Jun 13, 2018

Conversation

fredrikekre
Copy link
Contributor

See #27473

src/gamma.jl Outdated
@@ -539,3 +539,228 @@ function polygamma(m::Integer, z::Number)
# There is nothing to fallback to, since this didn't work
polygamma(m, x)
end

@static if true # VERSION >= v"something"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.7.0-alpha.69

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will update this tonight

src/gamma.jl Outdated
return z
end

lgamma_r(x::BigFloat) = (lgamma(x), lgamma_signp[])
Copy link
Contributor

@vtjnash vtjnash Jun 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected version of this (from JuliaLang/julia#27331):

# log of absolute value of gamma function
function lgamma_r(x::BigFloat)
    z = BigFloat()
    lgamma_signp = Ref{Cint}()
    ccall((:mpfr_lgamma,:libmpfr), Cint, (Ref{BigFloat}, Ref{Cint}, Ref{BigFloat}, Int32), z, lgamma_signp, x, ROUNDING_MODE[])
    return z, lgamma_signp[]
end
 
lgamma(x::BigFloat) = lgamma_r(x)[1]

Commit message: "Switch to allocating lgamma_sign on the stack, for better performance (and thread-safety)"

@andreasnoack andreasnoack merged commit f3ee4e7 into JuliaMath:master Jun 13, 2018
@fredrikekre fredrikekre deleted the fe/gamma branch June 13, 2018 08:44
function gamma(x::BigFloat)
isnan(x) && return x
z = BigFloat()
ccall((:mpfr_lgamma, :libmpfr), Int32, (Ref{BigFloat}, Ref{BigFloat}, Int32), z, x, ROUNDING_MODE[])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in ccall target?

szcf-weiya added a commit to szcf-weiya/SpecialFunctions.jl that referenced this pull request Aug 26, 2018
`[l]gamma`, `[l]beta` and `lfact` have been moved to this module from `base` module (JuliaMath#92 ), but the docs have not been updated yet. I added their docs from [Docs for Julia v0.6.1](https://docs.julialang.org/en/v0.6.1/manual/mathematical-operations/#Special-functions-1).
simonbyrne pushed a commit that referenced this pull request Sep 13, 2018
* docs for `[l]gamma`, `[l]beta` and `lfact`

`[l]gamma`, `[l]beta` and `lfact` have been moved to this module from `base` module (#92 ), but the docs have not been updated yet. I added their docs from [Docs for Julia v0.6.1](https://docs.julialang.org/en/v0.6.1/manual/mathematical-operations/#Special-functions-1).

* Update index.md
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