Skip to content

Add Kahan summation overloads to Std::Math#60

Open
its-mohitkumar-7 wants to merge 1 commit into
rux-lang:devfrom
its-mohitkumar-7:feature/add-kahan-summation-function
Open

Add Kahan summation overloads to Std::Math#60
its-mohitkumar-7 wants to merge 1 commit into
rux-lang:devfrom
its-mohitkumar-7:feature/add-kahan-summation-function

Conversation

@its-mohitkumar-7

Copy link
Copy Markdown

Summary

This pull request adds two overloads of KahanSum to Std::Math:

  • KahanSum(float64...) -> float64
  • KahanSum(float32...) -> float32

These functions implement the Kahan summation algorithm (compensated summation) to reduce floating-point error accumulation when summing multiple values.

Notes

Full automated verification was not possible at this time because some math utility functionality (such as complete absolute-difference helpers) is still under development in the standard library. Additional validation and unit tests can be expanded once those utilities are available.

The implementation itself was manually verified against expected numerical results for a variety of floating-point edge cases.

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