pub enum SymExpr {
Const(f64),
Var(String),
Add(Box<SymExpr>, Box<SymExpr>),
Mul(Box<SymExpr>, Box<SymExpr>),
Pow(Box<SymExpr>, f64),
Sin(Box<SymExpr>),
Cos(Box<SymExpr>),
Exp(Box<SymExpr>),
Ln(Box<SymExpr>),
Neg(Box<SymExpr>),
}Expand description
Symbolic expression representation for automatic symbolic differentiation.
These are value-level symbolic expressions that can be differentiated symbolically before evaluation. This provides exact derivatives without numerical error.
Variants§
Const(f64)
Constant value
Var(String)
Variable reference (by name)
Add(Box<SymExpr>, Box<SymExpr>)
Addition
Mul(Box<SymExpr>, Box<SymExpr>)
Multiplication
Pow(Box<SymExpr>, f64)
Power: base^exponent (exponent is a constant)
Sin(Box<SymExpr>)
Sine
Cos(Box<SymExpr>)
Cosine
Exp(Box<SymExpr>)
Exponential
Ln(Box<SymExpr>)
Natural logarithm
Neg(Box<SymExpr>)
Negation
Implementations§
Trait Implementations§
impl StructuralPartialEq for SymExpr
Auto Trait Implementations§
impl Freeze for SymExpr
impl RefUnwindSafe for SymExpr
impl Send for SymExpr
impl Sync for SymExpr
impl Unpin for SymExpr
impl UnsafeUnpin for SymExpr
impl UnwindSafe for SymExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more