wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(x + {wj}^{2}\right) - 2 \cdot \left(wj \cdot x\right)double f(double wj, double x) {
double r269752 = wj;
double r269753 = exp(r269752);
double r269754 = r269752 * r269753;
double r269755 = x;
double r269756 = r269754 - r269755;
double r269757 = r269753 + r269754;
double r269758 = r269756 / r269757;
double r269759 = r269752 - r269758;
return r269759;
}
double f(double wj, double x) {
double r269760 = x;
double r269761 = wj;
double r269762 = 2.0;
double r269763 = pow(r269761, r269762);
double r269764 = r269760 + r269763;
double r269765 = r269761 * r269760;
double r269766 = r269762 * r269765;
double r269767 = r269764 - r269766;
return r269767;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.3 |
|---|---|
| Target | 12.7 |
| Herbie | 2.0 |
Initial program 13.3
Simplified12.7
Taylor expanded around 0 2.0
Final simplification2.0
herbie shell --seed 2019322
(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))))))