sophi

Crates.iosophi
lib.rssophi
version0.1.21
created_at2025-04-18 19:15:20.271275+00
updated_at2025-05-26 17:32:11.439308+00
descriptionMath Physics library in rust
homepagehttps://github.com/reinanbr/sophi
repositoryhttps://github.com/reinanbr/sophi
max_upload_size
id1639793
size5,932
Reinan Bezerra (reinanbr)

documentation

README

sophi

sophi is a lightweight, efficient, and extensible math library written in pure Rust.
It provides mathematical functions, numerical methods, and number utilities for scientific computing, educational tools, or general-purpose applications.

✨ Features

  • ✅ Mathematical functions (e.g., exponential)
  • ✅ Numerical methods (e.g., Newton-Raphson root finder)
  • ✅ Number utilities and base operations
  • ✅ Written in safe, idiomatic Rust
  • ✅ Modular and easy to extend

📦 Installation

Add sophi as a dependency in your Cargo.toml:

[dependencies]
sophi = { path = "./sophi" }

(Published version coming soon)

🚀 Usage Example

Newton-Raphson Method

use sophi::methods::raphson::raphson;

fn main() {
    let f = |x: f64| x * x - 2.0;       // Function: x^2 - 2
    let df = |x: f64| 2.0 * x;          // Derivative: 2x

    let root = raphson(1.0, f, df, 1e-10, 100);
    println!("Root approximation: {}", root);
}

Exponential Function

use sophi::functions::exp::exp;

fn main() {
    let result = exp(1.0);
    println!("exp(1) ≈ {}", result); // Should be close to 2.71828...
}

📂 Project Structure

sophi
├── Cargo.toml
├── README.md
└── src
    ├── base          // Number utilities
    ├── functions     // Mathematical functions
    ├── methods       // Numerical methods
    └── lib.rs

🔧 Roadmap

  • Add more numerical methods (e.g., integration, interpolation)
  • Implement linear algebra operations
  • Add probability and statistics functions
  • Improve error handling (return Result instead of panic!)
  • Publish on crates.io

🤝 Contributions

Contributions are welcome! Feel free to open issues, suggest features, or submit pull requests.

📜 License

This project is licensed under the MIT License.


Made with ❤️ in Rust.

Commit count: 39

cargo fmt