wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}x + wj \cdot \left(wj - 2 \cdot x\right)
double f(double wj, double x) {
double r248266 = wj;
double r248267 = exp(r248266);
double r248268 = r248266 * r248267;
double r248269 = x;
double r248270 = r248268 - r248269;
double r248271 = r248267 + r248268;
double r248272 = r248270 / r248271;
double r248273 = r248266 - r248272;
return r248273;
}
double f(double wj, double x) {
double r248274 = x;
double r248275 = wj;
double r248276 = 2.0;
double r248277 = r248276 * r248274;
double r248278 = r248275 - r248277;
double r248279 = r248275 * r248278;
double r248280 = r248274 + r248279;
return r248280;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.6 |
|---|---|
| Target | 13.0 |
| Herbie | 2.1 |
Initial program 13.6
Simplified13.0
Taylor expanded around 0 2.1
rmApplied associate--l+2.1
Simplified2.1
Final simplification2.1
herbie shell --seed 2020021
(FPCore (wj x)
:name "Jmat.Real.lambertw, newton loop step"
:precision binary64
:herbie-target
(- wj (- (/ wj (+ wj 1)) (/ x (+ (exp wj) (* wj (exp wj))))))
(- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))