Skip to main content

Module eval

Module eval 

Source
Expand description

Expression evaluation with automatic differentiation

Evaluates postfix expressions and computes derivatives using forward-mode AD.

§Performance

For hot loops (generation, Newton-Raphson), use evaluate_with_workspace() with a reusable EvalWorkspace to avoid heap allocations on every call.

Modules§

constants
Mathematical constants

Structs§

EvalContext
Explicit evaluation context for a single run.
EvalResult
Result of evaluating an expression
EvalWorkspace
Reusable workspace for expression evaluation.

Enums§

EvalError
Evaluation error types

Constants§

DEFAULT_TRIG_ARGUMENT_SCALE
Default trig argument scale used by sinpi/cospi/tanpi.

Functions§

evaluate
Evaluate an expression at a given value of x.
evaluate_fast
Evaluate an expression using a thread-local workspace (zero allocations after warmup).
evaluate_fast_with_constants
Evaluate an expression using a thread-local workspace with user constants.
evaluate_fast_with_constants_and_functions
Evaluate an expression using a thread-local workspace with user constants and user functions.
evaluate_fast_with_context
Evaluate an expression using a thread-local workspace and explicit context.
evaluate_with_constants
Evaluate an expression at a given value of x with user constants.
evaluate_with_constants_and_functions
Evaluate an expression at a given value of x with user constants and user functions.
evaluate_with_context
Evaluate an expression at a given value of x with an explicit evaluation context.
evaluate_with_workspace
Evaluate an expression at a given value of x, using a reusable workspace.
evaluate_with_workspace_and_constants
Evaluate an expression with user constants, using a reusable workspace.
evaluate_with_workspace_and_constants_and_functions
Evaluate an expression with user constants and user functions, using a reusable workspace.
evaluate_with_workspace_and_context
Evaluate an expression using an explicit evaluation context and reusable workspace.