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

logbeta is type-unstable #331

Closed
stevengj opened this issue Jul 2, 2021 · 0 comments · Fixed by #332
Closed

logbeta is type-unstable #331

stevengj opened this issue Jul 2, 2021 · 0 comments · Fixed by #332

Comments

@stevengj
Copy link
Member

stevengj commented Jul 2, 2021

julia> @code_warntype logbeta(0.2, 0.3)
Variables
  #self#::Core.Const(SpecialFunctions.logbeta)
  a::Float64
  b::Float64
  @_4::Int64
  sign::Union{Int32, Int64}
  lab::Union{Float64, Int32, Int64}

Body::Union{Float64, Int32, Int64}
1%1  = SpecialFunctions.logabsbeta(a, b)::Tuple{Union{Float64, Int32, Int64}, Union{Int32, Int64}}%2  = Base.indexed_iterate(%1, 1)::Core.PartialStruct(Tuple{Union{Float64, Int32, Int64}, Int64}, Any[Union{Float64, Int32, Int64}, Core.Const(2)])
│         (lab = Core.getfield(%2, 1))
│         (@_4 = Core.getfield(%2, 2))
│   %5  = Base.indexed_iterate(%1, 2, @_4::Core.Const(2))::Core.PartialStruct(Tuple{Union{Int32, Int64}, Int64}, Any[Union{Int32, Int64}, Core.Const(3)])
│         (sign = Core.getfield(%5, 1))
│   %7  = (sign < 0)::Bool
└──       goto #3 if not %7
2%9  = Core.tuple(a, b)::Tuple{Float64, Float64}%10 = SpecialFunctions.DomainError(%9, "`beta(a, b)` must be non-negative")::Any
└──       SpecialFunctions.throw(%10)
3return lab
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 a pull request may close this issue.

1 participant