wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}wj \cdot \left(wj + x \cdot -2\right) + x
double f(double wj, double x) {
double r33875676 = wj;
double r33875677 = exp(r33875676);
double r33875678 = r33875676 * r33875677;
double r33875679 = x;
double r33875680 = r33875678 - r33875679;
double r33875681 = r33875677 + r33875678;
double r33875682 = r33875680 / r33875681;
double r33875683 = r33875676 - r33875682;
return r33875683;
}
double f(double wj, double x) {
double r33875684 = wj;
double r33875685 = x;
double r33875686 = -2.0;
double r33875687 = r33875685 * r33875686;
double r33875688 = r33875684 + r33875687;
double r33875689 = r33875684 * r33875688;
double r33875690 = r33875689 + r33875685;
return r33875690;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.7 |
|---|---|
| Target | 13.1 |
| Herbie | 2.1 |
Initial program 13.7
Taylor expanded around 0 2.1
Simplified2.1
Final simplification2.1
herbie shell --seed 2019124
(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))))))