Skip to content

Commit

Permalink
None examples
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard committed Jul 29, 2024
1 parent 670e37a commit b2d0e7e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ pub fn lambert_w_m1(z: f64) -> Option<f64> {
///
/// Uses the version of the Lambert W function with 50 bits of accuracy during the evaluation.
///
/// # Example
/// # Examples
///
/// ```
/// # use approx::assert_abs_diff_eq;
Expand All @@ -191,6 +191,12 @@ pub fn lambert_w_m1(z: f64) -> Option<f64> {
///
/// 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<f64> {
lambert_w_0(z).map(|w| {
if z.abs() <= 0.1 {
Expand Down Expand Up @@ -218,6 +224,12 @@ pub fn d_lambert_w_0(z: f64) -> Option<f64> {
///
/// 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<f64> {
sp_lambert_w_0(z).map(|w| {
if z.abs() <= 0.1 {
Expand Down

0 comments on commit b2d0e7e

Please sign in to comment.