0.35.0
🚀 Performance Improvements
Computation Optimizations
- Enhanced streaming mean calculation using FMA (Fused Multiply-Add) CPU instruction in hot
add()sampling function for improved numerical accuracy and performance - Optimized variance calculation with FMA operations for better precision in statistical computations
✨ Features
Mathematical Accuracy Improvements
- Fixed
geometric_mean()to correctly return NaN when the series contains negative values, improving mathematical correctness - Reordered geometric mean validation logic for better performance and clearer code flow
- Added comprehensive test coverage for edge cases with zero and negative values in mean calculations
🔧 Code Quality & Maintenance
Code Cleanup
- Fixed Clippy warnings:
clippy::if_same_then_else: Eliminated redundant conditional branches for cleaner codeclippy::explicit_auto_deref: Removed unnecessary explicit dereferencing for improved readability
- Enhanced code consistency and maintainability across the codebase
Test Coverage Enhancements
- Added new test
test_means_with_zero_and_negative_values()to validate correct behavior of all mean types with edge case inputs:- Arithmetic mean calculation with mixed positive/negative values and zero
- Geometric mean returning NaN for negative values
- Harmonic mean returning NaN for zero values
📊 What's Changed
This release focuses on mathematical accuracy improvements and performance optimizations while maintaining full API compatibility. The key enhancements include:
- Mathematical Correctness: Fixed geometric mean behavior with negative values to comply with mathematical standards
- Performance Boost: Strategic use of FMA instructions in critical computation paths for better numerical precision and speed
- Code Quality: Continued adherence to Rust best practices through Clippy warning resolution
- Robustness: Enhanced test coverage for edge cases ensures reliability across diverse datasets
The FMA optimizations in the streaming mean calculation and the geometric mean fixes should provide both better performance and more accurate results when processing datasets with challenging numerical characteristics.
Full Changelog: 0.34.0...0.35.0