wj - \frac{wj \cdot e^{wj} - x}{e^{wj} + wj \cdot e^{wj}}\left({wj}^{4} + {wj}^{2}\right) + \left(\frac{x}{\left(1 + wj\right) \cdot e^{wj}} - {wj}^{3}\right)double f(double wj, double x) {
double r137718 = wj;
double r137719 = exp(r137718);
double r137720 = r137718 * r137719;
double r137721 = x;
double r137722 = r137720 - r137721;
double r137723 = r137719 + r137720;
double r137724 = r137722 / r137723;
double r137725 = r137718 - r137724;
return r137725;
}
double f(double wj, double x) {
double r137726 = wj;
double r137727 = 4.0;
double r137728 = pow(r137726, r137727);
double r137729 = 2.0;
double r137730 = pow(r137726, r137729);
double r137731 = r137728 + r137730;
double r137732 = x;
double r137733 = 1.0;
double r137734 = r137733 + r137726;
double r137735 = exp(r137726);
double r137736 = r137734 * r137735;
double r137737 = r137732 / r137736;
double r137738 = 3.0;
double r137739 = pow(r137726, r137738);
double r137740 = r137737 - r137739;
double r137741 = r137731 + r137740;
return r137741;
}




Bits error versus wj




Bits error versus x
Results
| Original | 13.3 |
|---|---|
| Target | 12.7 |
| Herbie | 1.1 |
Initial program 13.3
rmApplied div-sub13.3
Applied associate--r-7.0
Simplified6.4
Taylor expanded around 0 1.1
rmApplied sub-neg1.1
Applied associate-+l+1.1
Simplified1.1
Final simplification1.1
herbie shell --seed 2019322
(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))))))