eval_complex_expr

Function eval_complex_expr 

Source
pub fn eval_complex_expr(
    expr: &Expr,
    vars: &HashMap<String, Complex<f64>>,
) -> Result<Complex<f64>, String>
Expand description

Evaluates a symbolic expression to a numerical Complex<f64> value.

This function recursively traverses the expression tree and computes the complex numerical value. It handles basic arithmetic, trigonometric, exponential, and logarithmic functions for complex numbers.

§Arguments

  • expr - The expression to evaluate.
  • vars - A HashMap containing the numerical Complex<f64> values for the variables in the expression.

§Returns

A Result containing the complex numerical value if the evaluation is successful, otherwise an error string.