Skip to content

Commit

Permalink
Merge pull request #79 from JSorngard/update_puruspe
Browse files Browse the repository at this point in the history
Update `puruspe` dependency, remove `lambert_w` dependency (#64)
  • Loading branch information
Axect authored Oct 17, 2024
2 parents 569a065 + 7bb76d5 commit 12e34b9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
6 changes: 1 addition & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ csv = { version = "1.3", optional = true, default-features = false }
rand = { version = "0.8", features = ["small_rng"] }
rand_distr = "0.4"
order-stat = "0.1"
puruspe = "0.2"
puruspe = "0.3"
matrixmultiply = { version = "0.3", features = ["threading"] }
peroxide-ad = "0.3"
peroxide-num = "0.1"
Expand All @@ -52,10 +52,6 @@ arrow2 = { version = "0.18", features = [
"io_parquet_compression",
], optional = true }
num-complex = { version = "0.4", optional = true }
lambert_w = { version = "0.4.0", default-features = false, features = [
"24bits",
"50bits",
] }

[package.metadata.docs.rs]
rustdoc-args = ["--html-in-header", "katex-header.html", "--cfg", "docsrs"]
Expand Down
2 changes: 1 addition & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release 0.37.10 (in progress)

- Update `lambert_w` dependency to `0.4.0` [#66](https://github.com/Axect/Peroxide/pull/66) (Thanks to [@JSorngard](https://github.com/JSorngard))
- Update `puruspe` dependency to `0.3.0`, remove `lambert_w` dependency [#79](https://github.com/Axect/Peroxide/pull/79) (Thanks to [@JSorngard](https://github.com/JSorngard))

# Release 0.37.9 (2024-07-31)

Expand Down
12 changes: 6 additions & 6 deletions src/special/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ pub fn phi(x: f64) -> f64 {
/// Use [`Precise`](LambertWAccuracyMode::Precise) for 50 bits of accuracy and the [`Simple`](LambertWAccuracyMode::Simple) mode
/// for only 24 bits, but with faster execution time.
///
/// Wrapper of the `lambert_w_0` and `sp_lambert_w_0` functions of the `lambert_w` crate.
/// Wrapper of the `lambert_w_0` and `sp_lambert_w_0` functions of the `puruspe` crate.
///
/// # Reference
///
/// [Toshio Fukushima, Precise and fast computation of Lambert W function by piecewise minimax rational function approximation with variable transformation](https://www.researchgate.net/publication/346309410_Precise_and_fast_computation_of_Lambert_W_function_by_piecewise_minimax_rational_function_approximation_with_variable_transformation)
pub fn lambert_w0(z: f64, mode: LambertWAccuracyMode) -> f64 {
match mode {
LambertWAccuracyMode::Precise => lambert_w::lambert_w_0(z),
LambertWAccuracyMode::Simple => lambert_w::sp_lambert_w_0(z),
LambertWAccuracyMode::Precise => puruspe::lambert_w0(z),
LambertWAccuracyMode::Simple => puruspe::sp_lambert_w0(z),
}
}

Expand All @@ -144,15 +144,15 @@ pub fn lambert_w0(z: f64, mode: LambertWAccuracyMode) -> f64 {
/// Use [`Precise`](LambertWAccuracyMode::Precise) for 50 bits of accuracy and the [`Simple`](LambertWAccuracyMode::Simple) mode
/// for only 24 bits, but with faster execution time.
///
/// Wrapper of the `lambert_w_m1` and `sp_lambert_w_m1` functions of the `lambert_w` crate.
/// Wrapper of the `lambert_w_m1` and `sp_lambert_w_m1` functions of the `puruspe` crate.
///
/// # Reference
///
/// [Toshio Fukushima, Precise and fast computation of Lambert W function by piecewise minimax rational function approximation with variable transformation](https://www.researchgate.net/publication/346309410_Precise_and_fast_computation_of_Lambert_W_function_by_piecewise_minimax_rational_function_approximation_with_variable_transformation)
pub fn lambert_wm1(z: f64, mode: LambertWAccuracyMode) -> f64 {
match mode {
LambertWAccuracyMode::Precise => lambert_w::lambert_w_m1(z),
LambertWAccuracyMode::Simple => lambert_w::sp_lambert_w_m1(z),
LambertWAccuracyMode::Precise => puruspe::lambert_wm1(z),
LambertWAccuracyMode::Simple => puruspe::sp_lambert_wm1(z),
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/special/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
//! - Lambert W function (principal branch W₀ and secondary branch W₋₁)
//!
//! Many of these functions are implemented using efficient numerical approximations
//! or by wrapping functions from other crates (e.g., `puruspe`, `lambert_w`).
//! or by wrapping functions from other crates (e.g., `puruspe`).
//!
//! The module also includes an enum `LambertWAccuracyMode` to control the
//! accuracy-speed trade-off for Lambert W function calculations.
Expand Down

0 comments on commit 12e34b9

Please sign in to comment.