Fast and accurate implementations of the Lambert-W Function for a variety of different contexts. These implementations are the first to provide robust accuracy guarantees for all possible inputs, without sacrificing performance.
Implementations are provided for two different precisions (float and double) for both function branches (
float MuirW0(float x);
double MuirW0(double x);
__m256 MuirW0(__m256 x);
__m256d MuirW0(__m256d x);
float MuirWm1(float x);
double MuirWm1(double x);
__m256 MuirWm1(__m256 x);
__m256d MuirWm1(__m256d x);All functions guarantee results within a fixed number of Units in the Last Place (ULPs) from the exact answers. Currently the following bounds have been verified with Clang 19.1.0 on Windows
| Function | Maximum ULP Error |
|---|---|
float
|
1 |
double
|
4 |
float (SIMD) |
4 |
double (SIMD) |
4 |
float
|
1 |
double
|
4 |
float (SIMD) |
4 |
double (SIMD) |
4 |
The main implementation has no dependencies, but the benchmarks and tests require
- Boost
- flttestlib
- ReferenceLambertW