Skip to main content

std_dev_vec

Function std_dev_vec 

Source
pub fn std_dev_vec(input: &[f32]) -> f32
Expand description

SIMD-optimized standard deviation of a vector

Computes the population standard deviation as the square root of the variance.

§Arguments

  • input - Input vector (must not be empty)

§Returns

The standard deviation as a single f32 value

§Panics

Panics if the input vector is empty

§Examples

use sklears_simd::vector::statistics_ops::std_dev_vec;

let input = vec![1.0, 2.0, 3.0, 4.0, 5.0];
let result = std_dev_vec(&input);
assert!((result - 1.41421356).abs() < 1e-6); // sqrt(2) ≈ 1.41421356