2 unstable releases
new 0.2.0 | Feb 11, 2025 |
---|---|
0.1.0 | Jan 22, 2025 |
#337 in Math
121 downloads per month
33KB
742 lines
PEMEL
Overview
pemel
is a Rust library providing a utilities for parsing and evaluating mathematical expressions.
Features
- Basic arithmetic operations
- Trigonometric functions
- Exponential and logarithmic functions
- Absolute value function
- Evaluation with multiple variables
- Numeric derivatives
- Implicit evaluation during parsing
Usage
Here is a simple example of how to use pemel
:
use pemel::prelude::*;
fn main() {
let input = "2 * x^2 - 5 * log(x)";
let expr = Expr::parse(input).unwrap();
let result = expr.eval_with_variable("x", 10.0).unwrap();
println!("{}", result); // Output: 195.0
}
Contributing
Untill I create a CONTRIBUTING.md
file, I will not accept any pull requests.
License
This project is licensed under the MIT License. See the LICENSE file for details.