pub struct ChainRule;Expand description
Chain rule implementation for function derivatives
Implementations§
Source§impl ChainRule
impl ChainRule
Sourcepub fn handle_function(
name: &str,
args: &[Expression],
variable: Symbol,
) -> Expression
pub fn handle_function( name: &str, args: &[Expression], variable: Symbol, ) -> Expression
Handle derivative of function expressions using chain rule
§Examples
use mathhook_core::simplify::Simplify;
use mathhook_core::{Expression, symbol};
use mathhook_core::calculus::derivatives::Derivative;
let x = symbol!(x);
let expr = Expression::function("sin", vec![Expression::symbol(x.clone())]);
let result = expr.derivative(x.clone());Sourcepub fn apply(
function_name: &str,
arg: &Expression,
variable: Symbol,
) -> Expression
pub fn apply( function_name: &str, arg: &Expression, variable: Symbol, ) -> Expression
Apply chain rule for function derivatives
§Examples
use mathhook_core::{Expression, symbol};
use mathhook_core::calculus::derivatives::ChainRule;
let x = symbol!(x);
let arg = Expression::pow(Expression::symbol(x.clone()), Expression::integer(2));
let result = ChainRule::apply("sin", &arg, x.clone());Auto Trait Implementations§
impl Freeze for ChainRule
impl RefUnwindSafe for ChainRule
impl Send for ChainRule
impl Sync for ChainRule
impl Unpin for ChainRule
impl UnwindSafe for ChainRule
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> 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