Function smartnoise_runtime::utilities::noise::apply_snapping_noise[][src]

pub fn apply_snapping_noise(
    value: f64,
    epsilon: f64,
    b: f64,
    enforce_constant_time: bool
) -> Result<(f64, f64)>

Apply noise to value according to the Snapping mechanism. Sensitivity is assumed to be 1 in L1 space.

Arguments

Returns

Value of statistic with noise applied according to the Snapping mechanism.

Example

use smartnoise_runtime::utilities::noise::apply_snapping_noise;
let value: f64 = 50.0;
let epsilon: f64 = 1.0;
let b: f64 = 100.0;
let value = apply_snapping_noise(value, epsilon, b, false);
println!("snapped value: {:?}", value.unwrap());