Skip to content

v0.4.0: Add accuracy measurements to readme#3

Merged
GeEom merged 1 commit intomainfrom
accuracy_reporting
Jan 11, 2026
Merged

v0.4.0: Add accuracy measurements to readme#3
GeEom merged 1 commit intomainfrom
accuracy_reporting

Conversation

@GeEom
Copy link
Owner

@GeEom GeEom commented Jan 11, 2026

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, so NonNegative::one_plus_square(x) is infallible.

Internal API Additions:

  • sqrt_nonneg(NonNegative<T>): Infallible sqrt for proven non-negative inputs
  • atanh_open(OpenUnitInterval<T>): Infallible atanh for proven (-1, 1) inputs
  • CordicNumber::total_bits(): New trait method

Lint Configuration Overhaul:

  • 30+ explicit clippy denies replacing priority-based groups
  • All #[allow(...)] now require reason = "..." attribute
  • Removed expect_used allows by using bounded types instead

Accuracy & Documentation:

  • Auto-generated accuracy table in README showing mean/median/p95 relative error
  • All 20 functions benchmarked against MPFR for I16F16 and I32F32

Other Improvements:

  • CORDIC hyperbolic vectoring uses clamp(24, 54) minimum iterations
  • Simplified exp() argument reduction using bit shifts
  • Version bump to 0.4.0

@codecov-commenter
Copy link

codecov-commenter commented Jan 11, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 89.62264% with 11 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/bounded.rs 84.61% 6 Missing ⚠️
src/kernel/cordic.rs 50.00% 3 Missing ⚠️
src/ops/exponential.rs 96.55% 1 Missing ⚠️
src/ops/hyperbolic.rs 94.73% 1 Missing ⚠️

📢 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>
@GeEom GeEom force-pushed the accuracy_reporting branch from 21df913 to 146b7af Compare January 11, 2026 11:01
@GeEom GeEom merged commit a309443 into main Jan 11, 2026
11 checks passed
@GeEom GeEom deleted the accuracy_reporting branch January 11, 2026 11:04
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.

2 participants