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

Method normal_f32

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

Source from the content-addressed store, hash-verified

36 }
37
38 fn normal_f32(&mut self) -> f32 {
39 let u1 = self.uniform_f32();
40 let u2 = self.uniform_f32();
41
42 (-2.0 * u1.ln()).sqrt() * ((f32::consts::PI * 2.0) * u2).cos()
43 }
44
45 fn normal_f64(&mut self) -> f64 {
46 let u1 = self.uniform_f64();

Callers 2

random_unit_vecFunction · 0.80
scatterMethod · 0.80

Calls 4

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

Tested by

no test coverage detected