#![crate_type = "bin"] #![crate_name = "derive_test"] extern crate expr; use expr::Expr; fn main() { let expr = Expr::add(vec![Expr::var(10, 5), Expr::var(7, 3), Expr::var(4, 1), Expr::num(4)]); println!("{}", expr); println!("{}\n", expr.derive().simplify()); let expr = Expr::exp(Expr::add(vec![Expr::var(2, 1), Expr::num(3)]), 5); println!("{}", expr); println!("{}\n", expr.derive().simplify()); let expr = Expr::exp(Expr::add(vec![Expr::var(1, 3), Expr::var(2, 2), Expr::var(-1, -2)]), -7); println!("{}", expr); println!("{}\n", expr.derive().simplify()); }