#approximation #float #numerical #compression

hybrid_phi

High-accuracy φ-based hybrid approximation method

1 stable release

1.0.0 May 5, 2025
0.1.2 May 4, 2025
0.1.1 May 4, 2025
0.1.0 May 4, 2025

#570 in Embedded development

Download history 313/week @ 2025-05-04 42/week @ 2025-05-11 1/week @ 2025-05-18 13/week @ 2025-07-06 1/week @ 2025-07-13

64 downloads per month

MIT license

22KB
408 lines

hybrid_phi

High-precision φ-based approximation and memory routing for signal processing, AI, and embedded systems.

hybrid_phi is a modular Rust library that provides accurate φ-based encoding, reversible approximation, quantized memory storage, routing, and exportable memory bundles.


✨ Features

  • Reversible φ-based approximation with sub-ε precision
  • Quantized signal memory with optional metadata
  • Similarity-based routing
  • Self-contained bundles (.json import/export)
  • CLI examples (phi_app.rs) for encoding, routing, listing, and more
  • No-alloc friendly core, minimal dependencies

📦 Installation

In your Cargo.toml:

[dependencies]
hybrid_phi = "1.0.0"

🔧 Basic Usage

use hybrid_phi::hybrid_phi_approximate;

let x = 123.456;
let approx = hybrid_phi_approximate(x, 10);

For inverse:

use hybrid_phi::hybrid_phi_inverse;

let recovered = hybrid_phi_inverse(approx, 10);

🧠 Signal Memory + Routing

Store and route signals:

use hybrid_phi::phi_fs::PhiMemoryStore;
use hybrid_phi::phi_router::phi_route;

let store = PhiMemoryStore::new(".phi_store");
store.save("pattern1", &[1.0, 2.0, 3.0])?;

let route = phi_route(&[1.0, 2.0, 3.0], &store, 0.9);

📤 Bundles and Export

use hybrid_phi::phi_bundle::PhiBundle;

let bundle = PhiBundle::from_store("signal", &store)?;
bundle.save_json("signal.json")?;

let loaded = PhiBundle::load_json("signal.json")?;
loaded.save_to_store(&store)?;

🚀 CLI Examples

Run from examples:

cargo run --example phi_app encode my_signal
cargo run --example phi_app route --input=1.0,2.0,3.0 --threshold=0.9
cargo run --example phi_app export my_signal --to=my_signal.json

📚 Documentation

Autogenerated API docs:

cargo doc --open

📅 Version

Current: 1.0.0
Generated: 2025-05-05T00:02:30.184504 UTC


🔐 License

Licensed under MIT.
For commercial licensing, contact: info@paxintrade.com


© 2025 Idan Kaminer — Creator and maintainer

Dependencies

~5.5–8MB
~145K SLoC