Skip to main content

Jet2

Struct Jet2 

pub struct Jet2<T: Passive> {
    value: T,
    d1: T,
    d2: T,
}

Fields§

§value: T§d1: T§d2: T

Implementations§

§

impl<T: Passive> Jet2<T>

pub fn new(value: T, d1: T, d2: T) -> Self

pub fn constant(value: T) -> Self

pub fn variable(value: T) -> Self

pub fn value(&self) -> T

pub fn first_derivative(&self) -> T

pub fn second_derivative(&self) -> T

pub fn powf(self, n: T) -> Jet2<T>

§

impl<T: Passive> Jet2<T>

pub fn sin(self) -> Jet2<T>

Sine.

§

impl<T: Passive> Jet2<T>

pub fn cos(self) -> Jet2<T>

Cosine.

§

impl<T: Passive> Jet2<T>

pub fn tan(self) -> Jet2<T>

Tangent. f' = 1 + tan², f'' = 2·tan·f'.

§

impl<T: Passive> Jet2<T>

pub fn asin(self) -> Jet2<T>

Inverse sine. f' = 1/√(1-x²), f'' = x·f'³.

§

impl<T: Passive> Jet2<T>

pub fn acos(self) -> Jet2<T>

Inverse cosine. f' = -1/√(1-x²), f'' = x·f'³.

§

impl<T: Passive> Jet2<T>

pub fn atan(self) -> Jet2<T>

Inverse tangent. f' = 1/(1+x²), f'' = -2x·f'².

§

impl<T: Passive> Jet2<T>

pub fn sinh(self) -> Jet2<T>

Hyperbolic sine.

§

impl<T: Passive> Jet2<T>

pub fn cosh(self) -> Jet2<T>

Hyperbolic cosine.

§

impl<T: Passive> Jet2<T>

pub fn tanh(self) -> Jet2<T>

Hyperbolic tangent. f' = 1 - tanh², f'' = -2·tanh·f'.

§

impl<T: Passive> Jet2<T>

pub fn asinh(self) -> Jet2<T>

Inverse hyperbolic sine. f' = 1/√(x²+1), f'' = -x·f'³.

§

impl<T: Passive> Jet2<T>

pub fn acosh(self) -> Jet2<T>

Inverse hyperbolic cosine. f' = 1/√(x²-1), f'' = -x·f'³.

§

impl<T: Passive> Jet2<T>

pub fn atanh(self) -> Jet2<T>

Inverse hyperbolic tangent. f' = 1/(1-x²), f'' = 2x·f'².

§

impl<T: Passive> Jet2<T>

pub fn exp(self) -> Jet2<T>

Exponential. f = f' = f''.

§

impl<T: Passive> Jet2<T>

pub fn exp2(self) -> Jet2<T>

Base-2 exponential. f' = f·ln 2, f'' = f·(ln 2)².

§

impl<T: Passive> Jet2<T>

pub fn ln(self) -> Jet2<T>

Natural logarithm. f' = 1/x, f'' = -1/x².

§

impl<T: Passive> Jet2<T>

pub fn log2(self) -> Jet2<T>

Base-2 logarithm. f' = 1/(x·ln 2), f'' = -f'/x.

§

impl<T: Passive> Jet2<T>

pub fn log10(self) -> Jet2<T>

Base-10 logarithm. f' = 1/(x·ln 10), f'' = -f'/x.

§

impl<T: Passive> Jet2<T>

pub fn ln_1p(self) -> Jet2<T>

ln(1 + x). f' = 1/(1+x), f'' = -f'².

§

impl<T: Passive> Jet2<T>

pub fn exp_m1(self) -> Jet2<T>

exp(x) - 1. f' = f'' = exp(x) = f + 1.

§

impl<T: Passive> Jet2<T>

pub fn sqrt(self) -> Jet2<T>

Square root. f' = 1/(2√x), f'' = -1/(4·x·√x).

§

impl<T: Passive> Jet2<T>

pub fn cbrt(self) -> Jet2<T>

Cube root. f' = 1/(3·f²), f'' = -2/(9·x·f²).

§

impl<T: Passive> Jet2<T>

pub fn abs(self) -> Jet2<T>

Absolute value. f' = sign(x), f'' = 0 (away from 0). At x = 0 the derivative is not defined; every surface takes the sub-gradient f'(0) = +1 (the x >= 0 branch), matching the winning-branch convention max/min use for payoffs.

§

impl<T: Passive> Jet2<T>

pub fn erf(self) -> Jet2<T>

Gaussian error function. f' = (2/√π)·e^{-x²}, f'' = -2x·f'.

§

impl<T: Passive> Jet2<T>

pub fn erfc(self) -> Jet2<T>

Complementary error function 1 - erf(x). f' = -(2/√π)·e^{-x²}.

§

impl<T: Passive> Jet2<T>

pub fn norm_cdf(self) -> Jet2<T>

Standard normal CDF Φ(x). f' = φ(x), f'' = -x·φ(x).

§

impl<T: Passive> Jet2<T>

pub fn norm_pdf(self) -> Jet2<T>

Standard normal density φ(x). f' = -x·φ(x), f'' = (x² − 1)·φ(x).

§

impl<T: Passive> Jet2<T>

pub fn inv_norm_cdf(self) -> Jet2<T>

Inverse standard normal CDF Φ⁻¹(p). f' = 1/φ(f), f'' = f·f'².

Trait Implementations§

§

impl<T: Passive> Add for Jet2<T>

§

type Output = Jet2<T>

The resulting type after applying the + operator.
§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
§

impl Add<Jet2<f64>> for f64

§

type Output = Jet2<f64>

The resulting type after applying the + operator.
§

fn add(self, rhs: Jet2<f64>) -> Jet2<f64>

Performs the + operation. Read more
§

impl<T: Passive> Add<T> for Jet2<T>

§

type Output = Jet2<T>

The resulting type after applying the + operator.
§

fn add(self, rhs: T) -> Self

Performs the + operation. Read more
§

impl<T: Passive> AddAssign for Jet2<T>

§

fn add_assign(&mut self, rhs: Jet2<T>)

Performs the += operation. Read more
§

impl<T: Passive> AddAssign<T> for Jet2<T>

§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
§

impl<T: Clone + Passive> Clone for Jet2<T>

§

fn clone(&self) -> Jet2<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T: Copy + Passive> Copy for Jet2<T>

§

impl<T: Passive> Debug for Jet2<T>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl<T: Passive> Default for Jet2<T>

§

fn default() -> Self

Returns the “default value” for a type. Read more
§

impl<T: Passive> Display for Jet2<T>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl<T: Passive> Div for Jet2<T>

§

type Output = Jet2<T>

The resulting type after applying the / operator.
§

fn div(self, rhs: Self) -> Self

Performs the / operation. Read more
§

impl Div<Jet2<f64>> for f64

§

type Output = Jet2<f64>

The resulting type after applying the / operator.
§

fn div(self, rhs: Jet2<f64>) -> Jet2<f64>

Performs the / operation. Read more
§

impl<T: Passive> Div<T> for Jet2<T>

§

type Output = Jet2<T>

The resulting type after applying the / operator.
§

fn div(self, rhs: T) -> Self

Performs the / operation. Read more
§

impl<T: Passive> DivAssign for Jet2<T>

§

fn div_assign(&mut self, rhs: Jet2<T>)

Performs the /= operation. Read more
§

impl<T: Passive> DivAssign<T> for Jet2<T>

§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
§

impl<T: Passive> From<T> for Jet2<T>

§

fn from(value: T) -> Self

Converts to this type from the input type.
§

impl From<i32> for Jet2<f64>

§

fn from(value: i32) -> Self

Converts to this type from the input type.
§

impl LiftParams for Jet2<f64>

§

fn lift(stored: &[f64]) -> Cow<'_, [Self]>

This mode’s view of stored. Read more
§

impl<T: Passive> Mul for Jet2<T>

§

type Output = Jet2<T>

The resulting type after applying the * operator.
§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
§

impl Mul<Jet2<f64>> for f64

§

type Output = Jet2<f64>

The resulting type after applying the * operator.
§

fn mul(self, rhs: Jet2<f64>) -> Jet2<f64>

Performs the * operation. Read more
§

impl<T: Passive> Mul<T> for Jet2<T>

§

type Output = Jet2<T>

The resulting type after applying the * operator.
§

fn mul(self, rhs: T) -> Self

Performs the * operation. Read more
§

impl<T: Passive> MulAssign for Jet2<T>

§

fn mul_assign(&mut self, rhs: Jet2<T>)

Performs the *= operation. Read more
§

impl<T: Passive> MulAssign<T> for Jet2<T>

§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
§

impl<T: Passive> Neg for Jet2<T>

§

type Output = Jet2<T>

The resulting type after applying the - operator.
§

fn neg(self) -> Self

Performs the unary - operation. Read more
§

impl<T: Passive> PartialEq for Jet2<T>

§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<T: Passive> PartialOrd for Jet2<T>

§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Real for Jet2<f64>

§

type Passive = f64

§

fn value(&self) -> f64

§

fn zero() -> Self

§

fn one() -> Self

§

fn powf(&self, exponent: Self) -> Self

§

fn powi(&self, exponent: i32) -> Self

§

fn sum(xs: &[Self]) -> Self

§

fn dot(xs: &[Self], ys: &[Self]) -> Self

§

fn weighted_sum(ws: &[Self::Passive], xs: &[Self]) -> Self

§

fn weighted_dot(ws: &[Self::Passive], xs: &[Self], ys: &[Self]) -> Self

§

fn max(&self, other: &Self) -> Self

§

fn min(&self, other: &Self) -> Self

§

fn sin(&self) -> Self

Sine.
§

fn cos(&self) -> Self

Cosine.
§

fn tan(&self) -> Self

Tangent. f' = 1 + tan², f'' = 2·tan·f'.
§

fn asin(&self) -> Self

Inverse sine. f' = 1/√(1-x²), f'' = x·f'³.
§

fn acos(&self) -> Self

Inverse cosine. f' = -1/√(1-x²), f'' = x·f'³.
§

fn atan(&self) -> Self

Inverse tangent. f' = 1/(1+x²), f'' = -2x·f'².
§

fn sinh(&self) -> Self

Hyperbolic sine.
§

fn cosh(&self) -> Self

Hyperbolic cosine.
§

fn tanh(&self) -> Self

Hyperbolic tangent. f' = 1 - tanh², f'' = -2·tanh·f'.
§

fn asinh(&self) -> Self

Inverse hyperbolic sine. f' = 1/√(x²+1), f'' = -x·f'³.
§

fn acosh(&self) -> Self

Inverse hyperbolic cosine. f' = 1/√(x²-1), f'' = -x·f'³.
§

fn atanh(&self) -> Self

Inverse hyperbolic tangent. f' = 1/(1-x²), f'' = 2x·f'².
§

fn exp(&self) -> Self

Exponential. f = f' = f''.
§

fn exp2(&self) -> Self

Base-2 exponential. f' = f·ln 2, f'' = f·(ln 2)².
§

fn ln(&self) -> Self

Natural logarithm. f' = 1/x, f'' = -1/x².
§

fn log2(&self) -> Self

Base-2 logarithm. f' = 1/(x·ln 2), f'' = -f'/x.
§

fn log10(&self) -> Self

Base-10 logarithm. f' = 1/(x·ln 10), f'' = -f'/x.
§

fn ln_1p(&self) -> Self

ln(1 + x). f' = 1/(1+x), f'' = -f'².
§

fn exp_m1(&self) -> Self

exp(x) - 1. f' = f'' = exp(x) = f + 1.
§

fn sqrt(&self) -> Self

Square root. f' = 1/(2√x), f'' = -1/(4·x·√x).
§

fn cbrt(&self) -> Self

Cube root. f' = 1/(3·f²), f'' = -2/(9·x·f²).
§

fn abs(&self) -> Self

Absolute value. f' = sign(x), f'' = 0 (away from 0). At x = 0 the derivative is not defined; every surface takes the sub-gradient f'(0) = +1 (the x >= 0 branch), matching the winning-branch convention max/min use for payoffs.
§

fn erf(&self) -> Self

Gaussian error function. f' = (2/√π)·e^{-x²}, f'' = -2x·f'.
§

fn erfc(&self) -> Self

Complementary error function 1 - erf(x). f' = -(2/√π)·e^{-x²}.
§

fn norm_cdf(&self) -> Self

Standard normal CDF Φ(x). f' = φ(x), f'' = -x·φ(x).
§

fn norm_pdf(&self) -> Self

Standard normal density φ(x). f' = -x·φ(x), f'' = (x² − 1)·φ(x).
§

fn inv_norm_cdf(&self) -> Self

Inverse standard normal CDF Φ⁻¹(p). f' = 1/φ(f), f'' = f·f'².
§

impl Seedable for Jet2<f64>

§

fn seed(value: f64) -> Self

value, carrying a unit derivative in this mode’s single direction.
§

impl<T: Passive> Sub for Jet2<T>

§

type Output = Jet2<T>

The resulting type after applying the - operator.
§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
§

impl Sub<Jet2<f64>> for f64

§

type Output = Jet2<f64>

The resulting type after applying the - operator.
§

fn sub(self, rhs: Jet2<f64>) -> Jet2<f64>

Performs the - operation. Read more
§

impl<T: Passive> Sub<T> for Jet2<T>

§

type Output = Jet2<T>

The resulting type after applying the - operator.
§

fn sub(self, rhs: T) -> Self

Performs the - operation. Read more
§

impl<T: Passive> SubAssign for Jet2<T>

§

fn sub_assign(&mut self, rhs: Jet2<T>)

Performs the -= operation. Read more
§

impl<T: Passive> SubAssign<T> for Jet2<T>

§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Jet2<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Jet2<T>
where T: RefUnwindSafe,

§

impl<T> Send for Jet2<T>

§

impl<T> Sync for Jet2<T>

§

impl<T> Unpin for Jet2<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Jet2<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Jet2<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<R> CopyableReal for R
where R: Real + Copy,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<R> Scalar for R
where R: Real<Passive = f64> + LiftParams + Copy,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.