Skip to main content

eval_forward

Function eval_forward 

Source
pub fn eval_forward<T: Float>(op: OpCode, a: T, b: T) -> T
Available on crate feature bytecode only.
Expand description

Evaluate a single opcode in the forward direction.

Generic over T: Float so Phase 3 can call it with Dual<F>.

For binary ops, a and b are the two operand values. For unary ops, a is the operand value and b is ignored (except OpCode::Powi where b bits encode the i32 exponent).