diff --git a/src/lib.rs b/src/lib.rs index 9bb0cef..69a5e55 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -179,7 +179,7 @@ pub fn lambert_w_m1(z: f64) -> Option { /// /// Uses the version of the Lambert W function with 50 bits of accuracy during the evaluation. /// -/// # Example +/// # Examples /// /// ``` /// # use approx::assert_abs_diff_eq; @@ -191,6 +191,12 @@ pub fn lambert_w_m1(z: f64) -> Option { /// /// assert_abs_diff_eq!(dw, 0.5 / (1.5 * x)); /// ``` +/// Arguments smaller than -1/e (≈ -0.36787944117144233) result in `None`: +/// ``` +/// # use approx::assert_abs_diff_eq; +/// # use lambert_w::d_lambert_w_0; +/// assert_eq!(d_lambert_w_0(-1.0), None); +/// ``` pub fn d_lambert_w_0(z: f64) -> Option { lambert_w_0(z).map(|w| { if z.abs() <= 0.1 { @@ -218,6 +224,12 @@ pub fn d_lambert_w_0(z: f64) -> Option { /// /// assert_abs_diff_eq!(dw, 0.5 / (1.5 * x), epsilon = 1e-7); /// ``` +/// Arguments smaller than -1/e (≈ -0.36787944117144233) result in `None`: +/// ``` +/// # use approx::assert_abs_diff_eq; +/// # use lambert_w::sp_d_lambert_w_0; +/// assert_eq!(sp_d_lambert_w_0(-1.0), None); +/// ``` pub fn sp_d_lambert_w_0(z: f64) -> Option { sp_lambert_w_0(z).map(|w| { if z.abs() <= 0.1 {