wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left({wj}^{2} + x\right) - 2 \cdot \left(x \cdot wj\right)double f(double wj, double x) {
double r139477 = wj;
double r139478 = exp(r139477);
double r139479 = r139477 * r139478;
double r139480 = x;
double r139481 = r139479 - r139480;
double r139482 = r139478 + r139479;
double r139483 = r139481 / r139482;
double r139484 = r139477 - r139483;
return r139484;
}
double f(double wj, double x) {
double r139485 = wj;
double r139486 = 2.0;
double r139487 = pow(r139485, r139486);
double r139488 = x;
double r139489 = r139487 + r139488;
double r139490 = r139488 * r139485;
double r139491 = r139486 * r139490;
double r139492 = r139489 - r139491;
return r139492;
}




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
Final simplification2.2
herbie shell --seed 2019195
(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))))))