rekka / meval-rs

Math expression parser and evaluation library for Rust
The Unlicense
153 stars 30 forks source link

Consider adding inverse functions #10

Closed Limeth closed 8 years ago

Limeth commented 8 years ago

Having a way to get the inverse function, if it exists, would be great.

let expr = meval::Expr::from_str("3 / (1 - x)").unwrap();
let func = expr.bind("x").unwrap();
let inverse_func = /* magic */;

assert_eq!(10, inverse_func(func(10)));

Feel free to close this issue if you think it's unrelated to the aim of the create.

rekka commented 8 years ago

Thanks for the suggestion. Unfortunately, this is very much out of scope of this crate. In general, computing an inverse function is a very complicated problem, and there are powerful tools like Sage, Mathematica and Maple that are designed for this. This crate is just meant to evaluate simple functions.