Skip to content

refactor: simplify geometric_mean and remove duplicated logic#363

Open
sunlight7777777 wants to merge 2 commits intoAffineFoundation:mainfrom
sunlight7777777:refactor/geometric-mean-cleanup
Open

refactor: simplify geometric_mean and remove duplicated logic#363
sunlight7777777 wants to merge 2 commits intoAffineFoundation:mainfrom
sunlight7777777:refactor/geometric-mean-cleanup

Conversation

@sunlight7777777
Copy link
Copy Markdown

Changes
Extracted shared log-space computation into _safe_log_geometric_mean
Removed duplicated logic between epsilon and non-epsilon paths
Simplified function structure
Behavior

No functional changes — behavior is preserved.

Benefits
Cleaner code
Reduced duplication
Easier future modifications
Performance

Time complexity remains O(n) with no meaningful performance regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant