wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left(wj \cdot wj + \left(wj \cdot wj - wj\right) \cdot \left(wj \cdot wj\right)\right) + \frac{x}{wj \cdot e^{wj} + e^{wj}}double f(double wj, double x) {
double r5249629 = wj;
double r5249630 = exp(r5249629);
double r5249631 = r5249629 * r5249630;
double r5249632 = x;
double r5249633 = r5249631 - r5249632;
double r5249634 = r5249630 + r5249631;
double r5249635 = r5249633 / r5249634;
double r5249636 = r5249629 - r5249635;
return r5249636;
}
double f(double wj, double x) {
double r5249637 = wj;
double r5249638 = r5249637 * r5249637;
double r5249639 = r5249638 - r5249637;
double r5249640 = r5249639 * r5249638;
double r5249641 = r5249638 + r5249640;
double r5249642 = x;
double r5249643 = exp(r5249637);
double r5249644 = r5249637 * r5249643;
double r5249645 = r5249644 + r5249643;
double r5249646 = r5249642 / r5249645;
double r5249647 = r5249641 + r5249646;
return r5249647;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.9 |
|---|---|
| Target | 13.2 |
| Herbie | 1.2 |
Initial program 13.9
rmApplied div-sub13.9
Applied associate--r-7.6
Taylor expanded around 0 1.2
Simplified1.2
Final simplification1.2
herbie shell --seed 2019151
(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))))))