3 unstable releases

0.2.1 Mar 8, 2025
0.2.0 Feb 11, 2025
0.1.0 Jan 22, 2025

#603 in Math

Download history 109/week @ 2025-01-20 7/week @ 2025-01-27 7/week @ 2025-02-03 111/week @ 2025-02-10 12/week @ 2025-02-17 5/week @ 2025-02-24 107/week @ 2025-03-03 37/week @ 2025-03-10 4/week @ 2025-03-17

149 downloads per month

MIT license

36KB
816 lines

PEMEL

Crates.io License

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
  • Substitution

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, true).unwrap();
    let result = expr.eval_with_var("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.

No runtime deps