wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(\left(wj \cdot wj + {wj}^{4}\right) - {wj}^{3}\right) + \frac{\frac{x}{e^{wj}}}{wj + 1}(FPCore (wj x) :precision binary64 (- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))
(FPCore (wj x) :precision binary64 (+ (- (+ (* wj wj) (pow wj 4.0)) (pow wj 3.0)) (/ (/ x (exp wj)) (+ wj 1.0))))
double code(double wj, double x) {
return wj - (((wj * exp(wj)) - x) / (exp(wj) + (wj * exp(wj))));
}
double code(double wj, double x) {
return (((wj * wj) + pow(wj, 4.0)) - pow(wj, 3.0)) + ((x / exp(wj)) / (wj + 1.0));
}




Bits error versus wj




Bits error versus x
Results
| Original | 14.1 |
|---|---|
| Target | 13.5 |
| Herbie | 1.0 |
Initial program 14.1
Simplified13.5
rmApplied div-sub_binary64_442013.5
Applied associate--r-_binary64_44847.2
Taylor expanded around 0 1.0
Simplified1.0
Final simplification1.0
herbie shell --seed 2020231
(FPCore (wj x)
:name "Jmat.Real.lambertw, newton loop step"
:precision binary64
:herbie-target
(- wj (- (/ wj (+ wj 1.0)) (/ x (+ (exp wj) (* wj (exp wj))))))
(- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))