diff --git a/journal/src/helpers.rs b/journal/src/helpers.rs index 367079a..d94ff19 100644 --- a/journal/src/helpers.rs +++ b/journal/src/helpers.rs @@ -1,25 +1,5 @@ use crate::types::{CustomUnitIngestionDose, StandardIngestionDose}; -pub fn calculate_standard_deviation( - expectation_x: f64, - standard_deviation_x: f64, - expectation_y: f64, - standard_deviation_y: f64, -) -> Option { - let sum_x = standard_deviation_x.powi(2) + expectation_x.powi(2); - let sum_y = standard_deviation_y.powi(2) + expectation_y.powi(2); - - let expectations = expectation_x.powi(2) * expectation_y.powi(2); - - let product_variance = (sum_x * sum_y) - expectations; - println!("{} {} {} {}", sum_x, sum_y, expectations, product_variance); - if product_variance > 0.0000001 { - Some((product_variance.sqrt() * 100.0).round() / 100.0) - } else { - None - } -} - pub fn calulate_custom_unit_ingestion_dose( dose: &CustomUnitIngestionDose, custom_unit_dose: &CustomUnitIngestionDose,