1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! JIT-compiled mathematical expression evaluator with automatic differentiation.
//!
//! This crate provides JIT compilation and automatic differentiation for mathematical expressions.
//! It parses expressions using [evalexpr](https://github.com/ISibboI/evalexpr) and compiles them to
//! native machine code using [Cranelift](https://github.com/bytecodealliance/wasmtime/tree/main/cranelift).
//!
//! # Features
//!
//! - Fast evaluation through JIT compilation to native code
//! - Automatic differentiation for gradients and Hessians
//! - Support for variables, constants, and mathematical functions
//! - Safe Rust implementation with comprehensive error handling
//!
//! # Example
//!
//! ```rust
//! use evalexpr_jit::Equation;
//!
//! // Create and compile an equation
//! let eq = Equation::new("2*x + y^2".to_string()).unwrap();
//!
//! // Evaluate at point (x=1, y=2)
//! let result = eq.eval(&vec![1.0, 2.0]).unwrap(); // Returns 6.0
//!
//! // Compute gradient [∂/∂x, ∂/∂y]
//! let gradient = eq.gradient(&vec![1.0, 2.0]).unwrap(); // Returns [2.0, 4.0]
//! ```
pub use Equation;
pub use Expr;
pub use EquationSystem;
/// JIT compilation functionality using Cranelift
/// Conversion from evalexpr AST to internal expression format
/// High-level equation handling and evaluation
/// Error types for parsing, compilation and evaluation
/// Expression tree representation and symbolic differentiation
/// System of multiple equations
/// Functions for linking external mathematical operations
pub
/// Type definitions for JIT-compiled functions
/// Backends for vector operations