hybrid_phi 0.1.0

High-accuracy φ-based hybrid approximation method
Documentation
  • Coverage
  • 75%
    3 out of 4 items documented0 out of 1 items with examples
  • Size
  • Source code size: 5.79 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 195.69 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 10s Average build duration of successful builds.
  • all releases: 39s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • andysay1
hybrid_phi-0.1.0 has been yanked.

README.md

hybrid_phi

High-accuracy numerical approximation using a φ-based hybrid method.

This Rust library provides a fast, compact and reversible approximation for real numbers using a precomputed exponential φ-basis and a smooth linear correction.

✨ Features

  • Machine-level precision (~1e-14)
  • Precomputed lookup table (φ[1..32])
  • Suitable for embedded/AI/quantized data
  • Simple implementation: 1 multiplication + 1 correction

📦 Usage

Add to your Cargo.toml:

[dependencies]
hybrid_phi = "0.1.0"

🔧 Example

use hybrid_phi::hybrid_phi_approximate;

fn main() {
    let x = 123.456;
    let approx = hybrid_phi_approximate(x, 10);
    println!("Approximated value: {}", approx);
}

📚 Algorithm

w ≈ a · φ(N) · (1 - r + r / √2)

Where:

  • φ(N) = ∑ j · exp(1 / (2j))
  • a = w / φ, r = w - aφ

🔐 License

MIT


© 2025 Idan Kaminer — author of the method and implementation.