xad-rs 0.8.1

Exact automatic differentiation for Rust — forward-mode, reverse-mode, first- and second-order, with named variable support and a unified `Real` trait for mode-agnostic numerical code
Documentation
//! The `Passive` trait — the bound for the underlying *passive* (non-AD)
//! scalar storage type that the active scalars (`AReal<T>`, `Jet1<T>`,
//! `Jet2<T>`) wrap.
//!
//! Renamed from `Scalar` in 0.5.0 to free the QuantLib-aligned name
//! `Real` for the unified *active*-scalar trait at [`crate::real::Real`]
//! and to make the passive/active distinction explicit. The deprecation
//! alias `xad_rs::Scalar` shipped through 0.5.x and was removed in 0.6.0.

use num_traits::{Float, FromPrimitive, NumAssign};
use std::fmt::{Debug, Display};

/// Trait bound for the passive (non-AD) scalar storage types usable in
/// the AD machinery. Implemented for `f32` and `f64`.
pub trait Passive:
    Float + NumAssign + FromPrimitive + Debug + Display + Default + Send + Sync + 'static
{
}

impl Passive for f32 {}
impl Passive for f64 {}