Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JSorngard authored Jul 28, 2024
1 parent da48d97 commit b5cb68b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;

Expand All @@ -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`.
`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`.

0 comments on commit b5cb68b

Please sign in to comment.