-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the Lambert W function as a wrapper around the lambert_w
crate.
#63
Conversation
[`LambertWAccuracyMode::Precise`] -> [`Precise](LambertWAccuracyMode::Precise)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your excellent work on implementing the Lambert W function, @JSorngard. I've thoroughly reviewed your code, and I'm impressed with its quality and attention to detail. Here's my review:
-
Dependency Addition:
- The dependency has been appropriately added to Cargo.toml.
-
Function Imports:
I've checked that the following functions have been correctly imported:- gaussian
- gamma
- ln_gamma
- poch
- inc_gamma
- inv_inc_gamma
- erf
- erfc
- inv_erf
- inv_erfc
- beta
- inc_beta
- inv_inv_beta (this is my typo - I'll fix it)
- phi
-
Code Structure and Style:
- The code is well-organized and follows Rust best practices.
- The implementation is concise yet readable.
-
Documentation:
- Excellent job on the documentation. It's comprehensive and clear.
- Reference to Fukushima's method is very helpful.
- The examples in the doc comments will be valuable for users.
-
Functionality:
- The flexible implementation is well done.
- I appreciate the accurate version being made available in
prelude
. - The error handling looks appropriate, returning
NAN
for out-of-domain inputs.
Overall, this is a high-quality contribution that fits well with Peroxide's goals and structure. Great work!
Thank you so much for the review! |
Thank you, @JSorngard, for this excellent contribution! Your implementation of the Lambert W function is top-notch and aligns perfectly with Peroxide's goals. I've reviewed the code thoroughly, and I'm impressed with its quality, efficiency, and the thoughtful balance between flexibility and ease of use. I'm happy to inform you that I'll be merging this Pull Request right away. We'll include your contribution in the next release of Peroxide, which I plan to push out soon. Once again, thank you for your hard work. Your contribution is greatly appreciated and will certainly benefit many Peroxide users. |
- Integrate with Lambert W crate (#63)
- Integrate with Lambert W crate (#63)
I'm pleased to inform you that your Lambert W function implementation has been officially published as part of Peroxide version 0.37.8. Users can now take advantage of your excellent work by updating to this latest version. To all Peroxide users: The Lambert W function is now available starting from version 0.37.8. You can update your dependency in Cargo.toml to access this new feature: [dependencies]
peroxide = "0.37.8" @JSorngard, thank you once again for your valuable contribution. It's now live and ready to benefit the entire Peroxide community. Your work is greatly appreciated! If anyone encounters any issues or has questions about the new Lambert W function, please don't hesitate to open a new issue on our GitHub repository. |
Ooh, this is exciting! I'll check the issues every now and then to see if there are any problems with the implementations. |
This PR implements a version of the Lambert W function in
special::function
(and thus also infuga
) that is flexible in terms of speed and accuracy, and then exports only the accurate (but still fast) version inprelude
.The method used is described in this article by Toshio Fukushima: https://www.researchgate.net/publication/346309410_Precise_and_fast_computation_of_Lambert_W_function_by_piecewise_minimax_rational_function_approximation_with_variable_transformation
See related discussion in #64.