Conversation
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Introduce bounded types (NonNegative, UnitInterval, etc.) to encode mathematical invariants at the type level, eliminating expect/unwrap in favor of compile-time guarantees. Add comprehensive clippy denies and auto-generated accuracy table in README. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
21df913 to
146b7af
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Type-safe bounded types, stricter lints, and accuracy reporting
New Bounded Types Module:
NonNegative<T>: Values ≥ 0 (sqrt inputs)UnitInterval<T>: Values in [-1, 1] (asin/acos inputs)OpenUnitInterval<T>: Values in (-1, 1) (atanh inputs)AtLeastOne<T>: Values ≥ 1 (acosh inputs)NormalizedLnArg<T>: Values in [0.5, 2] (ln normalization)These types encode mathematical invariants at the type level, replacing
expect()/unwrap()with compile-time proofs. For example,1 + x²is always non-negative, soNonNegative::one_plus_square(x)is infallible.Internal API Additions:
sqrt_nonneg(NonNegative<T>): Infallible sqrt for proven non-negative inputsatanh_open(OpenUnitInterval<T>): Infallible atanh for proven (-1, 1) inputsCordicNumber::total_bits(): New trait methodLint Configuration Overhaul:
#[allow(...)]now requirereason = "..."attributeexpect_usedallows by using bounded types insteadAccuracy & Documentation:
Other Improvements:
clamp(24, 54)minimum iterationsexp()argument reduction using bit shifts