Phase 2 review of PR #84 (src/trends.rs recursion logic) requested changes before merge.
Required changes:
- Major: spike/outlier split points are silently dropped (IEEE-754 simulation: spike series yields segments [0,24] + [26,49], index 25 missing), contradicting the PR's validation claim. Fix so the split index is preserved.
- Major: recursion depth is still O(n) worst-case (n=10k convex series -> depth ~4052); large inputs can overflow the stack. Convert to an explicit stack/iterative approach or add a depth guard.
- Minor: 2-element input with threshold=0.0 returns zero segments.
- Minor: no new regression tests; existing test only checks len >= 2. Add tests for the spike and deep-recursion cases.
Phase 2 review of PR #84 (src/trends.rs recursion logic) requested changes before merge.
Required changes: