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 r9518873 = wj;
double r9518874 = exp(r9518873);
double r9518875 = r9518873 * r9518874;
double r9518876 = x;
double r9518877 = r9518875 - r9518876;
double r9518878 = r9518874 + r9518875;
double r9518879 = r9518877 / r9518878;
double r9518880 = r9518873 - r9518879;
return r9518880;
}
double f(double wj, double x) {
double r9518881 = x;
double r9518882 = wj;
double r9518883 = r9518882 * r9518882;
double r9518884 = r9518881 + r9518883;
double r9518885 = r9518882 * r9518881;
double r9518886 = -2.0;
double r9518887 = r9518885 * r9518886;
double r9518888 = r9518884 + r9518887;
return r9518888;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.4 |
|---|---|
| Target | 12.8 |
| Herbie | 2.3 |
Initial program 13.4
Taylor expanded around 0 2.3
Simplified2.3
Final simplification2.3
herbie shell --seed 2019174
(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))))))