wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\frac{\frac{x}{wj + 1}}{e^{wj}} + \left(\left({wj}^{4} + {wj}^{2}\right) - {wj}^{3}\right)double f(double wj, double x) {
double r381912 = wj;
double r381913 = exp(r381912);
double r381914 = r381912 * r381913;
double r381915 = x;
double r381916 = r381914 - r381915;
double r381917 = r381913 + r381914;
double r381918 = r381916 / r381917;
double r381919 = r381912 - r381918;
return r381919;
}
double f(double wj, double x) {
double r381920 = x;
double r381921 = wj;
double r381922 = 1.0;
double r381923 = r381921 + r381922;
double r381924 = r381920 / r381923;
double r381925 = exp(r381921);
double r381926 = r381924 / r381925;
double r381927 = 4.0;
double r381928 = pow(r381921, r381927);
double r381929 = 2.0;
double r381930 = pow(r381921, r381929);
double r381931 = r381928 + r381930;
double r381932 = 3.0;
double r381933 = pow(r381921, r381932);
double r381934 = r381931 - r381933;
double r381935 = r381926 + r381934;
return r381935;
}




Bits error versus wj




Bits error versus x
Results
| Original | 14.1 |
|---|---|
| Target | 13.5 |
| Herbie | 1.0 |
Initial program 14.1
Simplified13.5
rmApplied associate--l+7.4
Taylor expanded around 0 1.0
Final simplification1.0
herbie shell --seed 2020100
(FPCore (wj x)
:name "Jmat.Real.lambertw, newton loop step"
:precision binary64
:herbie-target
(- wj (- (/ wj (+ wj 1)) (/ x (+ (exp wj) (* wj (exp wj))))))
(- wj (/ (- (* wj (exp wj)) x) (+ (exp wj) (* wj (exp wj))))))