MCPcopy Create free account
hub / github.com/Rust-GPU/rust-cuda / normal_f32_2

Method normal_f32_2

crates/gpu_rand/src/gpurng.rs:52–60  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

50 }
51
52 fn normal_f32_2(&mut self) -> [f32; 2] {
53 let u1 = self.uniform_f32();
54 let u2 = self.uniform_f32();
55
56 [
57 (-2.0 * u1.ln()).sqrt() * ((f32::consts::PI * 2.0) * u2).cos(),
58 (-2.0 * u1.ln()).sqrt() * ((f32::consts::PI * 2.0) * u2).sin(),
59 ]
60 }
61
62 fn normal_f64_2(&mut self) -> [f64; 2] {
63 let u1 = self.uniform_f64();

Callers 4

__raygen__renderFunction · 0.80
renderFunction · 0.80
random_unit_vecFunction · 0.80
renderMethod · 0.80

Calls 5

uniform_f32Method · 0.80
sqrtMethod · 0.80
lnMethod · 0.80
cosMethod · 0.80
sinMethod · 0.80

Tested by

no test coverage detected