Skip to content

Commit

Permalink
define randnormal(u1::UInt64,u2::UInt64,::Type{Float32})
Browse files Browse the repository at this point in the history
  • Loading branch information
chriselrod committed Sep 28, 2022
1 parent 71a6435 commit 46d8e5a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/api.jl
Original file line number Diff line number Diff line change
@@ -95,6 +95,11 @@ end
r = sqrt(nlog01(u2, Float64))
s*r, c*r
end
@inline function randnormal(u1::UInt64, u2::UInt64, ::Type{Float32})
s, c = randsincos(Vec(u1), Float32)
r = sqrt(nlog01(Vec(u2), Float32))
shufflevector(s*r, Val((0,1))), shufflevector(c*r, Val((0,1)))
end

@generated function random_normal(vu::VecUnroll{Nm1,W,UInt64,Vec{W,UInt64}}, ::Type{T}) where {Nm1,W,T}
# @assert isodd(Nm1)

2 comments on commit 46d8e5a

@chriselrod
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/69146

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.2.19 -m "<description of version>" 46d8e5a6cb231846661d71d36bed51c0b4ac4b06
git push origin v0.2.19

Please sign in to comment.