wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}wj \cdot \left(wj - x \cdot 2\right) + x
double f(double wj, double x) {
double r223486 = wj;
double r223487 = exp(r223486);
double r223488 = r223486 * r223487;
double r223489 = x;
double r223490 = r223488 - r223489;
double r223491 = r223487 + r223488;
double r223492 = r223490 / r223491;
double r223493 = r223486 - r223492;
return r223493;
}
double f(double wj, double x) {
double r223494 = wj;
double r223495 = x;
double r223496 = 2.0;
double r223497 = r223495 * r223496;
double r223498 = r223494 - r223497;
double r223499 = r223494 * r223498;
double r223500 = r223499 + r223495;
return r223500;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.4 |
|---|---|
| Target | 12.8 |
| Herbie | 2.2 |
Initial program 13.4
Simplified12.8
Taylor expanded around 0 2.2
Simplified2.2
Final simplification2.2
herbie shell --seed 2020046
(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))))))