pub fn sort_with_indices(data: &[f64]) -> (Vec<f64>, Vec<usize>)
Sort with indices: returns (sorted_data, original_indices)