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 r204177 = wj;
double r204178 = exp(r204177);
double r204179 = r204177 * r204178;
double r204180 = x;
double r204181 = r204179 - r204180;
double r204182 = r204178 + r204179;
double r204183 = r204181 / r204182;
double r204184 = r204177 - r204183;
return r204184;
}
double f(double wj, double x) {
double r204185 = x;
double r204186 = wj;
double r204187 = 2.0;
double r204188 = pow(r204186, r204187);
double r204189 = r204185 + r204188;
double r204190 = r204186 * r204185;
double r204191 = r204187 * r204190;
double r204192 = r204189 - r204191;
return r204192;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.6 |
|---|---|
| Target | 12.9 |
| Herbie | 2.1 |
Initial program 13.6
Simplified12.9
Taylor expanded around 0 2.1
Final simplification2.1
herbie shell --seed 2019199
(FPCore (wj x)
:name "Jmat.Real.lambertw, newton loop step"
:herbie-target
(- wj (- (/ wj (+ wj 1.0)) (/ x (+ (exp wj) (* wj (exp wj))))))
(- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))