# Changelog

All notable changes to this project will be documented in this file.

## [0.5.4] - 2024-12-19

### Fixed
- **Cashflow Combination**: Fixed issue where finalValue and last intermediate cashflow on the same date were treated as separate cashflows, causing IRR calculation problems. Now they are automatically combined before IRR calculation.

### Improved
- **Test Coverage**: Added comprehensive tests to ensure cashflows on the same date are properly combined

## [0.5.3] - 2024-12-19

### Improved
- **IRR Convergence Check**: Enhanced convergence criteria to require both step size AND NPV to be within tolerance, ensuring more accurate results
- **Fallback Trigger**: Added automatic fallback to Bisection method when step size is small but NPV is still large (> tolerance * 1000)
- **Test Coverage**: Added 58+ comprehensive tests for Newton-Raphson convergence and fallback scenarios
- **Performance Tests**: Improved error messages for performance threshold violations with detailed diagnostic information

### Fixed
- **Convergence Accuracy**: Fixed issue where Newton-Raphson could converge based only on step size without verifying NPV ≈ 0

## [0.5.2] - 2024-12-19

### Improved
- **IRR Calculation**: Refactored IRR calculation functions into separate modules under `utils/irr/`
- **Numerical Stability**: Enhanced IRR calculation with Damped Newton-Raphson method and Bisection fallback for better handling of edge cases
- **Test Coverage**: Added comprehensive unit tests for each IRR function with 102+ test cases
- **Robustness**: Improved handling of complex cash flow patterns and cases with very small NPV derivatives

## [0.5.1] - 2024-12-19

### Improved
- **IRR Calculation**: Refactored IRR calculation functions into separate modules under `utils/irr/`
- **Numerical Stability**: Enhanced IRR calculation with Damped Newton-Raphson method and Bisection fallback for better handling of edge cases
- **Test Coverage**: Added comprehensive unit tests for each IRR function with 102+ test cases
- **Robustness**: Improved handling of complex cash flow patterns and cases with very small NPV derivatives

