wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(wj \cdot wj + \left(wj \cdot wj - wj\right) \cdot \left(wj \cdot wj\right)\right) + \frac{x}{wj \cdot e^{wj} + e^{wj}}double f(double wj, double x) {
double r6938012 = wj;
double r6938013 = exp(r6938012);
double r6938014 = r6938012 * r6938013;
double r6938015 = x;
double r6938016 = r6938014 - r6938015;
double r6938017 = r6938013 + r6938014;
double r6938018 = r6938016 / r6938017;
double r6938019 = r6938012 - r6938018;
return r6938019;
}
double f(double wj, double x) {
double r6938020 = wj;
double r6938021 = r6938020 * r6938020;
double r6938022 = r6938021 - r6938020;
double r6938023 = r6938022 * r6938021;
double r6938024 = r6938021 + r6938023;
double r6938025 = x;
double r6938026 = exp(r6938020);
double r6938027 = r6938020 * r6938026;
double r6938028 = r6938027 + r6938026;
double r6938029 = r6938025 / r6938028;
double r6938030 = r6938024 + r6938029;
return r6938030;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.7 |
|---|---|
| Target | 13.1 |
| Herbie | 1.1 |
Initial program 13.7
rmApplied div-sub13.7
Applied associate--r-7.7
Taylor expanded around 0 1.1
Simplified1.1
Final simplification1.1
herbie shell --seed 2019152
(FPCore (wj x)
:name "Jmat.Real.lambertw, newton loop step"
:herbie-target
(- wj (- (/ wj (+ wj 1)) (/ x (+ (exp wj) (* wj (exp wj))))))
(- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))