wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(x + wj \cdot wj\right) + \left(wj \cdot x\right) \cdot -2
double f(double wj, double x) {
double r4612268 = wj;
double r4612269 = exp(r4612268);
double r4612270 = r4612268 * r4612269;
double r4612271 = x;
double r4612272 = r4612270 - r4612271;
double r4612273 = r4612269 + r4612270;
double r4612274 = r4612272 / r4612273;
double r4612275 = r4612268 - r4612274;
return r4612275;
}
double f(double wj, double x) {
double r4612276 = x;
double r4612277 = wj;
double r4612278 = r4612277 * r4612277;
double r4612279 = r4612276 + r4612278;
double r4612280 = r4612277 * r4612276;
double r4612281 = -2.0;
double r4612282 = r4612280 * r4612281;
double r4612283 = r4612279 + r4612282;
return r4612283;
}




Bits error versus wj




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