[][src]Function concrete_lib::operators::math::random::openssl_float_normal_couple

pub fn openssl_float_normal_couple(mean: f64, std_dev: f64) -> (f64, f64)

Returns a Torus element with normal random using a CSPRNG and Box-Muller algorithm

Arguments

  • mean - mean of the normal distribution
  • std_dev - standard deviation of the normal distribution

Output

  • returns the Torus element sampled from the desired distribution

Example

use concrete_lib::operators::math::random;

// settings
let std_dev: f64 = f64::powi(2., -20);
let mean = 0.;

// draw random sample
let (r1, r2): (f64, f64) = random::openssl_float_normal_couple(mean, std_dev);