lambert_w
Fast evaluation of the principal and secondary branches of the Lambert W function using the method of Toshio Fukushima to either 24 or 50 bits of accuracy.
This method uses a piecewise minimax rational approximation of the function.
Examples
Evaluate the principal branch of the Lambert W function to 50 bits of accuracy:
use lambert_w_0;
use PI;
use assert_abs_diff_eq;
let w = lambert_w_0?;
assert_abs_diff_eq!;
or to only 24 bits of accuracy, but with faster execution time:
use lambert_w_0;
use PI;
use assert_abs_diff_eq;
let w = lambert_w_0?;
assert_abs_diff_eq!;
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.