From b5cb68bb6fad1fc1103eb1c41385b27570797347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johanna=20S=C3=B6rng=C3=A5rd?= <44257381+JSorngard@users.noreply.github.com> Date: Sun, 28 Jul 2024 20:56:35 +0200 Subject: [PATCH] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 304e1fd..e5f90f3 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ This method uses a piecewise minimax rational approximation of the function. Evaluate 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; @@ -24,6 +25,7 @@ assert_abs_diff_eq!(w, 1.0736581947961492); 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; @@ -35,4 +37,4 @@ assert_abs_diff_eq!(w, 1.0736581947961492, epsilon = 1e-7); ## Speed-accuracy trade-off The 50-bit accurate versions in the `accurate` module are more accurate, but slightly slower, than the 24-bit accurate versions in the `fast` module. -`fast::lambert_w_0` is around 15% faster than `accurate::lambert_w_0` and `fast::lambert_w_m1` is around 41% faster than `accurate::lambert_w_m1`. \ No newline at end of file +`fast::lambert_w_0` is around 15% faster than `accurate::lambert_w_0` and `fast::lambert_w_m1` is around 41% faster than `accurate::lambert_w_m1`.