diff --git a/CHANGELOG.md b/CHANGELOG.md index 07b5d3f..b4eb616 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.5 + + - Correct the domain bounds in the function documentation strings. + ## 0.2.2, 0.2.3, and 0.2.4 - Documentation improvements. diff --git a/README.md b/README.md index c87790f..90cdc5d 100644 --- a/README.md +++ b/README.md @@ -11,28 +11,26 @@ This method uses a piecewise minimax rational function approximation. ## Examples -Evaluate the principal branch of the Lambert W function to 50 bits of accuracy: +Evaluate the Omega constant with the principal branch of the Lambert W function to 50 bits of accuracy: ```rust use lambert_w::accurate::lambert_w_0; -use core::f64::consts::PI; use approx::assert_abs_diff_eq; -let w = lambert_w_0(PI).unwrap(); +let w = lambert_w_0(1.0).unwrap(); -assert_abs_diff_eq!(w, 1.0736581947961492); +assert_abs_diff_eq!(w, 0.5671432904097838); ``` or to only 24 bits of accuracy, but with faster execution time: ```rust use lambert_w::fast::lambert_w_0; -use core::f64::consts::PI; use approx::assert_abs_diff_eq; -let w = lambert_w_0(PI).unwrap(); +let w = lambert_w_0(1.0).unwrap(); -assert_abs_diff_eq!(w, 1.0736581947961492, epsilon = 1e-7); +assert_abs_diff_eq!(w, 0.5671432904097838, epsilon = 1e-7); ``` ## Speed-accuracy trade-off diff --git a/src/lib.rs b/src/lib.rs index 55a9325..2e64f48 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,19 +6,18 @@ //! //! ## Examples //! -//! Evaluate the principal branch of the Lambert W function to 50 bits of accuracy: +//! Evaluate the omega constant with the principal branch of the Lambert W function to 50 bits of accuracy: #![cfg_attr( feature = "50bits", doc = r##" ``` use lambert_w::accurate::lambert_w_0; -use core::f64::consts::PI; use approx::assert_abs_diff_eq; -let w = lambert_w_0(PI).unwrap(); +let w = lambert_w_0(1.0).unwrap(); -assert_abs_diff_eq!(w, 1.0736581947961492); +assert_abs_diff_eq!(w, 0.5671432904097838); ``` "## )] @@ -30,12 +29,11 @@ assert_abs_diff_eq!(w, 1.0736581947961492); ``` use lambert_w::fast::lambert_w_0; -use core::f64::consts::PI; use approx::assert_abs_diff_eq; -let w = lambert_w_0(PI).unwrap(); +let w = lambert_w_0(1.0).unwrap(); -assert_abs_diff_eq!(w, 1.0736581947961492, epsilon = 1e-7); +assert_abs_diff_eq!(w, 0.5671432904097838, epsilon = 1e-7); ``` "## )]