CHANGELOG.md

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2025-07-21

### Added
- **Core Algorithm**: Fermat primality test implementation
  - Probabilistic testing with 100 random bases
  - Efficient modular exponentiation using square-and-multiply algorithm
  - Edge case handling for numbers 1 and 2
  - Integration with LehmerGcd for coprimality testing

- **Main Functions**:
  - `FermatPrimalityTest.of/1` - Main primality test function
  - `FermatPrimalityTest.mod_pow/3` - Modular exponentiation implementation

- **Documentation**:
  - Comprehensive module documentation with mathematical background
  - Detailed function documentation with examples
  - Type specifications (@spec) for better tooling support
  - Professional README with usage examples and algorithm explanations

- **Development Tools**:
  - Credo configuration for static analysis
  - Dialyzer setup for type checking
  - Spellweaver integration for documentation quality
  - ExDoc configuration with KaTeX math rendering
  - Comprehensive test suite

- **Project Structure**:
  - Apache 2.0 license
  - Professional README with installation and usage instructions
  - Development workflow with `mix check` alias
  - Package metadata for Hex.pm publishing
  - Initial project structure and setup
  - Comprehensive documentation with mathematical formulas
  - Quality assurance tooling (Credo, Dialyzer, Spellweaver)
  - KaTeX integration for mathematical formula rendering

### Technical Details

#### Algorithm Implementation
- **Fermat Primality Test**: Based on Fermat's Little Theorem
  - Time Complexity: $O(k \log n)$ where $k = 100$
  - Space Complexity: $O(1)$
  - Accuracy: No false negatives, extremely low false positive rate

- **Modular Exponentiation**: Square-and-multiply algorithm
  - Time Complexity: $O(\log exp)$
  - Space Complexity: $O(1)$
  - Handles edge cases (zero exponent, negative exponent)

#### Mathematical Foundation
- Implements Fermat's Little Theorem: $a^{p-1} \equiv 1 \pmod{p}$
- Uses contrapositive for composite number detection
- Handles Fermat pseudoprimes and Carmichael numbers
- Probabilistic approach with 100 random bases

#### Quality Assurance
- **Static Analysis**: Credo with custom rules
- **Type Checking**: Dialyzer with ignore file
- **Documentation**: ExDoc with KaTeX math rendering
- **Spell Checking**: Spellweaver with technical terms
- **Code Formatting**: Mix format integration

### Dependencies
- **Development**: ex_doc, dialyxir, credo, spellweaver, nstandard
- **Runtime**: nstandard (for LehmerGcd integration)

### Breaking Changes
None - This is the initial release.

### Deprecations
None - This is the initial release.

## Version History

### [1.0.0] - 2025-07-21 - Initial Release
- Complete Fermat primality test implementation
- Comprehensive documentation with mathematical formulas
- Professional development tooling and quality assurance
- Full project structure with license, README, and metadata

---

## Release Notes

### Version 1.0.0
This is the initial stable release of the Fermat Primality Test library. The implementation provides a robust, well-documented probabilistic primality test suitable for educational and research purposes.

**Key Features:**
- Efficient probabilistic primality testing
- Comprehensive mathematical documentation
- Professional development tooling
- Type-safe implementation with Dialyzer support

**Use Cases:**
- Educational demonstrations of Fermat's Little Theorem
- Research and experimentation with primality testing
- Learning probabilistic algorithms
- Mathematical library development

**Limitations:**
- Probabilistic nature (not deterministic)
- May have false positives for very large numbers
- Not suitable for cryptographic applications requiring deterministic tests

---

## Contributing

When adding new features or making changes, please update this changelog following the [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.

### Changelog Entry Format

```markdown
## [Version] - YYYY-MM-DD

### Added
- New features

### Changed
- Changes in existing functionality

### Deprecated
- Soon-to-be removed features

### Removed
- Removed features

### Fixed
- Bug fixes

### Security
- Vulnerability fixes
```